diff --git a/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc b/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc index ad8d20f57b9ed..6f4cdd5cb2c2d 100644 --- a/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc +++ b/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc @@ -1,7 +1,8 @@ -#include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "CalibCalorimetry/CaloMiscalibTools/interface/HcalRecHitRecalib.h" #include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "FWCore/ParameterSet/interface/FileInPath.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -53,7 +54,7 @@ void HcalRecHitRecalib::beginRun(const edm::Run&, const edm::EventSetup& iSetup) { edm::ESHandle topology; - iSetup.get().get( topology ); + iSetup.get().get( topology ); mapHcal_.prefillMap(*topology); diff --git a/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc b/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc index bd138cc4c4bc2..04df37c8e1c36 100644 --- a/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc +++ b/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc @@ -35,7 +35,7 @@ #include "CondFormats/HcalObjects/interface/HcalLutMetadata.h" #include "Geometry/HcalTowerAlgo/interface/HcalTrigTowerGeometry.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" - +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" // // class decleration @@ -151,7 +151,7 @@ CaloTPGTranscoderULUTs::produce(const CaloTPGRecord& iRecord) iRecord.getRecord().get(theTrigTowerGeometry); edm::ESHandle htopo; - iRecord.getRecord().getRecord().get(htopo); + iRecord.getRecord().getRecord().get(htopo); HcalLutMetadata fullLut{ *lutMetadata }; fullLut.setTopo(htopo.product()); diff --git a/CalibCalorimetry/HcalAlgos/interface/HcalPedestalAnalysis.h b/CalibCalorimetry/HcalAlgos/interface/HcalPedestalAnalysis.h index ea94353b875b7..592df94eb122d 100644 --- a/CalibCalorimetry/HcalAlgos/interface/HcalPedestalAnalysis.h +++ b/CalibCalorimetry/HcalAlgos/interface/HcalPedestalAnalysis.h @@ -47,6 +47,8 @@ class HcalPedestalAnalysis{ void SampleAnalysis(); + void setTopology(const HcalTopology* htopo) {fTopology = htopo;} + int done(const HcalPedestals* fInputPedestals, const HcalPedestalWidths* fInputWidths, HcalPedestals* fOutputPedestals, @@ -133,7 +135,7 @@ class HcalPedestalAnalysis{ int evt_curr; float m_stat[4]; std::vector state; - HcalTopology* fTopology; + const HcalTopology* fTopology; // flag to make gaussian fits to charge dists static const int fitflag=0; }; diff --git a/CalibCalorimetry/HcalAlgos/src/HcalPedestalAnalysis.cc b/CalibCalorimetry/HcalAlgos/src/HcalPedestalAnalysis.cc index 2a72f521243c5..cd745bd478a1d 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalPedestalAnalysis.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalPedestalAnalysis.cc @@ -19,9 +19,9 @@ HcalPedestalAnalysis::HcalPedestalAnalysis(const edm::ParameterSet& ps) fRawPedestals (0), fRawPedestalWidths (0), fValPedestals (0), - fValPedestalWidths (0) + fValPedestalWidths (0), + fTopology(0) { - fTopology=0; m_coder = 0; m_shape = 0; evt=0; @@ -61,8 +61,6 @@ HcalPedestalAnalysis::HcalPedestalAnalysis(const edm::ParameterSet& ps) if(m_startTS<0) m_startTS=0; m_endTS = ps.getUntrackedParameter("lastTS", 9); - fTopology=new HcalTopology(HcalTopologyMode::LHC,2,3); - // m_logFile.open("HcalPedestalAnalysis.log"); hbHists.ALLPEDS = new TH1F("HBHE All Pedestals","HBHE All Peds",10,0,9); diff --git a/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc b/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc index 94075f1499738..e286c9f6d313b 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc @@ -10,7 +10,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/CaloTopology/interface/HcalTopology.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" // #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" #include @@ -115,7 +115,7 @@ void HcalPulseShapes::beginRun(edm::EventSetup const & es) theMCParams = new HcalMCParams(*p.product()); edm::ESHandle htopo; - es.get().get(htopo); + es.get().get(htopo); theTopology=new HcalTopology(*htopo); theMCParams->setTopo(theTopology); diff --git a/CalibCalorimetry/HcalAlgos/test/MapTester.cc b/CalibCalorimetry/HcalAlgos/test/MapTester.cc index 3676dd803af4f..638515aefb5de 100644 --- a/CalibCalorimetry/HcalAlgos/test/MapTester.cc +++ b/CalibCalorimetry/HcalAlgos/test/MapTester.cc @@ -37,7 +37,7 @@ #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" #include "FWCore/Framework/interface/ESHandle.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" // // class decleration // @@ -95,7 +95,7 @@ MapTester::beginRun(const edm::EventSetup& iSetup) strftime(tempbuff,128,"%d.%b.%Y",localtime(&myTime) ); edm::ESHandle topo; - iSetup.get().get(topo); + iSetup.get().get(topo); HcalLogicalMapGenerator mygen; HcalLogicalMap mymap=mygen.createMap(&(*topo),mapIOV_); diff --git a/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.cc b/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.cc index 5b11339b92d86..8ee676a4346a5 100644 --- a/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.cc +++ b/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.cc @@ -100,7 +100,7 @@ void HcalDbProducer::pedestalsCallback (const HcalPedestalsRcd& fRecord) { mPedestals.reset( new HcalPedestals(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mPedestals->setTopo(topo); @@ -120,7 +120,7 @@ boost::shared_ptr HcalDbProducer::produceChannelQualityWithT boost::shared_ptr channelQuality( new HcalChannelQuality(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); channelQuality->setTopo(topo); @@ -134,7 +134,7 @@ void HcalDbProducer::pedestalWidthsCallback (const HcalPedestalWidthsRcd& fRecor mPedestalWidths.reset( new HcalPedestalWidths(*item)); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mPedestalWidths->setTopo(topo); @@ -152,7 +152,7 @@ void HcalDbProducer::gainsCallback (const HcalGainsRcd& fRecord) { mGains.reset( new HcalGains(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mGains->setTopo(topo); @@ -171,7 +171,7 @@ void HcalDbProducer::gainWidthsCallback (const HcalGainWidthsRcd& fRecord) { mGainWidths.reset( new HcalGainWidths(*item)); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mGainWidths->setTopo(topo); @@ -191,7 +191,7 @@ void HcalDbProducer::QIEDataCallback (const HcalQIEDataRcd& fRecord) { edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mQIEData->setTopo(topo); @@ -220,7 +220,7 @@ void HcalDbProducer::respCorrsCallback (const HcalRespCorrsRcd& fRecord) { mRespCorrs.reset( new HcalRespCorrs(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mRespCorrs->setTopo(topo); @@ -238,7 +238,7 @@ void HcalDbProducer::LUTCorrsCallback (const HcalLUTCorrsRcd& fRecord) { mLUTCorrs.reset( new HcalLUTCorrs(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mLUTCorrs->setTopo(topo); @@ -256,7 +256,7 @@ void HcalDbProducer::PFCorrsCallback (const HcalPFCorrsRcd& fRecord) { mPFCorrs.reset( new HcalPFCorrs(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mPFCorrs->setTopo(topo); @@ -274,7 +274,7 @@ void HcalDbProducer::timeCorrsCallback (const HcalTimeCorrsRcd& fRecord) { mTimeCorrs.reset( new HcalTimeCorrs(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mTimeCorrs->setTopo(topo); @@ -292,7 +292,7 @@ void HcalDbProducer::zsThresholdsCallback (const HcalZSThresholdsRcd& fRecord) { mZSThresholds.reset( new HcalZSThresholds(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mZSThresholds->setTopo(topo); @@ -310,7 +310,7 @@ void HcalDbProducer::L1triggerObjectsCallback (const HcalL1TriggerObjectsRcd& fR mL1TriggerObjects.reset( new HcalL1TriggerObjects(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mL1TriggerObjects->setTopo(topo); @@ -338,7 +338,7 @@ void HcalDbProducer::lutMetadataCallback (const HcalLutMetadataRcd& fRecord) { mLutMetadata.reset( new HcalLutMetadata(*item) ); edm::ESHandle htopo; - fRecord.getRecord().get(htopo); + fRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); mLutMetadata->setTopo(topo); diff --git a/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc b/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc index 08c908ad5e85d..812378ec38a9e 100644 --- a/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc +++ b/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc @@ -14,7 +14,7 @@ #include "CalibCalorimetry/HcalAlgos/interface/HcalDbHardcode.h" #include "CondFormats/DataRecord/interface/HcalAllRcds.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/ForwardGeometry/interface/ZdcTopology.h" #include "Geometry/CaloTopology/interface/HcalTopology.h" @@ -30,22 +30,22 @@ using namespace cms; namespace { std::vector allCells (const HcalTopology& hcaltopology) { - static std::vector result; - int maxDepthHB=hcaltopology.maxDepthHB(); - int maxDepthHE=hcaltopology.maxDepthHE(); + static std::vector result; + int maxDepthHB=hcaltopology.maxDepthHB(); + int maxDepthHE=hcaltopology.maxDepthHE(); /* std::cout << std::endl << "HcalHardcodeCalibrations: maxDepthHB, maxDepthHE = " << maxDepthHB << ", " << maxDepthHE << std::endl; */ - if (result.size () <= 0) { - for (int eta = -50; eta < 50; eta++) { - for (int phi = 0; phi < 100; phi++) { - for (int depth = 1; depth < maxDepthHB + maxDepthHE; depth++) { - for (int det = 1; det < 5; det++) { - HcalDetId cell ((HcalSubdetector) det, eta, phi, depth); - if (hcaltopology.valid(cell)) result.push_back (cell); + if (result.size () <= 0) { + for (int eta = -50; eta < 50; eta++) { + for (int phi = 0; phi < 100; phi++) { + for (int depth = 1; depth < maxDepthHB + maxDepthHE; depth++) { + for (int det = 1; det < 5; det++) { + HcalDetId cell ((HcalSubdetector) det, eta, phi, depth); + if (hcaltopology.valid(cell)) result.push_back (cell); /* if (hcaltopology.valid(cell)) @@ -53,62 +53,61 @@ namespace { << det << ", " << eta << ", " << phi << " , " << depth << std::endl; */ + } } } + } + ZdcTopology zdctopology; + HcalZDCDetId zcell; + HcalZDCDetId::Section section = HcalZDCDetId::EM; + for(int depth= 1; depth < 6; depth++){ + zcell = HcalZDCDetId(section, true, depth); + if(zdctopology.valid(zcell)) result.push_back(zcell); + zcell = HcalZDCDetId(section, false, depth); + if(zdctopology.valid(zcell)) result.push_back(zcell); } - } - ZdcTopology zdctopology; - HcalZDCDetId zcell; - HcalZDCDetId::Section section = HcalZDCDetId::EM; - for(int depth= 1; depth < 6; depth++){ - zcell = HcalZDCDetId(section, true, depth); - if(zdctopology.valid(zcell)) result.push_back(zcell); - zcell = HcalZDCDetId(section, false, depth); - if(zdctopology.valid(zcell)) result.push_back(zcell); - } - section = HcalZDCDetId::HAD; - for(int depth= 1; depth < 5; depth++){ - zcell = HcalZDCDetId(section, true, depth); - if(zdctopology.valid(zcell)) result.push_back(zcell); - zcell = HcalZDCDetId(section, false, depth); - if(zdctopology.valid(zcell)) result.push_back(zcell); - } - section = HcalZDCDetId::LUM; - for(int depth= 1; depth < 3; depth++){ - zcell = HcalZDCDetId(section, true, depth); - if(zdctopology.valid(zcell)) result.push_back(zcell); - zcell = HcalZDCDetId(section, false, depth); - if(zdctopology.valid(zcell)) result.push_back(zcell); - } - - // HcalGenTriggerTower (HcalGenericSubdetector = 5) - // NASTY HACK !!! - // - As no valid(cell) check found for HcalTrigTowerDetId - // to create HT cells (ieta=1-28, iphi=1-72)&(ieta=29-32, iphi=1,5,... 69) - - for (int eta = -32; eta <= 32; eta++) { - if(abs(eta) <= 28 && (eta != 0)) { - for (int phi = 1; phi <= 72; phi++) { - HcalTrigTowerDetId cell(eta, phi); - result.push_back (cell); - } + section = HcalZDCDetId::HAD; + for(int depth= 1; depth < 5; depth++){ + zcell = HcalZDCDetId(section, true, depth); + if(zdctopology.valid(zcell)) result.push_back(zcell); + zcell = HcalZDCDetId(section, false, depth); + if(zdctopology.valid(zcell)) result.push_back(zcell); + } + section = HcalZDCDetId::LUM; + for(int depth= 1; depth < 3; depth++){ + zcell = HcalZDCDetId(section, true, depth); + if(zdctopology.valid(zcell)) result.push_back(zcell); + zcell = HcalZDCDetId(section, false, depth); + if(zdctopology.valid(zcell)) result.push_back(zcell); } - else if (abs(eta) > 28) { - for (int phi = 1; phi <= 69;) { - HcalTrigTowerDetId cell(eta, phi); - result.push_back (cell); - phi += 4; + + // HcalGenTriggerTower (HcalGenericSubdetector = 5) + // NASTY HACK !!! + // - As no valid(cell) check found for HcalTrigTowerDetId + // to create HT cells (ieta=1-28, iphi=1-72)&(ieta=29-32, iphi=1,5,... 69) + + for (int eta = -32; eta <= 32; eta++) { + if(abs(eta) <= 28 && (eta != 0)) { + for (int phi = 1; phi <= 72; phi++) { + HcalTrigTowerDetId cell(eta, phi); + result.push_back (cell); + } + } + else if (abs(eta) > 28) { + for (int phi = 1; phi <= 69;) { + HcalTrigTowerDetId cell(eta, phi); + result.push_back (cell); + phi += 4; + } } } } + return result; } - return result; -} } -HcalHardcodeCalibrations::HcalHardcodeCalibrations ( const edm::ParameterSet& iConfig ): he_recalibration(0), hf_recalibration(0) -{ +HcalHardcodeCalibrations::HcalHardcodeCalibrations ( const edm::ParameterSet& iConfig ): he_recalibration(0), hf_recalibration(0), setHEdsegm(false), setHBdsegm(false), SipmLumi(0.0) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::HcalHardcodeCalibrations->..."; if ( iConfig.exists("GainWidthsForTrigPrims") ) @@ -133,41 +132,6 @@ HcalHardcodeCalibrations::HcalHardcodeCalibrations ( const edm::ParameterSet& iC // std::cout << " HcalHardcodeCalibrations: iLumi = " << iLumi << std::endl; } - bool relabel_=false; - edm::ParameterSet ps0; - if ( iConfig.exists("HcalReLabel") ) { - ps0 = iConfig.getParameter("HcalReLabel"); - relabel_= ps0.getUntrackedParameter("RelabelHits",false); - } - - if (relabel_) { - std::vector> m_segmentation; - m_segmentation.resize(29); - edm::ParameterSet ps1 = ps0.getUntrackedParameter("RelabelRules"); - for (int i = 0; i < 29; i++) { - char name[10]; - snprintf(name,10,"Eta%d",i+1); - if (i > 0) { - m_segmentation[i]= - ps1.getUntrackedParameter>(name,m_segmentation[i-1]); - } else { - m_segmentation[i]=ps1.getUntrackedParameter >(name); - } - - /* - std::cout << name; - for (unsigned int k=0; ksetDsegm(m_segmentation); - } - - std::vector toGet = iConfig.getUntrackedParameter > ("toGet"); for(std::vector ::iterator objectName = toGet.begin(); objectName != toGet.end(); ++objectName ) { bool all = *objectName == "all"; @@ -290,7 +254,7 @@ HcalHardcodeCalibrations::setIntervalFor( const edm::eventsetup::EventSetupRecor std::auto_ptr HcalHardcodeCalibrations::producePedestals (const HcalPedestalsRcd& rec) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestals-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalPedestals (topo,false)); @@ -305,7 +269,7 @@ std::auto_ptr HcalHardcodeCalibrations::producePedestals (const H std::auto_ptr HcalHardcodeCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rec) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePedestalWidths-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalPedestalWidths (topo,false)); @@ -320,7 +284,7 @@ std::auto_ptr HcalHardcodeCalibrations::producePedestalWidth std::auto_ptr HcalHardcodeCalibrations::produceGains (const HcalGainsRcd& rec) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGains-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalGains (topo)); @@ -335,7 +299,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceGains (const HcalGains std::auto_ptr HcalHardcodeCalibrations::produceGainWidths (const HcalGainWidthsRcd& rec) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceGainWidths-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalGainWidths (topo)); @@ -363,7 +327,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceQIEData (const HcalQ */ edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalQIEData (topo)); @@ -378,7 +342,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceQIEData (const HcalQ std::auto_ptr HcalHardcodeCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceChannelQuality-> ..."; edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalChannelQuality (topo)); @@ -394,9 +358,30 @@ std::auto_ptr HcalHardcodeCalibrations::produceChannelQualit std::auto_ptr HcalHardcodeCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRespCorrs-> ..."; edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); - + + //set depth segmentation for HB/HE recalib - only happens once +// if((he_recalibration && !setHEdsegm) || (hb_recalibration && !setHBdsegm)){ + if((he_recalibration && !setHEdsegm)) { + std::vector> m_segmentation; + int maxEta = topo->lastHERing(); + m_segmentation.resize(maxEta); + for (int i = 0; i < maxEta; i++) { + topo->getDepthSegmentation(i+1,m_segmentation[i]); + } + if(he_recalibration && !setHEdsegm){ + he_recalibration->setDsegm(m_segmentation); + setHEdsegm = true; + } + /* + if(hb_recalibration && !setHBdsegm){ + hb_recalibration->setDsegm(m_segmentation); + setHBdsegm = true; + } + */ + } + std::auto_ptr result (new HcalRespCorrs (topo)); std::vector cells = allCells(*topo); for (std::vector ::const_iterator cell = cells.begin (); cell != cells.end (); cell++) { @@ -438,7 +423,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceRespCorrs (const H std::auto_ptr HcalHardcodeCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLUTCorrs-> ..."; edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalLUTCorrs (topo)); @@ -453,7 +438,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceLUTCorrs (const Hca std::auto_ptr HcalHardcodeCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::producePFCorrs-> ..."; edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalPFCorrs (topo)); @@ -468,7 +453,7 @@ std::auto_ptr HcalHardcodeCalibrations::producePFCorrs (const HcalP std::auto_ptr HcalHardcodeCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimeCorrs-> ..."; edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalTimeCorrs (topo)); @@ -483,7 +468,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceTimeCorrs (const H std::auto_ptr HcalHardcodeCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZSThresholds-> ..."; edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalZSThresholds (topo)); @@ -499,7 +484,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceZSThresholds (c std::auto_ptr HcalHardcodeCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceL1TriggerObjects-> ..."; edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalL1TriggerObjects (topo)); @@ -528,7 +513,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceElectronicsMa std::auto_ptr HcalHardcodeCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceValidationCorrs-> ..."; edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalValidationCorrs (topo)); @@ -543,7 +528,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceValidationCo std::auto_ptr HcalHardcodeCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLutMetadata-> ..."; edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalLutMetadata (topo)); @@ -589,7 +574,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceDcsMap (const HcalDcs std::auto_ptr HcalHardcodeCalibrations::produceRecoParams (const HcalRecoParamsRcd& rec) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceRecoParams-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalRecoParams (topo)); @@ -603,7 +588,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceRecoParams (const std::auto_ptr HcalHardcodeCalibrations::produceTimingParams (const HcalTimingParamsRcd& rec) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceTimingParams-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalTimingParams (topo)); @@ -617,7 +602,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceTimingParams (c std::auto_ptr HcalHardcodeCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rec) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceLongRecoParams-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalLongRecoParams (topo)); @@ -643,7 +628,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceLongRecoParam std::auto_ptr HcalHardcodeCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rec) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZDCLowGainFractions-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalZDCLowGainFractions (topo)); @@ -662,7 +647,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceMCParams (const Hca edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceMCParams-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalMCParams (topo)); std::vector cells = allCells(*topo); @@ -679,7 +664,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceMCParams (const Hca std::auto_ptr HcalHardcodeCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rec) { edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceFlagHFDigiTimeParams-> ..."; edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalFlagHFDigiTimeParams (topo)); @@ -707,7 +692,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceFlagHFD std::auto_ptr HcalHardcodeCalibrations::produceCholeskyMatrices (const HcalCholeskyMatricesRcd& rec) { edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalCholeskyMatrices (topo)); @@ -730,7 +715,7 @@ std::auto_ptr HcalHardcodeCalibrations::produceCholeskyMat std::auto_ptr HcalHardcodeCalibrations::produceCovarianceMatrices (const HcalCovarianceMatricesRcd& rec) { edm::ESHandle htopo; - rec.getRecord().get(htopo); + rec.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); std::auto_ptr result (new HcalCovarianceMatrices (topo)); std::vector cells = allCells(*topo); diff --git a/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.h b/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.h index fb2672c9da8a8..6986292023be8 100644 --- a/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.h +++ b/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.h @@ -93,5 +93,8 @@ class HcalHardcodeCalibrations : public edm::ESProducer, HERecalibration* he_recalibration; HFRecalibration* hf_recalibration; bool switchGainWidthsForTrigPrims; + bool setHEdsegm; + bool setHBdsegm; + double SipmLumi; }; diff --git a/CalibCalorimetry/HcalPlugins/src/HcalTextCalibrations.cc b/CalibCalorimetry/HcalPlugins/src/HcalTextCalibrations.cc index c7b2d7250e24a..4a6d63826bb41 100644 --- a/CalibCalorimetry/HcalPlugins/src/HcalTextCalibrations.cc +++ b/CalibCalorimetry/HcalPlugins/src/HcalTextCalibrations.cc @@ -14,7 +14,7 @@ #include "FWCore/Framework/interface/ValidityInterval.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "CondFormats/DataRecord/interface/HcalAllRcds.h" @@ -56,7 +56,7 @@ HcalTextCalibrations::HcalTextCalibrations ( const edm::ParameterSet& iConfig ) findingRecord (); } else if (objectName == "ChannelQuality") { - setWhatProduced (this, &HcalTextCalibrations::produceChannelQuality, edm::es::Label("withTopo")); + setWhatProduced (this, &HcalTextCalibrations::produceChannelQuality); findingRecord (); } else if (objectName == "ZSThresholds") { @@ -199,7 +199,7 @@ std::auto_ptr produce_impl (const std::string& fFile) { std::auto_ptr HcalTextCalibrations::producePedestals (const HcalPedestalsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["Pedestals"]); @@ -207,76 +207,76 @@ std::auto_ptr HcalTextCalibrations::producePedestals (const HcalP std::auto_ptr HcalTextCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["PedestalWidths"]); } std::auto_ptr HcalTextCalibrations::produceGains (const HcalGainsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["Gains"]); } std::auto_ptr HcalTextCalibrations::produceGainWidths (const HcalGainWidthsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["GainWidths"]); } std::auto_ptr HcalTextCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["QIEData"]); } std::auto_ptr HcalTextCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["ChannelQuality"]); } std::auto_ptr HcalTextCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["ZSThresholds"]); } std::auto_ptr HcalTextCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["RespCorrs"]); } std::auto_ptr HcalTextCalibrations::produceLUTCorrs (const HcalLUTCorrsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["LUTCorrs"]); } std::auto_ptr HcalTextCalibrations::producePFCorrs (const HcalPFCorrsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["PFCorrs"]); } std::auto_ptr HcalTextCalibrations::produceTimeCorrs (const HcalTimeCorrsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["TimeCorrs"]); } std::auto_ptr HcalTextCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["L1TriggerObjects"]); } @@ -287,14 +287,14 @@ std::auto_ptr HcalTextCalibrations::produceElectronicsMap (c std::auto_ptr HcalTextCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["ValidationCorrs"]); } std::auto_ptr HcalTextCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["LutMetadata"]); } @@ -310,55 +310,55 @@ std::auto_ptr HcalTextCalibrations::produceDcsMap (const HcalDcsMapR std::auto_ptr HcalTextCalibrations::produceCovarianceMatrices (const HcalCovarianceMatricesRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["CovarianceMatrices"]); } std::auto_ptr HcalTextCalibrations::produceCholeskyMatrices (const HcalCholeskyMatricesRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["CholeskyMatrices"]); } std::auto_ptr HcalTextCalibrations::produceRecoParams (const HcalRecoParamsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["RecoParams"]); } std::auto_ptr HcalTextCalibrations::produceLongRecoParams (const HcalLongRecoParamsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["LongRecoParams"]); } std::auto_ptr HcalTextCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["ZDCLowGainFractions"]); } std::auto_ptr HcalTextCalibrations::produceTimingParams (const HcalTimingParamsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["TimingParams"]); } std::auto_ptr HcalTextCalibrations::produceMCParams (const HcalMCParamsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["MCParams"]); } std::auto_ptr HcalTextCalibrations::produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo,mInputs ["FlagHFDigiTimeParams"]); } diff --git a/CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc b/CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc index 035adb36b739b..8b9d280cb62ed 100644 --- a/CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc +++ b/CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc @@ -3,7 +3,6 @@ #include #include #include "CalibCalorimetry/HcalTPGAlgos/interface/HcaluLUTTPGCoder.h" -#include "Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryData.h" #include "CalibFormats/HcalObjects/interface/HcalCoderDb.h" #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h" #include "CalibFormats/HcalObjects/interface/HcalDbService.h" @@ -192,8 +191,12 @@ void HcaluLUTTPGCoder::update(const HcalDbService& conditions) { float nominalgain_ = metadata->getNominalGain(); std::map cosh_ieta; - for (int i = 0; i < 13; ++i) - cosh_ieta[i+29] = cosh((theHFEtaBounds[i+1] + theHFEtaBounds[i])/2.); + for (int i = metadata->topo()->firstHFRing(); i <= metadata->topo()->lastHFRing(); ++i){ + std::pair etas = metadata->topo()->etaRange(HcalForward,i); + double eta1 = etas.first; + double eta2 = etas.second; + cosh_ieta[i] = cosh((eta1 + eta2)/2.); + } HcalSubdetector subdets[] = {HcalBarrel, HcalEndcap, HcalForward}; for (int isub = 0; isub < 3; ++isub){ diff --git a/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc b/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc index 040bd8af1ae59..486e46ab4a49a 100644 --- a/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc +++ b/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc @@ -128,7 +128,7 @@ HcalTPGCoderULUT::produce(const HcalTPGRecord& iRecord) { if (theCoder_==0) { edm::ESHandle htopo; - iRecord.getRecord().get(htopo); + iRecord.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); buildCoder(topo); } diff --git a/CalibFormats/HcalObjects/interface/HcalTPGRecord.h b/CalibFormats/HcalObjects/interface/HcalTPGRecord.h index 270d310b86496..09a3db6f0ff88 100644 --- a/CalibFormats/HcalObjects/interface/HcalTPGRecord.h +++ b/CalibFormats/HcalObjects/interface/HcalTPGRecord.h @@ -20,7 +20,8 @@ #include "FWCore/Framework/interface/EventSetupRecordImplementation.h" #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" -class HcalTPGRecord : public edm::eventsetup::DependentRecordImplementation >{}; +class HcalTPGRecord : public edm::eventsetup::DependentRecordImplementation >{}; #endif diff --git a/Calibration/HcalCalibAlgos/src/HcalCalibrator.cc b/Calibration/HcalCalibAlgos/src/HcalCalibrator.cc index 8ae6a0f798ebd..9c4d2eb3bfffd 100644 --- a/Calibration/HcalCalibAlgos/src/HcalCalibrator.cc +++ b/Calibration/HcalCalibAlgos/src/HcalCalibrator.cc @@ -123,7 +123,7 @@ HcalCalibrator::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) iSetup.get().get(pG); mTheCaloGeometry = pG.product(); edm::ESHandle pT; - iSetup.get().get(pT); + iSetup.get().get(pT); mTheHcalTopology = pT.product(); } diff --git a/Calibration/HcalCalibAlgos/src/HcalHBHEMuonAnalyzer.cc b/Calibration/HcalCalibAlgos/src/HcalHBHEMuonAnalyzer.cc index fcebab7398a02..7276e82e3f24e 100644 --- a/Calibration/HcalCalibAlgos/src/HcalHBHEMuonAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/src/HcalHBHEMuonAnalyzer.cc @@ -314,7 +314,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet const CaloTopology *caloTopology = theCaloTopology.product(); edm::ESHandle htopo; - iSetup.get().get(htopo); + iSetup.get().get(htopo); const HcalTopology* theHBHETopology = htopo.product(); // Relevant blocks from iEvent diff --git a/Calibration/IsolatedParticles/plugins/HcalRaddamMuon.cc b/Calibration/IsolatedParticles/plugins/HcalRaddamMuon.cc index 160e440bc5610..c93745712a885 100755 --- a/Calibration/IsolatedParticles/plugins/HcalRaddamMuon.cc +++ b/Calibration/IsolatedParticles/plugins/HcalRaddamMuon.cc @@ -47,78 +47,11 @@ #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" #include "Geometry/CaloTopology/interface/HcalTopology.h" #include "Geometry/CaloTopology/interface/CaloTopology.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" #include "MagneticField/Engine/interface/MagneticField.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h" -class HcalDDDRecConstants { -public: - HcalDDDRecConstants(); - ~HcalDDDRecConstants(); - - struct HcalActiveLength { - int ieta, depth; - double eta, thick; - HcalActiveLength(int ie=0, int d=0, double et=0, - double t=0) : ieta(ie), depth(d), eta(et), thick(t) {} - }; - - std::vector getThickActive(const int type) const; - -private: - std::vector actHB, actHE; -}; - -HcalDDDRecConstants::HcalDDDRecConstants() { - int ietaHB[18] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 15, 16, 16}; - int depthHB[18] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 2}; - double etaHB[18] = {0.0435, 0.1305, 0.2175, 0.3045, 0.3915, 0.4785, - 0.5655, 0.6525, 0.7395, 0.8265, 0.9135, 1.0005, - 1.0875, 1.1745, 1.2615, 1.2615, 1.3485, 1.3485}; - double actLHB[18]= {7.35696, 7.41268, 7.52454, 7.69339, 7.92051, 8.20761, - 8.55688, 8.97096, 9.45298, 10.0066, 10.6360, 11.3460, - 12.1419, 13.0297, 10.1832, 3.83301, 2.61066, 5.32410}; - actHB.clear(); - for (int i=0; i<18; ++i) { - HcalDDDRecConstants::HcalActiveLength act(ietaHB[i],depthHB[i],etaHB[i],actLHB[i]); - actHB.push_back(act); - } - - int ietaHE[28] = {16, 17, 18, 18, 19, 19, 20, 20, 21, 21, - 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, - 27, 27, 27, 28, 28, 28, 29, 29}; - int depthHE[28] = {3, 1, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 3, 1, 2, 3, 1, 2}; - double etaHE[28] = {1.3485, 1.4355, 1.5225, 1.5225, 1.6095, 1.6095, 1.6965, - 1.6965, 1.7850, 1.7850, 1.8800, 1.8800, 1.9865, 1.9865, - 2.1075, 2.1075, 2.2470, 2.2470, 2.4110, 2.4110, 2.5750, - 2.5750, 2.5750, 2.7590, 2.7590, 2.8250, 2.9340, 2.9340}; - double actLHE[28]= {4.23487, 8.05342, 2.21090, 5.69774, 2.57831, 5.21078, - 2.54554, 5.14455, 2.51790, 5.08871, 2.49347, 5.03933, - 2.47129, 4.99449, 2.45137, 4.95424, 2.43380, 4.91873, - 2.41863, 4.88808, 1.65913, 0.74863, 4.86612, 1.65322, - 0.74596, 4.84396, 1.64930, 0.744198}; - actHE.clear(); - for (int i=0; i<28; ++i) { - HcalDDDRecConstants::HcalActiveLength act(ietaHE[i],depthHE[i],etaHE[i],actLHE[i]); - actHE.push_back(act); - } -} - -HcalDDDRecConstants::~HcalDDDRecConstants() { - std::cout << "HcalDDDRecConstants::destructed!!!" << std::endl; -} - -std::vector -HcalDDDRecConstants::getThickActive(const int type) const { - - if (type == 0) return actHB; - else return actHE; -} - class HcalRaddamMuon : public edm::EDAnalyzer { public: @@ -317,7 +250,7 @@ void HcalRaddamMuon::analyze(const edm::Event& iEvent, const edm::EventSetup& iS const CaloTopology *caloTopology = theCaloTopology.product(); edm::ESHandle htopo; - iSetup.get().get(htopo); + iSetup.get().get(htopo); const HcalTopology* theHBHETopology = htopo.product(); edm::Handle bmspot; @@ -663,12 +596,10 @@ void HcalRaddamMuon::endJob() {} // ------------ method called when starting to processes a run ------------ void HcalRaddamMuon::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { - /* edm::ESHandle pHRNDC; - iSetup.get().get(pHRNDC); - const HcalDDDRecConstants & hdc = (*pHRNDC); - */ - - HcalDDDRecConstants hdc; + + edm::ESHandle pHRNDC; + iSetup.get().get(pHRNDC); + const HcalDDDRecConstants & hdc = (*pHRNDC); actHB.clear(); actHE.clear(); actHB = hdc.getThickActive(0); diff --git a/Calibration/IsolatedParticles/plugins/IsolatedGenParticles.cc b/Calibration/IsolatedParticles/plugins/IsolatedGenParticles.cc index 00dc769688a76..9e4cc2d3becc4 100644 --- a/Calibration/IsolatedParticles/plugins/IsolatedGenParticles.cc +++ b/Calibration/IsolatedParticles/plugins/IsolatedGenParticles.cc @@ -129,7 +129,7 @@ void IsolatedGenParticles::analyze(const edm::Event& iEvent, const edm::EventSet const CaloTopology *caloTopology = theCaloTopology.product(); edm::ESHandle htopo; - iSetup.get().get(htopo); + iSetup.get().get(htopo); const HcalTopology* theHBHETopology = htopo.product(); //===================== save L1 Trigger information ======================= diff --git a/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc b/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc index 1f72fc084fef9..6b0072d4d56fe 100644 --- a/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc +++ b/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc @@ -182,7 +182,7 @@ void IsolatedTracksCone::analyze(const edm::Event& iEvent, // const CaloSubdetectorTopology* theEETopology = theCaloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap); edm::ESHandle htopo; - iSetup.get().get(htopo); + iSetup.get().get(htopo); const HcalTopology* theHBHETopology = htopo.product(); edm::Handle barrelRecHitsHandle; diff --git a/Calibration/IsolatedParticles/plugins/IsolatedTracksNxN.cc b/Calibration/IsolatedParticles/plugins/IsolatedTracksNxN.cc index 457c45bb2d5ba..96532b82e3737 100644 --- a/Calibration/IsolatedParticles/plugins/IsolatedTracksNxN.cc +++ b/Calibration/IsolatedParticles/plugins/IsolatedTracksNxN.cc @@ -411,7 +411,7 @@ void IsolatedTracksNxN::analyze(const edm::Event& iEvent, const edm::EventSetup& const CaloTopology *caloTopology = theCaloTopology.product(); edm::ESHandle htopo; - iSetup.get().get(htopo); + iSetup.get().get(htopo); const HcalTopology* theHBHETopology = htopo.product(); edm::Handle barrelRecHitsHandle; diff --git a/Calibration/IsolatedParticles/plugins/StudyHLT.cc b/Calibration/IsolatedParticles/plugins/StudyHLT.cc index 9510bbb7a4018..3c58de9181d5e 100644 --- a/Calibration/IsolatedParticles/plugins/StudyHLT.cc +++ b/Calibration/IsolatedParticles/plugins/StudyHLT.cc @@ -212,7 +212,7 @@ if (verbosity > 0) const CaloTopology *caloTopology = theCaloTopology.product(); edm::ESHandle htopo; - iSetup.get().get(htopo); + iSetup.get().get(htopo); const HcalTopology* theHBHETopology = htopo.product(); edm::ESHandle bFieldH; diff --git a/CaloOnlineTools/HcalOnlineDb/src/HcalOmdsCalibrations.cc b/CaloOnlineTools/HcalOnlineDb/src/HcalOmdsCalibrations.cc index 2ea77ccca6539..f5f9ba9f3ab94 100644 --- a/CaloOnlineTools/HcalOnlineDb/src/HcalOmdsCalibrations.cc +++ b/CaloOnlineTools/HcalOnlineDb/src/HcalOmdsCalibrations.cc @@ -199,7 +199,7 @@ std::auto_ptr produce_impl (const std::string & fTag, std::auto_ptr HcalOmdsCalibrations::producePedestals (const HcalPedestalsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["Pedestals"], @@ -212,7 +212,7 @@ std::auto_ptr HcalOmdsCalibrations::producePedestals (const HcalP std::auto_ptr HcalOmdsCalibrations::producePedestalWidths (const HcalPedestalWidthsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["PedestalWidths"], mVersion["PedestalWidths"], @@ -224,7 +224,7 @@ std::auto_ptr HcalOmdsCalibrations::producePedestalWidths (c std::auto_ptr HcalOmdsCalibrations::produceGains (const HcalGainsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["Gains"], mVersion["Gains"], @@ -236,7 +236,7 @@ std::auto_ptr HcalOmdsCalibrations::produceGains (const HcalGainsRcd& std::auto_ptr HcalOmdsCalibrations::produceGainWidths (const HcalGainWidthsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["GainWidths"], mVersion["GainWidths"], @@ -248,7 +248,7 @@ std::auto_ptr HcalOmdsCalibrations::produceGainWidths (const Hca std::auto_ptr HcalOmdsCalibrations::produceQIEData (const HcalQIEDataRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["QIEData"], mVersion["QIEData"], @@ -260,7 +260,7 @@ std::auto_ptr HcalOmdsCalibrations::produceQIEData (const HcalQIEDa std::auto_ptr HcalOmdsCalibrations::produceChannelQuality (const HcalChannelQualityRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["ChannelQuality"], mVersion["ChannelQuality"], @@ -272,7 +272,7 @@ std::auto_ptr HcalOmdsCalibrations::produceChannelQuality (c std::auto_ptr HcalOmdsCalibrations::produceZSThresholds (const HcalZSThresholdsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["ZSThresholds"], mVersion["ZSThresholds"], @@ -284,7 +284,7 @@ std::auto_ptr HcalOmdsCalibrations::produceZSThresholds (const std::auto_ptr HcalOmdsCalibrations::produceRespCorrs (const HcalRespCorrsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["RespCorrs"], mVersion["RespCorrs"], @@ -296,7 +296,7 @@ std::auto_ptr HcalOmdsCalibrations::produceRespCorrs (const HcalR std::auto_ptr HcalOmdsCalibrations::produceL1TriggerObjects (const HcalL1TriggerObjectsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["L1TriggerObjects"], mVersion["L1TriggerObjects"], @@ -317,7 +317,7 @@ std::auto_ptr HcalOmdsCalibrations::produceElectronicsMap (c std::auto_ptr HcalOmdsCalibrations::produceValidationCorrs (const HcalValidationCorrsRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["ValidationCorrs"], mVersion["ValidationCorrs"], @@ -329,7 +329,7 @@ std::auto_ptr HcalOmdsCalibrations::produceValidationCorrs std::auto_ptr HcalOmdsCalibrations::produceLutMetadata (const HcalLutMetadataRcd& rcd) { edm::ESHandle htopo; - rcd.getRecord().get(htopo); + rcd.getRecord().get(htopo); const HcalTopology* topo=&(*htopo); return produce_impl (topo, mInputs ["LutMetadata"], mVersion["LutMetadata"], diff --git a/CondCore/Utilities/python/conddblib.py b/CondCore/Utilities/python/conddblib.py index ca49cde61aa2e..b27bb7b120923 100644 --- a/CondCore/Utilities/python/conddblib.py +++ b/CondCore/Utilities/python/conddblib.py @@ -176,8 +176,8 @@ class Tag(_Base): object_type = sqlalchemy.Column(sqlalchemy.String(name_length), nullable=False) synchronization = sqlalchemy.Column(sqlalchemy.Enum(*tuple(Synchronization)), nullable=False) description = sqlalchemy.Column(sqlalchemy.String(description_length), nullable=False) - last_validated_time = sqlalchemy.Column(sqlalchemy.Integer, nullable=False) - end_of_validity = sqlalchemy.Column(sqlalchemy.Integer, nullable=False) + last_validated_time = sqlalchemy.Column(sqlalchemy.BIGINT, nullable=False) + end_of_validity = sqlalchemy.Column(sqlalchemy.BIGINT, nullable=False) insertion_time = sqlalchemy.Column(sqlalchemy.TIMESTAMP, nullable=False) modification_time = sqlalchemy.Column(sqlalchemy.TIMESTAMP, nullable=False) @@ -188,7 +188,7 @@ class IOV(_Base): __tablename__ = 'IOV' tag_name = sqlalchemy.Column(sqlalchemy.ForeignKey('TAG.name'), primary_key=True) - since = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) + since = sqlalchemy.Column(sqlalchemy.BIGINT, primary_key=True) insertion_time = sqlalchemy.Column(sqlalchemy.TIMESTAMP, primary_key=True) payload_hash = sqlalchemy.Column(sqlalchemy.ForeignKey('PAYLOAD.hash'), nullable=False) @@ -211,7 +211,7 @@ class GlobalTag(_Base): __tablename__ = 'GLOBAL_TAG' name = sqlalchemy.Column(sqlalchemy.String(name_length), primary_key=True) - validity = sqlalchemy.Column(sqlalchemy.Integer, nullable=False) + validity = sqlalchemy.Column(sqlalchemy.BIGINT, nullable=False) description = sqlalchemy.Column(sqlalchemy.String(description_length), nullable=False) release = sqlalchemy.Column(sqlalchemy.String(name_length), nullable=False) insertion_time = sqlalchemy.Column(sqlalchemy.TIMESTAMP, nullable=False) @@ -306,7 +306,6 @@ def is_official(self): def is_valid(self): '''Tests whether the current DB looks like a valid CMS Conditions one. ''' - engine_connection = self.engine.connect() ret = all([self.engine.dialect.has_table(engine_connection, table.__tablename__) for table in [Tag, IOV, Payload, GlobalTag, GlobalTagMap]]) engine_connection.close() @@ -346,18 +345,7 @@ def _getCMSOracleSQLAlchemyConnectionString(database, schema = 'cms_conditions') # Entry point -def connect(database='pro', init=False, verbose=0): - '''Returns a Connection instance to the CMS Condition DB. - - See database_help for the description of the database parameter. - - The verbosity level is as follows: - - 0 = No output (default). - 1 = SQL statements issued, including their parameters. - 2 = In addition, results of the queries (all rows and the column headers). - ''' - +def make_url(database='pro'): # Lazy in order to avoid calls to cmsGetFnConnect mapping = { 'pro': lambda: _getCMSFrontierSQLAlchemyConnectionString('PromptProd'), @@ -383,11 +371,25 @@ def connect(database='pro', init=False, verbose=0): try: url = sqlalchemy.engine.url.make_url(database) - if url.drivername == 'oracle' and url.password is None: - import getpass - url.password = getpass.getpass('Password for %s: ' % str(url)) except sqlalchemy.exc.ArgumentError: url = sqlalchemy.engine.url.make_url('sqlite:///%s' % database) + return url + +def connect(url, init=False, verbose=0): + '''Returns a Connection instance to the CMS Condition DB. + + See database_help for the description of the database parameter. + + The verbosity level is as follows: + + 0 = No output (default). + 1 = SQL statements issued, including their parameters. + 2 = In addition, results of the queries (all rows and the column headers). + ''' + + if url.drivername == 'oracle' and url.password is None: + import getpass + url.password = getpass.getpass('Password for %s: ' % str(url)) if verbose >= 1: logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) diff --git a/CondCore/Utilities/scripts/conddb b/CondCore/Utilities/scripts/conddb index b41605a978a06..bc60997de4823 100755 --- a/CondCore/Utilities/scripts/conddb +++ b/CondCore/Utilities/scripts/conddb @@ -240,8 +240,16 @@ def _check_same_object(args): def _connect(db, init, verbose, read_only, force): - logging.debug('Connecting to %s ...', db) - connection = conddb.connect(db, init=init, verbose=0 if verbose is None else verbose - 1) + url = conddb.make_url( db ) + pretty_url = url + if url.drivername == 'oracle+frontier': + ws = url.host.rsplit('%2F') + if ws is not None: + pretty_url = 'frontier://%s/%s' %(ws[-1],url.database) + connTo = '%s [%s]' %(db,pretty_url) + logging.info('Connecting to %s', connTo) + logging.debug('DB url: %s',url) + connection = conddb.connect(url, init=init, verbose=0 if verbose is None else verbose - 1) if not read_only: if connection.is_read_only: @@ -252,29 +260,32 @@ def _connect(db, init, verbose, read_only, force): logging.warning('You are going to edit an official database. If you are not one of the Offline DB experts but have access to the password for other reasons, please stop now.') else: raise Exception('Editing official databases is forbidden. Use the official DropBox to upload conditions. If you need a special intervention on the database, see the contact help: %s' % conddb.contact_help) + # for sqlite we trigger the implicit schema creation + if init and url.drivername == 'sqlite': + connection.init() + if not connection.is_valid(): + raise Exception('No valid schema found in the database: %s' %url) return connection def connect(args, init=False, read_only=True): args.force = args.force if 'force' in dir(args) else False + if 'destdb' in args: - if args.destdb is None or args.db == args.destdb: + if args.destdb is None: args.destdb = args.db - connection = _connect(args.db, init, args.verbose, read_only, args.force) - return connection, connection - - # read_only refers to the destination database only - # (the source is always read_only) -- see copy() command - if os.path.exists(args.destdb): - return _connect(args.db, init, args.verbose, True, args.force), _connect(args.destdb, init, args.verbose, read_only, args.force) - else: # dest DB not yet there, needs init ... - conn1 = _connect(args.db, init, args.verbose, True, args.force) - conn2 = _connect(args.destdb, True, args.verbose, False, args.force) - conn2.init() - return conn1, conn2 + if args.db == args.destdb: + conn1 = _connect(args.destdb, init, args.verbose, read_only, args.force) + return conn1, conn1 + conn1 = _connect( args.db, init, args.verbose, True, args.force) + conn2url = conddb.make_url(args.destdb) + if conn2url.drivername == 'sqlite' and not os.path.exists(args.destdb): + init = True + conn2 = _connect(conn2url, init, args.verbose, False, args.force) + return conn1, conn2 - return _connect(args.db, init, args.verbose, read_only, args.force) + return _connect( args.db, init, args.verbose, read_only, args.force) def str_db_object(db, name): @@ -901,10 +912,11 @@ def _copy_tag(args, session1, session2, first, second, fromIOV=None, toIOV=None, # Copy the tag tag = _rawdict(session1.query(conddb.Tag).get(first)) tag['name'] = second - tag['end_of_validity'] = 0 # XXX: SQLite does not work with long ints... + tag['end_of_validity'] = -1 - if not timeMap and not fromIOV and not toIOV: - raise Exception("_copy_tag> One of timeMap, fromIOV, toIOV needs to be given ...") + if fromIOV is None: + fromIOV = 1 + if timeMap and not fromIOV and not toIOV: fromIOV = timeMap['start'][ tag['time_type'].lower().strip() ] @@ -967,7 +979,7 @@ def _copy_tag(args, session1, session2, first, second, fromIOV=None, toIOV=None, # Note that we need to replace it for every insertion time (since # the primary key is (since, insertion_time). if prev_iov is not None and iov['since'] == prev_iov: - iov['since'] = getattr(args, 'from') + iov['since'] = fromIOV first_iov = False session2.add(conddb.IOV(**iov)) diff --git a/CondFormats/DataRecord/interface/HcalAllRcds.h b/CondFormats/DataRecord/interface/HcalAllRcds.h index 1652e9e337269..ba2ebe3e87e14 100644 --- a/CondFormats/DataRecord/interface/HcalAllRcds.h +++ b/CondFormats/DataRecord/interface/HcalAllRcds.h @@ -27,5 +27,6 @@ #include "CondFormats/DataRecord/interface/HcalMCParamsRcd.h" #include "CondFormats/DataRecord/interface/HcalFlagHFDigiTimeParamsRcd.h" #include "CondFormats/DataRecord/interface/HcalTimingParamsRcd.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" #endif diff --git a/CondFormats/DataRecord/interface/HcalCalibrationQIEDataRcd.h b/CondFormats/DataRecord/interface/HcalCalibrationQIEDataRcd.h index 31776964a1c24..d51156585c0f0 100644 --- a/CondFormats/DataRecord/interface/HcalCalibrationQIEDataRcd.h +++ b/CondFormats/DataRecord/interface/HcalCalibrationQIEDataRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Sat Mar 1 15:49:07 CET 2008 -// $Id: HcalCalibrationQIEDataRcd.h,v 1.1 2008/03/03 16:56:47 rofierzy Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" -class HcalCalibrationQIEDataRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalCalibrationQIEDataRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalChannelQualityRcd.h b/CondFormats/DataRecord/interface/HcalChannelQualityRcd.h index c000e9879e277..776689a5a6576 100644 --- a/CondFormats/DataRecord/interface/HcalChannelQualityRcd.h +++ b/CondFormats/DataRecord/interface/HcalChannelQualityRcd.h @@ -3,6 +3,7 @@ #ifndef HcalChannelQualityRcd_H #define HcalChannelQualityRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalChannelQualityRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalChannelQualityRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalCholeskyMatricesRcd.h b/CondFormats/DataRecord/interface/HcalCholeskyMatricesRcd.h index 3c51f1dcb9616..8c6728de24a1f 100644 --- a/CondFormats/DataRecord/interface/HcalCholeskyMatricesRcd.h +++ b/CondFormats/DataRecord/interface/HcalCholeskyMatricesRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Sat Mar 1 15:49:28 CET 2008 -// $Id: HcalCholeskyMatricesRcd.h,v 1.1 2010/04/26 22:13:33 kukartse Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalCholeskyMatricesRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalCholeskyMatricesRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalCovarianceMatricesRcd.h b/CondFormats/DataRecord/interface/HcalCovarianceMatricesRcd.h index a3270af18cb11..3e09369fc78e8 100644 --- a/CondFormats/DataRecord/interface/HcalCovarianceMatricesRcd.h +++ b/CondFormats/DataRecord/interface/HcalCovarianceMatricesRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Sat Mar 1 15:49:28 CET 2008 -// $Id: HcalCovarianceMatricesRcd.h,v 1.1 2010/04/26 22:13:34 kukartse Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalCovarianceMatricesRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalCovarianceMatricesRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalFlagHFDigiTimeParamsRcd.h b/CondFormats/DataRecord/interface/HcalFlagHFDigiTimeParamsRcd.h index f3cdab9766836..f27ed81089613 100644 --- a/CondFormats/DataRecord/interface/HcalFlagHFDigiTimeParamsRcd.h +++ b/CondFormats/DataRecord/interface/HcalFlagHFDigiTimeParamsRcd.h @@ -1,6 +1,7 @@ #ifndef HcalFlagHFDigiTimeParamsRcd_H #define HcalFlagHFDigiTimeParamsRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalFlagHFDigiTimeParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalFlagHFDigiTimeParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalGainWidthsRcd.h b/CondFormats/DataRecord/interface/HcalGainWidthsRcd.h index 458734e44e0a8..a627e7cd2ae60 100644 --- a/CondFormats/DataRecord/interface/HcalGainWidthsRcd.h +++ b/CondFormats/DataRecord/interface/HcalGainWidthsRcd.h @@ -3,6 +3,7 @@ #ifndef HcalGainWidthsRcd_H #define HcalGainWidthsRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalGainWidthsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalGainWidthsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalGainsRcd.h b/CondFormats/DataRecord/interface/HcalGainsRcd.h index b116025f67754..50657ccfee5fa 100644 --- a/CondFormats/DataRecord/interface/HcalGainsRcd.h +++ b/CondFormats/DataRecord/interface/HcalGainsRcd.h @@ -3,6 +3,7 @@ #ifndef HcalGainsRcd_H #define HcalGainsRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalGainsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalGainsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalL1TriggerObjectsRcd.h b/CondFormats/DataRecord/interface/HcalL1TriggerObjectsRcd.h index eb9cc97ea6901..048c90e7a4e05 100644 --- a/CondFormats/DataRecord/interface/HcalL1TriggerObjectsRcd.h +++ b/CondFormats/DataRecord/interface/HcalL1TriggerObjectsRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Fri Nov 7 18:37:16 CET 2008 -// $Id: HcalL1TriggerObjectsRcd.h,v 1.1 2008/11/08 21:19:31 rofierzy Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalL1TriggerObjectsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalL1TriggerObjectsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalLUTCorrsRcd.h b/CondFormats/DataRecord/interface/HcalLUTCorrsRcd.h index c9647fe3fe721..034065690a940 100644 --- a/CondFormats/DataRecord/interface/HcalLUTCorrsRcd.h +++ b/CondFormats/DataRecord/interface/HcalLUTCorrsRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Sat Mar 1 15:49:28 CET 2008 -// $Id: HcalLUTCorrsRcd.h,v 1.1 2009/05/19 16:05:39 rofierzy Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalLUTCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalLUTCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalLongRecoParamsRcd.h b/CondFormats/DataRecord/interface/HcalLongRecoParamsRcd.h index 953e32eca148f..29cb6331829a0 100644 --- a/CondFormats/DataRecord/interface/HcalLongRecoParamsRcd.h +++ b/CondFormats/DataRecord/interface/HcalLongRecoParamsRcd.h @@ -1,6 +1,7 @@ #ifndef HcalLongRecoParamsRcd_H #define HcalLongRecoParamsRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalLongRecoParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalLongRecoParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalLutMetadataRcd.h b/CondFormats/DataRecord/interface/HcalLutMetadataRcd.h index 22f48aff7fa9e..a79eb0782c737 100644 --- a/CondFormats/DataRecord/interface/HcalLutMetadataRcd.h +++ b/CondFormats/DataRecord/interface/HcalLutMetadataRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Sat Mar 1 15:49:28 CET 2008 -// $Id: HcalLutMetadataRcd.h,v 1.1 2009/09/18 14:25:15 kukartse Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalLutMetadataRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalLutMetadataRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalMCParamsRcd.h b/CondFormats/DataRecord/interface/HcalMCParamsRcd.h index 8f7f3f4eca565..368d4fdf3fe72 100644 --- a/CondFormats/DataRecord/interface/HcalMCParamsRcd.h +++ b/CondFormats/DataRecord/interface/HcalMCParamsRcd.h @@ -1,6 +1,7 @@ #ifndef HcalMCParamsRcd_H #define HcalMCParamsRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalMCParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalMCParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalPFCorrsRcd.h b/CondFormats/DataRecord/interface/HcalPFCorrsRcd.h index 78f62c82bd8e8..3dbdcd6116ad2 100644 --- a/CondFormats/DataRecord/interface/HcalPFCorrsRcd.h +++ b/CondFormats/DataRecord/interface/HcalPFCorrsRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Sat Mar 1 15:49:28 CET 2008 -// $Id: HcalPFCorrsRcd.h,v 1.1 2009/05/20 15:54:02 rofierzy Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalPFCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalPFCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalPedestalWidthsRcd.h b/CondFormats/DataRecord/interface/HcalPedestalWidthsRcd.h index af6fcf2a91667..f75235554e4a2 100644 --- a/CondFormats/DataRecord/interface/HcalPedestalWidthsRcd.h +++ b/CondFormats/DataRecord/interface/HcalPedestalWidthsRcd.h @@ -3,6 +3,7 @@ #ifndef HcalPedestalWidthsRcd_H #define HcalPedestalWidthsRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalPedestalWidthsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalPedestalWidthsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalPedestalsRcd.h b/CondFormats/DataRecord/interface/HcalPedestalsRcd.h index d3a3a83ddef56..2eb05168618fe 100644 --- a/CondFormats/DataRecord/interface/HcalPedestalsRcd.h +++ b/CondFormats/DataRecord/interface/HcalPedestalsRcd.h @@ -3,7 +3,8 @@ #ifndef HcalPedestalsRcd_H #define HcalPedestalsRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalPedestalsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalPedestalsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalQIEDataRcd.h b/CondFormats/DataRecord/interface/HcalQIEDataRcd.h index 7aa25801203a1..c30ed67b4d8e1 100644 --- a/CondFormats/DataRecord/interface/HcalQIEDataRcd.h +++ b/CondFormats/DataRecord/interface/HcalQIEDataRcd.h @@ -3,6 +3,7 @@ #ifndef HcalQIEDataRcd_H #define HcalQIEDataRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalQIEDataRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalQIEDataRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalRecoParamsRcd.h b/CondFormats/DataRecord/interface/HcalRecoParamsRcd.h index 8975a3301f529..edb6974ae95bc 100644 --- a/CondFormats/DataRecord/interface/HcalRecoParamsRcd.h +++ b/CondFormats/DataRecord/interface/HcalRecoParamsRcd.h @@ -1,6 +1,7 @@ #ifndef HcalRecoParamsRcd_H #define HcalRecoParamsRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalRecoParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalRecoParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalRespCorrsRcd.h b/CondFormats/DataRecord/interface/HcalRespCorrsRcd.h index 3e51c624cf60a..054731778be8b 100644 --- a/CondFormats/DataRecord/interface/HcalRespCorrsRcd.h +++ b/CondFormats/DataRecord/interface/HcalRespCorrsRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Sat Mar 1 15:49:28 CET 2008 -// $Id: HcalRespCorrsRcd.h,v 1.1 2008/03/03 16:57:14 rofierzy Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalRespCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalRespCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalTimeCorrsRcd.h b/CondFormats/DataRecord/interface/HcalTimeCorrsRcd.h index 1565555b5aa60..b8f76274161a0 100644 --- a/CondFormats/DataRecord/interface/HcalTimeCorrsRcd.h +++ b/CondFormats/DataRecord/interface/HcalTimeCorrsRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Sat Mar 1 15:49:28 CET 2008 -// $Id: HcalTimeCorrsRcd.h,v 1.1 2009/05/08 13:45:46 rofierzy Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalTimeCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalTimeCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalTimingParamsRcd.h b/CondFormats/DataRecord/interface/HcalTimingParamsRcd.h index 7916f4df0f391..5a08c6d9ef15b 100644 --- a/CondFormats/DataRecord/interface/HcalTimingParamsRcd.h +++ b/CondFormats/DataRecord/interface/HcalTimingParamsRcd.h @@ -1,6 +1,7 @@ #ifndef HcalTimingParamsRcd_H #define HcalTimingParamsRcd_H #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalTimingParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalTimingParamsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalValidationCorrsRcd.h b/CondFormats/DataRecord/interface/HcalValidationCorrsRcd.h index 25b4e286cabd1..61271ac5e9d4a 100644 --- a/CondFormats/DataRecord/interface/HcalValidationCorrsRcd.h +++ b/CondFormats/DataRecord/interface/HcalValidationCorrsRcd.h @@ -16,12 +16,12 @@ // // Author: Gena Kukartsev // Created: Wed Jul 29 14:35:28 CSET 2009 -// $Id: HcalValidationCorrsRcd.h,v 1.1 2009/07/30 20:38:37 kukartse Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalValidationCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalValidationCorrsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalZDCLowGainFractionsRcd.h b/CondFormats/DataRecord/interface/HcalZDCLowGainFractionsRcd.h index fae714bf68ee9..1ef25c4e81883 100644 --- a/CondFormats/DataRecord/interface/HcalZDCLowGainFractionsRcd.h +++ b/CondFormats/DataRecord/interface/HcalZDCLowGainFractionsRcd.h @@ -19,8 +19,9 @@ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalZDCLowGainFractionsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalZDCLowGainFractionsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondFormats/DataRecord/interface/HcalZSThresholdsRcd.h b/CondFormats/DataRecord/interface/HcalZSThresholdsRcd.h index a133e881ada84..0197bcb191090 100644 --- a/CondFormats/DataRecord/interface/HcalZSThresholdsRcd.h +++ b/CondFormats/DataRecord/interface/HcalZSThresholdsRcd.h @@ -16,12 +16,12 @@ // // Author: // Created: Sat Nov 24 16:42:00 CET 2007 -// $Id: HcalZSThresholdsRcd.h,v 1.1 2007/11/24 16:54:13 rofierzy Exp $ // #include "FWCore/Framework/interface/DependentRecordImplementation.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -class HcalZSThresholdsRcd : public edm::eventsetup::DependentRecordImplementation > {}; +class HcalZSThresholdsRcd : public edm::eventsetup::DependentRecordImplementation > {}; #endif diff --git a/CondTools/Geometry/plugins/calowriters.cc b/CondTools/Geometry/plugins/calowriters.cc index 217aeed044d78..90fa9254b6c6e 100644 --- a/CondTools/Geometry/plugins/calowriters.cc +++ b/CondTools/Geometry/plugins/calowriters.cc @@ -7,6 +7,7 @@ #include "Geometry/HcalTowerAlgo/interface/CaloTowerGeometry.h" #include "Geometry/ForwardGeometry/interface/ZdcGeometry.h" #include "Geometry/ForwardGeometry/interface/CastorGeometry.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" template<> CaloGeometryDBEP::PtrType @@ -59,7 +60,7 @@ CaloGeometryDBEP::produceAligned( const type //********************************************************************************************* edm::ESHandle hcalTopology; - iRecord.getRecord().get( hcalTopology ); + iRecord.getRecord().get( hcalTopology ); // We know that the numer of shapes chanes with changing depth // so, this check is temporary disabled. We need to implement diff --git a/CondTools/Hcal/plugins/HcalDumpConditions.cc b/CondTools/Hcal/plugins/HcalDumpConditions.cc index fcc336a0c5ee4..8bb5dac23f145 100644 --- a/CondTools/Hcal/plugins/HcalDumpConditions.cc +++ b/CondTools/Hcal/plugins/HcalDumpConditions.cc @@ -31,7 +31,7 @@ September 21, 2009 Added HcalLutMetadata - Gena Kukartsev #include "CalibFormats/HcalObjects/interface/HcalDbService.h" #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "FWCore/Framework/interface/IOVSyncValue.h" #include "CondFormats/HcalObjects/interface/AllObjects.h" @@ -105,7 +105,7 @@ namespace edmtest HcalDumpConditions::analyze(const edm::Event& e, const edm::EventSetup& context) { edm::ESHandle topology ; - context.get().get( topology ); + context.get().get( topology ); const HcalTopology* topo=&(*topology); using namespace edm::eventsetup; diff --git a/Configuration/AlCa/python/autoCond.py b/Configuration/AlCa/python/autoCond.py index c47021efaa816..d13fdc9fad6ec 100644 --- a/Configuration/AlCa/python/autoCond.py +++ b/Configuration/AlCa/python/autoCond.py @@ -2,29 +2,29 @@ ### NEW KEYS ### # GlobalTag for MC production with perfectly aligned and calibrated detector for Run1 - 'run1_design' : '76X_mcRun1_design_v1', + 'run1_design' : '76X_mcRun1_design_v2', # GlobalTag for MC production (pp collisions) with realistic alignment and calibrations for Run1 - 'run1_mc' : '76X_mcRun1_realistic_v1', + 'run1_mc' : '76X_mcRun1_realistic_v2', # GlobalTag for MC production (Heavy Ions collisions) with realistic alignment and calibrations for Run1 - 'run1_mc_hi' : '76X_mcRun1_HeavyIon_v1', + 'run1_mc_hi' : '76X_mcRun1_HeavyIon_v2', # GlobalTag for MC production (p-Pb collisions) with realistic alignment and calibrations for Run1 - 'run1_mc_pa' : '76X_mcRun1_pA_v1', + 'run1_mc_pa' : '76X_mcRun1_pA_v2', # GlobalTag for MC production with perfectly aligned and calibrated detector for Run2 - 'run2_design' : '76X_mcRun2_design_v1', + 'run2_design' : '76X_mcRun2_design_v2', # GlobalTag for MC production with pessimistic alignment and calibrations for Run2 - 'run2_mc_50ns' : '76X_mcRun2_startup_v1', + 'run2_mc_50ns' : '76X_mcRun2_startup_v2', #GlobalTag for MC production with optimistic alignment and calibrations for Run2 - 'run2_mc' : '76X_mcRun2_asymptotic_v1', + 'run2_mc' : '76X_mcRun2_asymptotic_v2', # GlobalTag for MC production (Heavy Ions collisions) with optimistic alignment and calibrations for Run2 - 'run2_mc_hi' : '76X_mcRun2_HeavyIon_v1', + 'run2_mc_hi' : '76X_mcRun2_HeavyIon_v2', # GlobalTag for Run1 data reprocessing - 'run1_data' : '76X_dataRun1_v1', + 'run1_data' : '76X_dataRun1_v2', # GlobalTag for Run2 data reprocessing - 'run2_data' : '76X_dataRun2_v1', + 'run2_data' : '76X_dataRun2_v2', # GlobalTag for Run1 HLT: it points to the online GT - 'run1_hlt' : '75X_dataRun1_HLT_frozen_v2', + 'run1_hlt' : '76X_dataRun1_HLT_frozen_v0', # GlobalTag for Run2 HLT: it points to the online GT - 'run2_hlt' : '75X_dataRun2_HLT_frozen_v2', + 'run2_hlt' : '76X_dataRun2_HLT_frozen_v0', # GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2017 'phase1_2017_design' : '75X_upgrade2017_design_v1', # GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2019 diff --git a/Configuration/Geometry/python/GeometryExtended2015_RPC4RE11_cff.py b/Configuration/Geometry/python/GeometryExtended2015_RPC4RE11_cff.py index cc3e740fa8589..50aa4c51054d7 100644 --- a/Configuration/Geometry/python/GeometryExtended2015_RPC4RE11_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2015_RPC4RE11_cff.py @@ -8,4 +8,3 @@ from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * from Geometry.HcalCommonData.hcalParameters_cfi import * from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * - diff --git a/Configuration/Geometry/python/GeometryExtended2015dev_cff.py b/Configuration/Geometry/python/GeometryExtended2015dev_cff.py index e5f789929b8df..eab25a2bd52e9 100644 --- a/Configuration/Geometry/python/GeometryExtended2015dev_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2015dev_cff.py @@ -6,4 +6,6 @@ # Ideal geometry, needed for simulation from Geometry.CMSCommonData.cmsExtendedGeometry2015devXML_cfi import * from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * +from Geometry.HcalCommonData.hcalParameters_cfi import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2016Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2016Reco_cff.py index 560f660e5d0da..6dcc4603809df 100644 --- a/Configuration/Geometry/python/GeometryExtended2016Reco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2016Reco_cff.py @@ -30,5 +30,5 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDConstants_cff import * - +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2017Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2017Reco_cff.py index f33ab9b29f33b..d4e2e3124f4e6 100644 --- a/Configuration/Geometry/python/GeometryExtended2017Reco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2017Reco_cff.py @@ -29,5 +29,5 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDConstants_cff import * - +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2019Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2019Reco_cff.py index c0b52220d10eb..d17217fb2f679 100644 --- a/Configuration/Geometry/python/GeometryExtended2019Reco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2019Reco_cff.py @@ -31,5 +31,5 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDConstants_cff import * - +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2023CFCal4EtaReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023CFCal4EtaReco_cff.py index c1673e1e23f8b..4f2b16f330751 100644 --- a/Configuration/Geometry/python/GeometryExtended2023CFCal4EtaReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023CFCal4EtaReco_cff.py @@ -39,10 +39,9 @@ from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalDDConstants_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2023CFCalReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023CFCalReco_cff.py index 525cfd53f5ba8..3e11fb75b0c25 100644 --- a/Configuration/Geometry/python/GeometryExtended2023CFCalReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023CFCalReco_cff.py @@ -39,10 +39,9 @@ from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalDDConstants_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2023FastTimingReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023FastTimingReco_cff.py index f47e14902e23b..74c8cf86f6e1a 100644 --- a/Configuration/Geometry/python/GeometryExtended2023FastTimingReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023FastTimingReco_cff.py @@ -44,10 +44,10 @@ from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalDDConstants_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2023HGCalMuon4EtaReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023HGCalMuon4EtaReco_cff.py index 0d800befed2bc..5a37b4b356be5 100644 --- a/Configuration/Geometry/python/GeometryExtended2023HGCalMuon4EtaReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023HGCalMuon4EtaReco_cff.py @@ -43,10 +43,10 @@ from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalRecNumberingInitialization_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2023HGCalMuonReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023HGCalMuonReco_cff.py index d5b41b0dfa5d3..c62e903b63478 100644 --- a/Configuration/Geometry/python/GeometryExtended2023HGCalMuonReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023HGCalMuonReco_cff.py @@ -43,10 +43,11 @@ from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalRecNumberingInitialization_cfi import * + diff --git a/Configuration/Geometry/python/GeometryExtended2023HGCalReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023HGCalReco_cff.py index 823ad39b01e96..d0c6d1af66290 100644 --- a/Configuration/Geometry/python/GeometryExtended2023HGCalReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023HGCalReco_cff.py @@ -42,10 +42,10 @@ from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalRecNumberingInitialization_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2023Muon4EtaReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023Muon4EtaReco_cff.py index 2b0c173bc656d..c28e0b611b583 100644 --- a/Configuration/Geometry/python/GeometryExtended2023Muon4EtaReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023Muon4EtaReco_cff.py @@ -44,10 +44,9 @@ from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalDDConstants_cff import * - diff --git a/Configuration/Geometry/python/GeometryExtended2023MuonReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023MuonReco_cff.py index 290a4496d5025..8c9c280da4d05 100644 --- a/Configuration/Geometry/python/GeometryExtended2023MuonReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023MuonReco_cff.py @@ -30,4 +30,5 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDConstants_cff import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2023Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2023Reco_cff.py index 4f90db8e3cc6d..e93b3c2e0de67 100644 --- a/Configuration/Geometry/python/GeometryExtended2023Reco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023Reco_cff.py @@ -29,4 +29,5 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDConstants_cff import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2023SHCal4EtaReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023SHCal4EtaReco_cff.py index 5e53a1df9d9d4..18d6593db7387 100644 --- a/Configuration/Geometry/python/GeometryExtended2023SHCal4EtaReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023SHCal4EtaReco_cff.py @@ -45,10 +45,10 @@ from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalDDConstants_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2023SHCalNoTaper4EtaReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023SHCalNoTaper4EtaReco_cff.py index a13e8abffb701..385c7646b9238 100644 --- a/Configuration/Geometry/python/GeometryExtended2023SHCalNoTaper4EtaReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023SHCalNoTaper4EtaReco_cff.py @@ -45,10 +45,9 @@ from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalDDConstants_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2023SHCalNoTaperReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023SHCalNoTaperReco_cff.py index 86b59486db536..6e4c6ab2aafd1 100644 --- a/Configuration/Geometry/python/GeometryExtended2023SHCalNoTaperReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023SHCalNoTaperReco_cff.py @@ -45,10 +45,9 @@ from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalDDConstants_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2023SHCalReco_cff.py b/Configuration/Geometry/python/GeometryExtended2023SHCalReco_cff.py index 94448f5189dd6..290a2aeb0d9f2 100644 --- a/Configuration/Geometry/python/GeometryExtended2023SHCalReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023SHCalReco_cff.py @@ -45,10 +45,9 @@ from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_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.hcalDDConstants_cff import * diff --git a/Configuration/Geometry/python/GeometryExtendedPhase2TkBE5DPixel10DReco_cff.py b/Configuration/Geometry/python/GeometryExtendedPhase2TkBE5DPixel10DReco_cff.py index 450a71f774cb5..414acc07325a0 100644 --- a/Configuration/Geometry/python/GeometryExtendedPhase2TkBE5DPixel10DReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtendedPhase2TkBE5DPixel10DReco_cff.py @@ -30,4 +30,5 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDConstants_cff import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtendedPhaseIPixelReco_cff.py b/Configuration/Geometry/python/GeometryExtendedPhaseIPixelReco_cff.py index aea6f30b42a7f..ea8557f58b699 100644 --- a/Configuration/Geometry/python/GeometryExtendedPhaseIPixelReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtendedPhaseIPixelReco_cff.py @@ -29,5 +29,6 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDConstants_cff import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_cfi import * diff --git a/Configuration/Geometry/python/GeometryIdealAPD1_cff.py b/Configuration/Geometry/python/GeometryIdealAPD1_cff.py index 80f594466eeb9..3fadce3ba17c9 100644 --- a/Configuration/Geometry/python/GeometryIdealAPD1_cff.py +++ b/Configuration/Geometry/python/GeometryIdealAPD1_cff.py @@ -29,4 +29,3 @@ from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * from Geometry.HcalCommonData.hcalDDConstants_cff import * - diff --git a/Configuration/Geometry/python/GeometryIdealNoAPD_cff.py b/Configuration/Geometry/python/GeometryIdealNoAPD_cff.py index b2785d4fbfbef..076a1fb7f45d4 100644 --- a/Configuration/Geometry/python/GeometryIdealNoAPD_cff.py +++ b/Configuration/Geometry/python/GeometryIdealNoAPD_cff.py @@ -29,4 +29,3 @@ from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * from Geometry.HcalCommonData.hcalDDConstants_cff import * - diff --git a/Configuration/Geometry/python/GeometryIdeal_cff.py b/Configuration/Geometry/python/GeometryIdeal_cff.py index 2f8220f304271..9abf3626488e8 100644 --- a/Configuration/Geometry/python/GeometryIdeal_cff.py +++ b/Configuration/Geometry/python/GeometryIdeal_cff.py @@ -6,8 +6,6 @@ # Ideal geometry, needed for simulation from Geometry.CMSCommonData.cmsIdealGeometryXML_cfi import * from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.HcalCommonData.hcalParameters_cfi import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * # Reconstruction geometry services from Configuration.Geometry.GeometryReco_cff import * diff --git a/Configuration/Geometry/python/GeometryNoCastor_cff.py b/Configuration/Geometry/python/GeometryNoCastor_cff.py index bc4473f33310b..2459fabe5fe5a 100644 --- a/Configuration/Geometry/python/GeometryNoCastor_cff.py +++ b/Configuration/Geometry/python/GeometryNoCastor_cff.py @@ -28,4 +28,3 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDConstants_cff import * diff --git a/Configuration/Geometry/python/GeometryRecoDB_cff.py b/Configuration/Geometry/python/GeometryRecoDB_cff.py index efef3a62a5e3d..e1b81d4ff34f7 100644 --- a/Configuration/Geometry/python/GeometryRecoDB_cff.py +++ b/Configuration/Geometry/python/GeometryRecoDB_cff.py @@ -16,9 +16,12 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDBConstants_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * # Alignment from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometryDB_cff import * from Geometry.CSCGeometryBuilder.idealForDigiCscGeometryDB_cff import * from Geometry.DTGeometryBuilder.idealForDigiDtGeometryDB_cff import * + diff --git a/Configuration/Geometry/python/GeometryRecoECALHCAL_cff.py b/Configuration/Geometry/python/GeometryRecoECALHCAL_cff.py index e0c5397c4860c..faad0b1065295 100644 --- a/Configuration/Geometry/python/GeometryRecoECALHCAL_cff.py +++ b/Configuration/Geometry/python/GeometryRecoECALHCAL_cff.py @@ -6,7 +6,8 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDConstants_cff import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * diff --git a/Configuration/Geometry/python/GeometryRecoHCAL_cff.py b/Configuration/Geometry/python/GeometryRecoHCAL_cff.py index 2f5d1b8324984..60f8e7d9f5666 100644 --- a/Configuration/Geometry/python/GeometryRecoHCAL_cff.py +++ b/Configuration/Geometry/python/GeometryRecoHCAL_cff.py @@ -3,7 +3,8 @@ # Calorimeters from Geometry.CaloEventSetup.CaloTopology_cfi import * from Geometry.CaloEventSetup.CaloGeometry_cff import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * CaloGeometryBuilder.SelectedCalos = ['HCAL', 'TOWER'] -from Geometry.HcalCommonData.hcalDDConstants_cff import * diff --git a/Configuration/Geometry/python/GeometryReco_cff.py b/Configuration/Geometry/python/GeometryReco_cff.py index 2fcd0084487cf..22062ea7ae257 100644 --- a/Configuration/Geometry/python/GeometryReco_cff.py +++ b/Configuration/Geometry/python/GeometryReco_cff.py @@ -25,4 +25,4 @@ from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * from Geometry.HcalCommonData.hcalDDConstants_cff import * - +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * diff --git a/Configuration/Geometry/python/GeometrySLHCRecoDB_cff.py b/Configuration/Geometry/python/GeometrySLHCRecoDB_cff.py index fbb8ca2b80e3e..8d5c608f0e54a 100644 --- a/Configuration/Geometry/python/GeometrySLHCRecoDB_cff.py +++ b/Configuration/Geometry/python/GeometrySLHCRecoDB_cff.py @@ -20,7 +20,9 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDBConstants_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdealSLHC_cfi import * # Alignment from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometryDB_cff import * diff --git a/Configuration/Geometry/python/GeometrySLHCReco_cff.py b/Configuration/Geometry/python/GeometrySLHCReco_cff.py index 94e65061f89b0..c312546deb1ac 100644 --- a/Configuration/Geometry/python/GeometrySLHCReco_cff.py +++ b/Configuration/Geometry/python/GeometrySLHCReco_cff.py @@ -27,6 +27,8 @@ 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.hcalTopologyIdealSLHC_cfi import * ## Just in case if a wrong DB record is pulled in: ## diff --git a/Configuration/Geometry/python/GeometrySLHCSimDB_cff.py b/Configuration/Geometry/python/GeometrySLHCSimDB_cff.py index 0885eb34d2ed3..196f14a2e8bf2 100644 --- a/Configuration/Geometry/python/GeometrySLHCSimDB_cff.py +++ b/Configuration/Geometry/python/GeometrySLHCSimDB_cff.py @@ -8,3 +8,4 @@ from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * from Geometry.TrackerNumberingBuilder.trackerNumbering2023GeometryDB_cfi import * from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * + diff --git a/Configuration/Geometry/python/GeometrySLHCSimIdeal_cff.py b/Configuration/Geometry/python/GeometrySLHCSimIdeal_cff.py index c500df5883ab5..6f939e8fbe10e 100644 --- a/Configuration/Geometry/python/GeometrySLHCSimIdeal_cff.py +++ b/Configuration/Geometry/python/GeometrySLHCSimIdeal_cff.py @@ -3,5 +3,3 @@ # Ideal geometry, needed for simulation from SLHCUpgradeSimulations.Geometry.Phase1_R30F12_cmsSimIdealGeometryXML_cff import * from Geometry.TrackerNumberingBuilder.trackerNumbering2023Geometry_cfi import * -from Geometry.HcalCommonData.hcalParameters_cfi import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * diff --git a/DQM/HcalMonitorClient/src/HcalBaseDQClient.cc b/DQM/HcalMonitorClient/src/HcalBaseDQClient.cc index e1b9c5eb2d62b..818a94373f774 100644 --- a/DQM/HcalMonitorClient/src/HcalBaseDQClient.cc +++ b/DQM/HcalMonitorClient/src/HcalBaseDQClient.cc @@ -5,7 +5,7 @@ #include #include #include "CondFormats/HcalObjects/interface/HcalLogicalMap.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalLogicalMapGenerator.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -202,7 +202,7 @@ void HcalBaseDQClient::htmlOutput(DQMStore::IBooker &ib, DQMStore::IGetter &ig, void HcalBaseDQClient::getLogicalMap(const edm::EventSetup& c) { if (needLogicalMap_ && logicalMap_==0) { edm::ESHandle pT; - c.get().get(pT); + c.get().get(pT); HcalLogicalMapGenerator gen; logicalMap_=new HcalLogicalMap(gen.createMap(&(*pT))); } diff --git a/DQM/HcalMonitorClient/src/HcalMonitorClient.cc b/DQM/HcalMonitorClient/src/HcalMonitorClient.cc index 484cd76f944f3..5a86bf7532c35 100644 --- a/DQM/HcalMonitorClient/src/HcalMonitorClient.cc +++ b/DQM/HcalMonitorClient/src/HcalMonitorClient.cc @@ -41,6 +41,7 @@ #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include #include @@ -177,7 +178,7 @@ void HcalMonitorClient::beginRun(const edm::Run& r, const edm::EventSetup& c) // Let's get the channel status quality edm::ESHandle topo; - c.get().get(topo); + c.get().get(topo); edm::ESHandle p; c.get().get("withTopo",p); diff --git a/DQM/HcalMonitorTasks/src/HcalBaseDQMonitor.cc b/DQM/HcalMonitorTasks/src/HcalBaseDQMonitor.cc index f3551686a8378..56f80cd9addc0 100644 --- a/DQM/HcalMonitorTasks/src/HcalBaseDQMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalBaseDQMonitor.cc @@ -1,7 +1,7 @@ #include #include "FWCore/Framework/interface/LuminosityBlock.h" #include "CondFormats/HcalObjects/interface/HcalLogicalMap.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalLogicalMapGenerator.h" #include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h" #include "CalibFormats/HcalObjects/interface/HcalDbService.h" @@ -235,7 +235,7 @@ bool HcalBaseDQMonitor::IsAllowedCalibType() void HcalBaseDQMonitor::getLogicalMap(const edm::EventSetup& c) { if (needLogicalMap_ && logicalMap_==0) { edm::ESHandle pT; - c.get().get(pT); + c.get().get(pT); HcalLogicalMapGenerator gen; logicalMap_=new HcalLogicalMap(gen.createMap(&(*pT))); } diff --git a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py index 416dff51c78e3..fa327889219f0 100644 --- a/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py +++ b/DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py @@ -213,10 +213,10 @@ ), MultiplicityRegions = cms.PSet( - k0 = cms.double(0.13), # k from linear fit of the diagonal default 0.13 + k0 = cms.double(0.097), # k from linear fit of the diagonal default 0.13 q0 = cms.double(300), # +/- variation of y axis intercept default 300 dk0 = cms.double(40), #+/- variation of k0 (in %) to contain the diagonal zone defoult 40 - MaxClus = cms.double(20000), #Divide Region 2 and Region 3 default 20000 + MaxClus = cms.double(26000), #Divide Region 2 and Region 3 default 20000 MinPix = cms.double(50) # minimum number of Pix clusters to flag events with zero Si clusters default 50 ), diff --git a/DQMOffline/RecoB/python/bTagCommon_cff.py b/DQMOffline/RecoB/python/bTagCommon_cff.py index 23911c58dabfb..24232f7a03c17 100644 --- a/DQMOffline/RecoB/python/bTagCommon_cff.py +++ b/DQMOffline/RecoB/python/bTagCommon_cff.py @@ -101,6 +101,11 @@ label = cms.InputTag("pfCombinedMVABJetTags"), folder = cms.string("combMVA") ), + cms.PSet( + bTagGenericAnalysisBlock, + label = cms.InputTag("pfCombinedMVAV2BJetTags"), + folder = cms.string("combMVAV2") + ), cms.PSet( bTagSoftLeptonAnalysisBlock, label = cms.InputTag("softPFMuonBJetTags"), diff --git a/DQMOffline/Trigger/python/JetMETHLTOfflineSource_cfi.py b/DQMOffline/Trigger/python/JetMETHLTOfflineSource_cfi.py index 4f67cbb1fcdb2..bc629713cdd96 100644 --- a/DQMOffline/Trigger/python/JetMETHLTOfflineSource_cfi.py +++ b/DQMOffline/Trigger/python/JetMETHLTOfflineSource_cfi.py @@ -44,6 +44,7 @@ "HLT_PFJet", "HLT_PFNoPUJet", "HLT_DiPFJetAve", + "HLT_DiCaloJetAve", "HLT_PFMET", "HLT_PFchMET", "HLT_MET", diff --git a/DataFormats/ForwardDetId/interface/HGCHEDetId.h b/DataFormats/ForwardDetId/interface/HGCHEDetId.h index 6445e31e726b5..daf61d42574ab 100644 --- a/DataFormats/ForwardDetId/interface/HGCHEDetId.h +++ b/DataFormats/ForwardDetId/interface/HGCHEDetId.h @@ -1,4 +1,3 @@ - #ifndef DataFormats_ForwardDetId_HGCHEDetId_H #define DataFormats_ForwardDetId_HGCHEDetId_H 1 diff --git a/DataFormats/ForwardDetId/src/classes.h b/DataFormats/ForwardDetId/src/classes.h index 2b9a759b9bd51..497bee872c5a3 100644 --- a/DataFormats/ForwardDetId/src/classes.h +++ b/DataFormats/ForwardDetId/src/classes.h @@ -4,3 +4,19 @@ #include "DataFormats/ForwardDetId/interface/HGCalDetId.h" #include "DataFormats/ForwardDetId/interface/FastTimeDetId.h" +namespace DataFormats_ForwardDetId { + struct dictionary { + + //EE specific + HGCEEDetId anHGCEEDetId; + + //HE specific + HGCHEDetId anHGCHEDetId; + + //HGCal specific + HGCalDetId anHGCalDetId; + + //FastTimer specific + FastTimeDetId anFastTimeDetId; + }; +} diff --git a/DataFormats/HGCDigi/src/classes.h b/DataFormats/HGCDigi/src/classes.h index d8da2c6c6280d..dfc0bf766be92 100644 --- a/DataFormats/HGCDigi/src/classes.h +++ b/DataFormats/HGCDigi/src/classes.h @@ -7,7 +7,6 @@ namespace DataFormats_HGCDigi { std::vector vHGCsample; //EE specific - HGCEEDetId anHGCEEDetId; HGCDataFrame anHGCEEDataFrame; std::vector > vHGCEEDataFrames; edm::SortedCollection< HGCDataFrame > scHGCEEDataFrames; @@ -16,7 +15,6 @@ namespace DataFormats_HGCDigi { edm::Wrapper wdcHGCEE; //HE specific - HGCHEDetId anHGCHEDetId; HGCDataFrame anHGCHEDataFrame; std::vector > vHGCHEDataFrames; edm::SortedCollection< HGCDataFrame > scHGCHEDataFrames; diff --git a/DataFormats/HGCDigi/src/classes_def.xml b/DataFormats/HGCDigi/src/classes_def.xml index 9fb8acdbbe759..f5e6a879fd8d9 100644 --- a/DataFormats/HGCDigi/src/classes_def.xml +++ b/DataFormats/HGCDigi/src/classes_def.xml @@ -3,7 +3,6 @@ - @@ -11,7 +10,6 @@ - diff --git a/DataFormats/HcalRecHit/interface/HBHERecHit.h b/DataFormats/HcalRecHit/interface/HBHERecHit.h index da02387685635..5c7077ee55374 100644 --- a/DataFormats/HcalRecHit/interface/HBHERecHit.h +++ b/DataFormats/HcalRecHit/interface/HBHERecHit.h @@ -25,12 +25,16 @@ class HBHERecHit : public CaloRecHit { inline void setRawEnergy(const float en) {rawEnergy_ = en;} inline float eraw() const {return rawEnergy_;} + inline void setAuxEnergy(const float en) {auxEnergy_ = en;} + inline float eaux() const {return auxEnergy_;} + inline void setAuxHBHE(const uint32_t aux) { auxHBHE_ = aux;} inline uint32_t auxHBHE() const {return auxHBHE_;} private: float timeFalling_; float rawEnergy_; + float auxEnergy_; uint32_t auxHBHE_; }; diff --git a/DataFormats/HcalRecHit/src/HBHERecHit.cc b/DataFormats/HcalRecHit/src/HBHERecHit.cc index cb1f12e353f24..2f1c3cf244380 100644 --- a/DataFormats/HcalRecHit/src/HBHERecHit.cc +++ b/DataFormats/HcalRecHit/src/HBHERecHit.cc @@ -1,13 +1,14 @@ #include "DataFormats/HcalRecHit/interface/HBHERecHit.h" -HBHERecHit::HBHERecHit() : CaloRecHit(), rawEnergy_(-1.0e21) { +HBHERecHit::HBHERecHit() : CaloRecHit(), rawEnergy_(-1.0e21), auxEnergy_(-1.0e21) { } HBHERecHit::HBHERecHit(const HcalDetId& id, float energy, float timeRising, float timeFalling) : CaloRecHit(id,energy,timeRising), timeFalling_(timeFalling), - rawEnergy_(-1.0e21) + rawEnergy_(-1.0e21), + auxEnergy_(-1.0e21) { } @@ -16,6 +17,9 @@ std::ostream& operator<<(std::ostream& s, const HBHERecHit& hit) { if (hit.eraw() > -0.9e21) { s << ", eraw=" << hit.eraw() << " GeV"; } + if (hit.eaux() > -0.9e21) { + s << ", eaux=" << hit.eaux() << " GeV"; + } if(hit.time() > -998) { s << ", t= " << hit.time() << " to " << hit.timeFalling() << " ns"; } diff --git a/DataFormats/HcalRecHit/src/classes_def.xml b/DataFormats/HcalRecHit/src/classes_def.xml index 9bad8c1e61b06..d44ab2d5de47b 100644 --- a/DataFormats/HcalRecHit/src/classes_def.xml +++ b/DataFormats/HcalRecHit/src/classes_def.xml @@ -1,5 +1,6 @@ - + + diff --git a/FastSimulation/CalorimeterProperties/src/Calorimeter.cc b/FastSimulation/CalorimeterProperties/src/Calorimeter.cc index 2b3732f4c6c7e..8a9056b2745c6 100644 --- a/FastSimulation/CalorimeterProperties/src/Calorimeter.cc +++ b/FastSimulation/CalorimeterProperties/src/Calorimeter.cc @@ -2,6 +2,7 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" #include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/HcalDetId/interface/HcalSubdetector.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include "Geometry/EcalAlgo/interface/EcalBarrelGeometry.h" #include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h" diff --git a/FastSimulation/ShowerDevelopment/src/FastHFShowerLibrary.cc b/FastSimulation/ShowerDevelopment/src/FastHFShowerLibrary.cc index 55752d1407e33..54c4c471af1b3 100644 --- a/FastSimulation/ShowerDevelopment/src/FastHFShowerLibrary.cc +++ b/FastSimulation/ShowerDevelopment/src/FastHFShowerLibrary.cc @@ -11,7 +11,10 @@ #include "DetectorDescription/Core/interface/DDFilteredView.h" #include "DetectorDescription/Core/interface/DDValue.h" #include "FWCore/Framework/interface/ESTransientHandle.h" +#include "FWCore/Framework/interface/ESHandle.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalSimNumberingRecord.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "FWCore/Utilities/interface/Exception.h" #include "Randomize.hh" @@ -32,8 +35,7 @@ //#define DebugLog FastHFShowerLibrary::FastHFShowerLibrary(edm::ParameterSet const & p) - : fast(p) -{ + : fast(p) { edm::ParameterSet m_HS = p.getParameter("HFShowerLibrary"); applyFidCut = m_HS.getParameter("ApplyFiducialCut"); } @@ -45,9 +47,13 @@ void const FastHFShowerLibrary::initHFShowerLibrary(const edm::EventSetup& iSetu edm::ESTransientHandle cpv; iSetup.get().get(cpv); + edm::ESHandle hdc; + iSetup.get().get(hdc); + HcalDDDSimConstants *hcalConstants = (HcalDDDSimConstants*)(&(*hdc)); + std::string name = "HcalHits"; + numberingFromDDD.reset(new HcalNumberingFromDDD(hcalConstants)); hfshower.reset(new HFShowerLibrary(name,*cpv,fast)); - numberingFromDDD.reset(new HcalNumberingFromDDD(name, *cpv)); // Geant4 particles G4DecayPhysics decays; @@ -55,7 +61,7 @@ void const FastHFShowerLibrary::initHFShowerLibrary(const edm::EventSetup& iSetu G4ParticleTable* partTable = G4ParticleTable::GetParticleTable(); partTable->SetReadiness(); - hfshower->initRun(partTable); // init particle code + hfshower->initRun(partTable, hcalConstants); // init particle code } void FastHFShowerLibrary::recoHFShowerLibrary(const FSimTrack& myTrack) { diff --git a/GeneratorInterface/EvtGenInterface/interface/EvtGenInterface.h b/GeneratorInterface/EvtGenInterface/interface/EvtGenInterface.h index 796b2f8885712..5c8268691a943 100644 --- a/GeneratorInterface/EvtGenInterface/interface/EvtGenInterface.h +++ b/GeneratorInterface/EvtGenInterface/interface/EvtGenInterface.h @@ -16,6 +16,7 @@ #include #include +#include "EvtGenBase/EvtParticle.hh" // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDProducer.h" @@ -47,11 +48,12 @@ namespace gen { static double flat(); private: - bool addToHepMC(HepMC::GenParticle* partHep,const EvtId &idEvt, HepMC::GenEvent* theEvent,bool allowMixing=true,bool mixforce=false,bool noforced=false); - void update_particles(HepMC::GenParticle* partHep,HepMC::GenEvent* theEvent,HepMC::GenParticle* p,bool allowMixing=true,bool mixforce=false,bool noforced=false); + bool addToHepMC(HepMC::GenParticle* partHep,const EvtId &idEvt, HepMC::GenEvent* theEvent, bool del_daug); + void update_particles(HepMC::GenParticle* partHep,HepMC::GenEvent* theEvent,HepMC::GenParticle* p); void SetDefault_m_PDGs(); bool findLastinChain(HepMC::GenParticle* &p); bool hasnoDaughter(HepMC::GenParticle* p); + void go_through_daughters(EvtParticle* part); EvtGen *m_EvtGen; // EvtGen main object diff --git a/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc b/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc index 21bc505c00886..db53031cff57c 100644 --- a/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc +++ b/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc @@ -421,7 +421,12 @@ HepMC::GenEvent* EvtGenInterface::decay( HepMC::GenEvent* evt ){ } CLHEP::RandFlat m_flat(*the_engine->engine(), 0., 1.); - // decay all request unforced particles + // decay all request unforced particles and store the forced decays to later decay one per event + unsigned int nisforced=0; + std::vector > forcedparticles; + for(unsigned int i=0;i()); + + // notice this is a dynamic loop for (HepMC::GenEvent::particle_const_iterator p= evt->particles_begin(); p != evt->particles_end(); ++p){ if((*p)->status()==1){ // all particles to be decays are set to status 1 by generator.hadronizer int idHep = (*p)->pdg_id(); @@ -433,6 +438,8 @@ HepMC::GenEvent* EvtGenInterface::decay( HepMC::GenEvent* evt ){ bool isforced=false; for(unsigned int i=0;igetNMode(ipart)!=0){ - addToHepMC(*p,idEvt,evt,true,true,true); // generate decay - } - } - } - } - // find all forced particles (after mixing) - unsigned int nisforced=0; - std::vector > forcedparticles; - for(unsigned int i=0;i()); - for (HepMC::GenEvent::particle_const_iterator p= evt->particles_begin(); p != evt->particles_end(); ++p){ - if((*p)->status()==1){ - int idHep = (*p)->pdg_id(); - for(unsigned int i=0;i0) which=nisforced-1; + unsigned int idx=0; for (unsigned int i=0; ipdg_id()); - bool decayed = false; + EvtId idEvt = EvtPDL::evtIdFromStdHep(forcedparticles.at(i).at(j)->pdg_id()); // "standard" decay Id if ( idx==which ) { - idEvt = forced_id[i]; + idEvt = forced_id[i]; // force decay Id edm::LogInfo("EvtGenInterface::decay ") << EvtPDL::getStdHep(idEvt) << " will force to decay " << idx+1 << " out of " << nisforced << std::endl; - while(!decayed){decayed=addToHepMC(forcedparticles.at(i).at(j),idEvt,evt,false,false,false);} // mixing already done (false) - } else { - while(!decayed){decayed=addToHepMC(forcedparticles.at(i).at(j),idEvt,evt,true,true,true);} } + bool decayed = false; + while(!decayed){decayed=addToHepMC(forcedparticles.at(i).at(j),idEvt,evt,false);} idx++; } } // add code to ensure all particles have an end vertex and if they are undecayed with no end vertes set to status 1 for (HepMC::GenEvent::particle_const_iterator p= evt->particles_begin(); p != evt->particles_end(); ++p){ - if((*p)->end_vertex() && (*p)->status() == 1)(*p)->set_status(2); + if((*p)->end_vertex() && (*p)->status() == 1)edm::LogWarning("EvtGenInterface::decay error: incorrect status!"); //(*p)->set_status(2); if((*p)->end_vertex() && (*p)->end_vertex()->particles_out_size()==0) edm::LogWarning("EvtGenInterface::decay error: empty end vertex!"); } return evt; } // Add particle to MC -bool EvtGenInterface::addToHepMC(HepMC::GenParticle* partHep,const EvtId &idEvt, HepMC::GenEvent* theEvent, bool allowMixing,bool mixforce,bool noforced){ +bool EvtGenInterface::addToHepMC(HepMC::GenParticle* partHep,const EvtId &idEvt, HepMC::GenEvent* theEvent, bool del_daug) { // Set up the parent particle from the HepMC GenEvent tree. //EvtVector4R pInit(EvtPDL::getMass(idEvt),partHep->momentum().px(),partHep->momentum().py(),partHep->momentum().pz()); EvtVector4R pInit(partHep->momentum().e(),partHep->momentum().px(),partHep->momentum().py(),partHep->momentum().pz()); EvtParticle* parent = EvtParticleFactory::particleFactory(idEvt, pInit); + HepMC::FourVector posHep = (partHep->production_vertex())->position(); + EvtVector4R vInit(posHep.t(),posHep.x(),posHep.y(),posHep.z()); // Reset polarization if requested.... if(EvtPDL::getSpinType(idEvt) == EvtSpinType::DIRAC && polarizations.count(partHep->pdg_id())>0){ HepMC::FourVector momHep = partHep->momentum(); @@ -525,32 +519,17 @@ bool EvtGenInterface::addToHepMC(HepMC::GenParticle* partHep,const EvtId &idEvt, if(parent){ // Generate the event m_EvtGen->generateDecay(parent); - - // Write out the results + if (del_daug) go_through_daughters(parent); // will delete all daugthers which are listed as forced, to allow decay them later + + // create HepMCTree EvtHepMCEvent evtHepMCEvent; - evtHepMCEvent.constructEvent(parent); + evtHepMCEvent.constructEvent(parent,vInit); HepMC::GenEvent* evtGenHepMCTree = evtHepMCEvent.getEvent(); - - // reject events where forced decay is mixed and mixforce is not on - if (!mixforce && ! noforced){ - HepMC::GenParticle* p=(*evtGenHepMCTree->particles_begin()); - if (p->end_vertex()){ - if (p->end_vertex()->particles_out_size()!=0){ - for (HepMC::GenVertex::particles_out_const_iterator d=p->end_vertex()->particles_out_const_begin(); d!=p->end_vertex()->particles_out_const_end();d++){ - if (abs((*d)->pdg_id())==abs(p->pdg_id())){ - parent->deleteTree(); // cleaning up - return false; - } - } - } - } - } + parent->deleteTree(); // update the event using a recursive function - if(!evtGenHepMCTree->particles_empty()) update_particles(partHep,theEvent,(*evtGenHepMCTree->particles_begin()),allowMixing,mixforce,noforced); + if(!evtGenHepMCTree->particles_empty()) update_particles(partHep,theEvent,(*evtGenHepMCTree->particles_begin())); - //clean up - parent->deleteTree(); } else { // this should never hapend, in such case, speak out. return false; @@ -559,60 +538,28 @@ bool EvtGenInterface::addToHepMC(HepMC::GenParticle* partHep,const EvtId &idEvt, } //Recursivley add EvtGen decay to to Event Decy tree -void EvtGenInterface::update_particles(HepMC::GenParticle* partHep,HepMC::GenEvent* theEvent,HepMC::GenParticle* p, bool allowMixing,bool mixforce,bool noforced){ +void EvtGenInterface::update_particles(HepMC::GenParticle* partHep,HepMC::GenEvent* theEvent,HepMC::GenParticle* p){ if(p->end_vertex()){ if(!partHep->end_vertex()){ HepMC::GenVertex* vtx = new HepMC::GenVertex(p->end_vertex()->position()); theEvent->add_vertex(vtx); vtx->add_particle_in(partHep); } - if(p->end_vertex()->particles_out_size()!=0){ - for(HepMC::GenVertex::particles_out_const_iterator d=p->end_vertex()->particles_out_const_begin(); d!=p->end_vertex()->particles_out_const_end();d++){ - - - // set status to 1 for forced - bool isforced=false; - for(unsigned int i=0;ipdg_id()==forced_pdgids[i]){ - isforced=true; - break; - } - } - - // check if decay products are the results of mixing - bool mforced=false; - bool hasmixing=false; - if((*d)->end_vertex()){ - if((*d)->end_vertex()->particles_out_size()!=0){ - for(HepMC::GenVertex::particles_out_const_iterator dd=(*d)->end_vertex()->particles_out_const_begin(); dd!=(*d)->end_vertex()->particles_out_const_end();dd++){ - if(abs((*dd)->pdg_id())==abs((*d)->pdg_id())){ - if(mixforce && isforced) mforced=true; // turn off for mixing - if(allowMixing) hasmixing=true; - } - } - } - } - - // Create daughter and add to event - int status =(*d)->status(); - if(isforced && !mforced) status=1; - if(isforced && mforced) status=2; - HepMC::GenParticle *daughter = new HepMC::GenParticle((*d)->momentum(),(*d)->pdg_id(),status); - daughter->suggest_barcode(theEvent->particles_size()+1); - - partHep->end_vertex()->add_particle_out(daughter); - - // add forced mix particles - if(isforced && noforced && !mforced){ continue;} - if(isforced && mforced){update_particles(daughter,theEvent,(*d),true,true,true); continue;} - // Recursively add daughters without re-running - if((*d)->end_vertex()) update_particles(daughter,theEvent,(*d),hasmixing,mixforce); + if ( p->end_vertex()->particles_out_size()!=0 ){ + + for ( HepMC::GenVertex::particles_out_const_iterator d=p->end_vertex()->particles_out_const_begin(); + d!=p->end_vertex()->particles_out_const_end();d++ ){ + + HepMC::GenParticle *daughter = new HepMC::GenParticle((*d)->momentum(),(*d)->pdg_id(),(*d)->status()); + daughter->suggest_barcode(theEvent->particles_size()+1); + partHep->end_vertex()->add_particle_out(daughter); + if((*d)->end_vertex()) update_particles(daughter,theEvent,(*d)); // if daugthers add them as well } + partHep->set_status(p->status()); } } } - void EvtGenInterface::setRandomEngine(CLHEP::HepRandomEngine* v) { the_engine->setRandomEngine(v); fRandomEngine=v; @@ -653,4 +600,24 @@ bool EvtGenInterface::hasnoDaughter(HepMC::GenParticle* p){ return true; } +void EvtGenInterface::go_through_daughters(EvtParticle* part) { + int NDaug=part->getNDaug(); + if (NDaug) { + EvtParticle* Daughter; + for (int i=0;igetDaug(i); + int idHep = Daughter->getPDGId(); + int found=0; + for (unsigned int j=0;jdeleteDaughters(); + break; + } + } + if (!found) go_through_daughters(Daughter); + } + } +} + DEFINE_EDM_PLUGIN(EvtGenFactory, gen::EvtGenInterface, "EvtGen130"); diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015MuonGEMDevXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015MuonGEMDevXML_cfi.py index 6cf62eb1b9af3..aeb52673cac12 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015MuonGEMDevXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015MuonGEMDevXML_cfi.py @@ -215,6 +215,7 @@ # 'Geometry/EcalCommonData/data/esalgo.xml', # 'Geometry/EcalCommonData/data/eeF.xml', # 'Geometry/EcalCommonData/data/eeB.xml', + # 'Geometry/EcalCommonData/data/ectkcable.xml', # 'Geometry/HcalCommonData/data/hcalrotations.xml', # 'Geometry/HcalCommonData/data/hcalalgo.xml', # 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015PilotXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015PilotXML_cfi.py index de20cf28ce329..2e86f10f131e5 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015PilotXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015PilotXML_cfi.py @@ -210,6 +210,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_RPC2Gap_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_RPC2Gap_cfi.py index 3aaf06a709ab8..c7e708eaa885b 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_RPC2Gap_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_RPC2Gap_cfi.py @@ -210,6 +210,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_RPC4RE11_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_RPC4RE11_cfi.py index e584d58eab383..c3cd2a9646df2 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_RPC4RE11_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_RPC4RE11_cfi.py @@ -210,6 +210,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_cfi.py index 2de9800f2cc03..2d2d01c232f18 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015XML_cfi.py @@ -211,6 +211,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015ZeroMaterialXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015ZeroMaterialXML_cfi.py index 19332943421ae..50dbba2cab7e2 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015ZeroMaterialXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015ZeroMaterialXML_cfi.py @@ -211,6 +211,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015devXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015devXML_cfi.py index e19246dead678..424c2cb410ebf 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2015devXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2015devXML_cfi.py @@ -212,6 +212,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometryPhaseIIGEMXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometryPhaseIIGEMXML_cfi.py index 0c63aef54aa8c..342b277885609 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometryPhaseIIGEMXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometryPhaseIIGEMXML_cfi.py @@ -208,6 +208,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometryTest2014XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometryTest2014XML_cfi.py index 6a3d2de545db0..3091f8d22ff2e 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometryTest2014XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometryTest2014XML_cfi.py @@ -208,6 +208,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometryXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometryXML_cfi.py index be6d0be1fd933..4be0fa5163554 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometryXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometryXML_cfi.py @@ -208,6 +208,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometryZeroMaterialXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometryZeroMaterialXML_cfi.py index 33da2e7558938..f01d9370bc385 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometryZeroMaterialXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometryZeroMaterialXML_cfi.py @@ -208,6 +208,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsIdealGeometry2015XML_cfi.py b/Geometry/CMSCommonData/python/cmsIdealGeometry2015XML_cfi.py index 52e1dee4d0eb5..e1760cb1b88ac 100644 --- a/Geometry/CMSCommonData/python/cmsIdealGeometry2015XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsIdealGeometry2015XML_cfi.py @@ -210,6 +210,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsIdealGeometry2015devXML_cfi.py b/Geometry/CMSCommonData/python/cmsIdealGeometry2015devXML_cfi.py index a7f5c6cb53c6f..72addf51839e3 100644 --- a/Geometry/CMSCommonData/python/cmsIdealGeometry2015devXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsIdealGeometry2015devXML_cfi.py @@ -210,6 +210,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CMSCommonData/python/cmsIdealGeometryXML_cfi.py b/Geometry/CMSCommonData/python/cmsIdealGeometryXML_cfi.py index 861a30154b947..d52572ee9d608 100644 --- a/Geometry/CMSCommonData/python/cmsIdealGeometryXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsIdealGeometryXML_cfi.py @@ -207,6 +207,7 @@ 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', diff --git a/Geometry/CaloEventSetup/plugins/CaloTowerConstituentsMapBuilder.cc b/Geometry/CaloEventSetup/plugins/CaloTowerConstituentsMapBuilder.cc index 5fb5079449bed..32b87ca81003a 100644 --- a/Geometry/CaloEventSetup/plugins/CaloTowerConstituentsMapBuilder.cc +++ b/Geometry/CaloEventSetup/plugins/CaloTowerConstituentsMapBuilder.cc @@ -56,7 +56,7 @@ CaloTowerConstituentsMapBuilder::fillDescriptions(edm::ConfigurationDescriptions // ------------ method called to produce the data ------------ CaloTowerConstituentsMapBuilder::ReturnType -CaloTowerConstituentsMapBuilder::produce(const IdealGeometryRecord& iRecord) +CaloTowerConstituentsMapBuilder::produce(const HcalRecNumberingRecord& iRecord) { edm::ESHandle topology ; iRecord.get( topology ) ; diff --git a/Geometry/CaloEventSetup/plugins/CaloTowerConstituentsMapBuilder.h b/Geometry/CaloEventSetup/plugins/CaloTowerConstituentsMapBuilder.h index f7b8f7fe6e73e..056e8ac9a726e 100644 --- a/Geometry/CaloEventSetup/plugins/CaloTowerConstituentsMapBuilder.h +++ b/Geometry/CaloEventSetup/plugins/CaloTowerConstituentsMapBuilder.h @@ -26,7 +26,7 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/CaloTopology/interface/CaloTowerConstituentsMap.h" namespace edm { @@ -44,7 +44,7 @@ class CaloTowerConstituentsMapBuilder : public edm::ESProducer { typedef std::auto_ptr ReturnType; - ReturnType produce(const IdealGeometryRecord&); + ReturnType produce(const HcalRecNumberingRecord&); static void fillDescriptions(edm::ConfigurationDescriptions & descriptions); private: diff --git a/Geometry/CaloEventSetup/python/CaloGeometry_cff.py b/Geometry/CaloEventSetup/python/CaloGeometry_cff.py index ce90829b47129..ed5e00fb8f16e 100644 --- a/Geometry/CaloEventSetup/python/CaloGeometry_cff.py +++ b/Geometry/CaloEventSetup/python/CaloGeometry_cff.py @@ -2,8 +2,8 @@ from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * from Geometry.EcalAlgo.EcalGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.HcalTopology_cfi import * from Geometry.ForwardGeometry.ForwardGeometry_cfi import * diff --git a/Geometry/CaloTopology/BuildFile.xml b/Geometry/CaloTopology/BuildFile.xml index cd4bd2e054d00..2ce7036012a14 100644 --- a/Geometry/CaloTopology/BuildFile.xml +++ b/Geometry/CaloTopology/BuildFile.xml @@ -3,13 +3,13 @@ - + diff --git a/Geometry/CaloTopology/interface/HcalTopology.h b/Geometry/CaloTopology/interface/HcalTopology.h index 9e929eaad9727..bd2e892590b1b 100644 --- a/Geometry/CaloTopology/interface/HcalTopology.h +++ b/Geometry/CaloTopology/interface/HcalTopology.h @@ -5,7 +5,8 @@ #include #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" -#include "Geometry/CaloTopology/interface/HcalTopologyMode.h" +#include "Geometry/HcalCommonData/interface/HcalTopologyMode.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" /** \class HcalTopology @@ -25,7 +26,8 @@ class HcalTopology : public CaloSubdetectorTopology { public: - HcalTopology( HcalTopologyMode::Mode mode, int maxDepthHB, int maxDepthHE, HcalTopologyMode::TriggerMode tmode=HcalTopologyMode::tm_LHC_PreLS1); + HcalTopology(const HcalDDDRecConstants* hcons, HcalTopologyMode::TriggerMode tmode=HcalTopologyMode::tm_LHC_PreLS1); + HcalTopology(HcalTopologyMode::Mode mode, int maxDepthHB, int maxDepthHE, HcalTopologyMode::TriggerMode tmode=HcalTopologyMode::tm_LHC_PreLS1); HcalTopologyMode::Mode mode() const {return mode_;} HcalTopologyMode::TriggerMode triggerMode() const { return triggerMode_; } @@ -36,6 +38,7 @@ class HcalTopology : public CaloSubdetectorTopology { /** Exclude an eta/phi/depth range for a given subdetector */ int exclude(HcalSubdetector subdet, int ieta1, int ieta2, int iphi1, int iphi2, int depth1=1, int depth2=4); + static std::string producerTag() { return "HCAL" ; } /// return a linear packed id virtual unsigned int detId2denseId(const DetId& id) const; @@ -50,6 +53,7 @@ class HcalTopology : public CaloSubdetectorTopology { virtual bool valid(const DetId& id) const; /** Is this a valid cell id? */ bool validHcal(const HcalDetId& id) const; + bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const; /** Get the neighbors of the given cell in east direction*/ virtual std::vector east(const DetId& id) const; /** Get the neighbors of the given cell in west direction*/ @@ -85,11 +89,12 @@ class HcalTopology : public CaloSubdetectorTopology { int firstHORing() const {return firstHORing_;} int lastHORing() const {return lastHORing_;} - int firstHEDoublePhiRing() const {return firstHEDoublePhiRing_;} - int firstHFQuadPhiRing() const { return firstHFQuadPhiRing_; } + int firstHEDoublePhiRing() const {return firstHEDoublePhiRing_;} + int firstHEQuadPhiRing() const {return firstHEQuadPhiRing_;} + int firstHFQuadPhiRing() const {return firstHFQuadPhiRing_;} int firstHETripleDepthRing() const {return firstHETripleDepthRing_;} - int singlePhiBins() const {return singlePhiBins_;} - int doublePhiBins() const {return doublePhiBins_;} + int singlePhiBins() const {return singlePhiBins_;} + int doublePhiBins() const {return doublePhiBins_;} /// finds the number of depth bins and which is the number to start with void depthBinInformation(HcalSubdetector subdet, int etaRing, @@ -97,6 +102,11 @@ class HcalTopology : public CaloSubdetectorTopology { /// how many phi segments in this ring int nPhiBins(int etaRing) const; + int nPhiBins(HcalSubdetector subdet, int etaRing) const; + + /// eta and phi index from eta, phi values + int etaRing(HcalSubdetector subdet, double eta) const; + int phiBin(HcalSubdetector subdet, int etaRing, double phi) const; /// for each of the ~17 depth segments, specify which readout bin they belong to /// if the ring is not found, the first one with a lower ring will be returned. @@ -117,6 +127,9 @@ class HcalTopology : public CaloSubdetectorTopology { int maxDepthHB() const { return maxDepthHB_;} int maxDepthHE() const { return maxDepthHE_;} + int maxDepth(HcalSubdetector subdet) const; + double etaMax(HcalSubdetector subdet) const; + std::pair etaRange(HcalSubdetector subdet, int ieta) const; /// return a linear packed id from HB unsigned int detId2denseIdHB(const DetId& id) const; @@ -143,30 +156,29 @@ class HcalTopology : public CaloSubdetectorTopology { bool validDetIdPreLS1(const HcalDetId& id) const; bool validRaw(const HcalDetId& id) const; unsigned int detId2denseIdPreLS1 (const DetId& id) const; + bool isExcluded(const HcalDetId& id) const; + const HcalDDDRecConstants *hcons_; std::vector exclusionList_; bool excludeHB_, excludeHE_, excludeHO_, excludeHF_; HcalTopologyMode::Mode mode_; HcalTopologyMode::TriggerMode triggerMode_; - bool isExcluded(const HcalDetId& id) const; - const int firstHBRing_; - const int lastHBRing_; - const int firstHERing_; - const int lastHERing_; - const int firstHFRing_; - const int lastHFRing_; - const int firstHORing_; - const int lastHORing_; - - const int firstHEDoublePhiRing_; - const int firstHFQuadPhiRing_; - const int firstHETripleDepthRing_; - const int singlePhiBins_; - const int doublePhiBins_; - const int maxDepthHB_; - const int maxDepthHE_; + int firstHBRing_, lastHBRing_; + int firstHERing_, lastHERing_; + int firstHFRing_, lastHFRing_; + int firstHORing_, lastHORing_; + + std::vector etaBinsHB_, etaBinsHE_; + int nEtaHB_, nEtaHE_; + + int firstHEDoublePhiRing_, firstHEQuadPhiRing_, firstHFQuadPhiRing_; + int firstHETripleDepthRing_; + int singlePhiBins_, doublePhiBins_; + int maxDepthHB_, maxDepthHE_, maxDepthHF_; + int etaHE2HF_, etaHF2HE_; + int maxEta_; unsigned int HBSize_; unsigned int HESize_; @@ -174,7 +186,11 @@ class HcalTopology : public CaloSubdetectorTopology { unsigned int HFSize_; unsigned int HTSize_; unsigned int CALIBSize_; - const unsigned int numberOfShapes_; + unsigned int numberOfShapes_; + + std::vector etaTable, etaTableHF, dPhiTable, dPhiTableHF; + std::vector phioff; + std::vector unitPhi, unitPhiHF; int topoVersion_; diff --git a/Geometry/CaloTopology/src/HcalTopology.cc b/Geometry/CaloTopology/src/HcalTopology.cc index c4d7765fc3230..c6d8fe06ecf5b 100644 --- a/Geometry/CaloTopology/src/HcalTopology.cc +++ b/Geometry/CaloTopology/src/HcalTopology.cc @@ -4,38 +4,141 @@ #include #include #include "FWCore/Utilities/interface/Exception.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h" #include "DataFormats/HcalDetId/interface/HcalCalibDetId.h" +#include "CLHEP/Units/GlobalPhysicalConstants.h" static const int IPHI_MAX=72; -HcalTopology::HcalTopology(HcalTopologyMode::Mode mode, int maxDepthHB, int maxDepthHE, HcalTopologyMode::TriggerMode tmode) : - excludeHB_(false), - excludeHE_(false), - excludeHO_(false), - excludeHF_(false), - mode_(mode), +HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, HcalTopologyMode::TriggerMode tmode) : + hcons_(hcons), + excludeHB_(false), excludeHE_(false), excludeHO_(false), excludeHF_(false), triggerMode_(tmode), firstHBRing_(1), - lastHBRing_(16), - firstHERing_(16), - lastHERing_(29), - firstHFRing_(29), - lastHFRing_(41), - firstHORing_(1), - lastHORing_(15), + firstHERing_(999), lastHERing_(0), + firstHFRing_(29), lastHFRing_(41), + firstHORing_(1), lastHORing_(15), + firstHEDoublePhiRing_(999), firstHEQuadPhiRing_(999), + firstHFQuadPhiRing_(40), firstHETripleDepthRing_(999), + singlePhiBins_(72), doublePhiBins_(36) { + + mode_ = (HcalTopologyMode::Mode)(hcons_->getTopoMode()); + maxDepthHB_ = hcons_->getMaxDepth(0); + maxDepthHE_ = hcons_->getMaxDepth(1); + maxDepthHF_ = hcons_->getMaxDepth(2); + etaBinsHB_ = hcons_->getEtaBins(0); + etaBinsHE_ = hcons_->getEtaBins(1); + nEtaHB_ = (int)(etaBinsHB_.size()); + lastHBRing_ = firstHBRing_+nEtaHB_-1; + for (int i = 0; i < (int)(etaBinsHE_.size()); ++i) { + if (firstHERing_ > etaBinsHE_[i].ieta) firstHERing_ = etaBinsHE_[i].ieta; + if (lastHERing_ < etaBinsHE_[i].ieta) lastHERing_ = etaBinsHE_[i].ieta; + int unit = (int)((etaBinsHE_[i].dphi+0.01)/(5.0*CLHEP::deg)); + if (unit == 2 && firstHEDoublePhiRing_ > etaBinsHE_[i].ieta) + firstHEDoublePhiRing_ = etaBinsHE_[i].ieta; + if (unit == 4 && firstHEQuadPhiRing_ > etaBinsHE_[i].ieta) + firstHEQuadPhiRing_ = etaBinsHE_[i].ieta; + if (etaBinsHE_[i].layer.size() > 2 && firstHETripleDepthRing_ > etaBinsHE_[i].ieta) + firstHETripleDepthRing_ = etaBinsHE_[i].ieta; + } + nEtaHE_ = (lastHERing_ - firstHERing_ + 1); + if (mode_==HcalTopologyMode::LHC) { + topoVersion_=0; //DL + HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal + HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal + HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 + HFSize_ = kHFSizePreLS1; // phi * eta * depth * pm + HTSize_ = kHTSizePreLS1; + numberOfShapes_ = 87; + } else if (mode_==HcalTopologyMode::SLHC) { // need to know more eventually + topoVersion_=10; + HBSize_ = nEtaHB_*72*maxDepthHB_*2; + HESize_ = nEtaHE_*72*maxDepthHE_*2; + HOSize_ = (lastHORing_-firstHORing_+1)*72*2; // ieta * iphi * 2 + HFSize_ = (lastHFRing_-firstHFRing_+1)*72*2*2; // ieta * iphi * depth * 2 + HTSize_ = kHTSizePreLS1; //no clue! + numberOfShapes_ = 500; + } + maxEta_ = (lastHERing_ > lastHFRing_) ? lastHERing_ : lastHFRing_; + + //The transition between HE/HF in eta + etaTableHF = hcons_->getEtaTableHF(); + etaTable = hcons_->getEtaTable(); + dPhiTableHF = hcons_->getPhiTableHF(); + dPhiTable = hcons_->getPhiTable(); + phioff = hcons_->getPhiOffs(); + std::pair ietaHF = hcons_->getEtaRange(2); + double eta = etaBinsHE_[etaBinsHE_.size()-1].etaMax; + etaHE2HF_ = firstHFRing_; + for (unsigned int i=1; igetNEta(); + for (int ring=1; ring<=nEta; ++ring) { + std::vector segmentation = hcons_->getDepth(ring-1); + setDepthSegmentation(ring,segmentation); +#ifdef DebugLog + std::cout << "Set segmentation for ring " << ring << " with " + << segmentation.size() << " elements:"; + for (unsigned int k=0; k HcalTopology::south(const DetId& id) const { std::vector HcalTopology::up(const DetId& id) const { HcalDetId neighbor = id; std::vector vNeighborsDetId; - if(incrementDepth(neighbor)) { + if (incrementDepth(neighbor)) { vNeighborsDetId.push_back(neighbor); } return vNeighborsDetId; @@ -159,9 +273,9 @@ int HcalTopology::exclude(HcalSubdetector subdet, int ieta1, int ieta2, int iphi bool exed=false; // first, check the full detector exclusions... (fast) switch (subdet) { - case(HcalBarrel): exed=excludeHB_; break; - case(HcalEndcap): exed=excludeHE_; break; - case(HcalOuter): exed=excludeHO_; break; + case(HcalBarrel): exed=excludeHB_; break; + case(HcalEndcap): exed=excludeHE_; break; + case(HcalOuter): exed=excludeHO_; break; case(HcalForward): exed=excludeHF_; break; default: exed=false; } @@ -267,7 +381,7 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { int aieta=id.ietaAbs(); int depth=id.depth(); int iphi=id.iphi(); - if ((ieta==0 || iphi<=0 || iphi>IPHI_MAX) || aieta>lastHFRing()) return false; // outer limits + if ((ieta==0 || iphi<=0 || iphi>IPHI_MAX) || aieta>maxEta_) return false; // outer limits if (ok) { HcalSubdetector subdet=id.subdet(); @@ -279,7 +393,21 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { } } else if (subdet==HcalEndcap) { if (mode_==HcalTopologyMode::SLHC || mode_==HcalTopologyMode::H2HE) { - if (depth>maxDepthHE_ || aietalastHERing() || (aieta==firstHERing() && depth<3) || (aieta>=firstHEDoublePhiRing() && (iphi%2)==0)) ok=false; + if (depth>maxDepthHE_ || aietalastHERing() || + (aieta==firstHERing() && depth<3)) { + ok = false; + } else { + for (unsigned int i=0; i= firstHEDoublePhiRing() && (iphi%2)==0) ok=false; + if (aieta >= firstHEQuadPhiRing() && (iphi%4)!=3) ok=false; + if (depth < etaBinsHE_[i].depthStart || + depth > (etaBinsHE_[i].depthStart+(int)(etaBinsHE_[i].layer.size()))) + ok = false; + break; + } + } + } } else { if (depth>3 || aietalastHERing() || (aieta==firstHERing() && depth!=3) || (aieta==17 && depth!=1 && mode_!=HcalTopologyMode::H2) || // special case at H2 (((aieta>=17 && aieta2) || @@ -288,7 +416,7 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { } else if (subdet==HcalOuter) { if (aieta>lastHORing() || iphi>IPHI_MAX || depth!=4) ok=false; } else if (subdet==HcalForward) { - if (aietalastHFRing() || ((iphi%2)==0) || (depth>2) || (aieta>=firstHFQuadPhiRing() && ((iphi+1)%4)!=0)) ok=false; + if (aietalastHFRing() || ((iphi%2)==0) || (depth>maxDepthHF_) || (aieta>=firstHFQuadPhiRing() && ((iphi+1)%4)!=0)) ok=false; } else { ok=false; } @@ -296,7 +424,6 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { return ok; } - bool HcalTopology::incIPhi(const HcalDetId& id, HcalDetId &neighbor) const { bool ok=valid(id); if (ok) { @@ -307,8 +434,11 @@ bool HcalTopology::incIPhi(const HcalDetId& id, HcalDetId &neighbor) const { else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+1,id.depth()); break; case (HcalEndcap): - if (id.ietaAbs()>=firstHEDoublePhiRing()) { - if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth()); + if (id.ietaAbs()>=firstHEQuadPhiRing()) { + if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),3,id.depth()); + else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+4,id.depth()); + } else if (id.ietaAbs()>=firstHEDoublePhiRing()) { + if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth()); else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+2,id.depth()); } else { if (id.iphi()==IPHI_MAX) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth()); @@ -341,7 +471,10 @@ bool HcalTopology::decIPhi(const HcalDetId& id, HcalDetId &neighbor) const { else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-1,id.depth()); break; case (HcalEndcap): - if (id.ietaAbs()>=firstHEDoublePhiRing()) { + if (id.ietaAbs()>=firstHEQuadPhiRing()) { + if (id.iphi()==3) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX-1,id.depth()); + else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-4,id.depth()); + } else if (id.ietaAbs()>=firstHEDoublePhiRing()) { if (id.iphi()==1) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX-1,id.depth()); else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-2,id.depth()); } else { @@ -383,10 +516,12 @@ int HcalTopology::incAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const { neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),id.iphi()-1,id.depth()); else if (aieta==firstHFQuadPhiRing()-1 && ((id.iphi()+1)%4)!=0) neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),((id.iphi()==1)?(71):(id.iphi()-2)),id.depth()); + else if (aieta==firstHEQuadPhiRing()-1 && ((id.iphi()+1)%4)!=0) + neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),((id.iphi()==1)?(71):(id.iphi()-2)),id.depth()); else if (aieta==lastHBRing()) neighbors[0]=HcalDetId(HcalEndcap,(aieta+1)*id.zside(),id.iphi(),1); else if (aieta==lastHERing()) - neighbors[0]=HcalDetId(HcalForward,(aieta+1)*id.zside(),id.iphi(),1); + neighbors[0]=HcalDetId(HcalForward,etaHE2HF_*id.zside(),id.iphi(),1); else neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),id.iphi(),id.depth()); @@ -408,12 +543,17 @@ int HcalTopology::decAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const { neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth()); if (id.iphi()==IPHI_MAX-1) neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),1,id.depth()); else neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi()+2,id.depth()); + } else if (aieta==firstHEQuadPhiRing()) { + n=2; + neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth()); + if (id.iphi()==IPHI_MAX-1) neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),1,id.depth()); + else neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi()+2,id.depth()); } else if (aieta==1) { neighbors[0]=HcalDetId(id.subdet(),-aieta*id.zside(),id.iphi(),id.depth()); - } else if (aieta==lastHBRing()+1) { - neighbors[0]=HcalDetId(HcalBarrel,(aieta-1)*id.zside(),id.iphi(),id.depth()); - } else if (aieta==lastHERing()+1) { - neighbors[0]=HcalDetId(HcalEndcap,(aieta-1)*id.zside(),id.iphi(),id.depth()); + } else if (aieta==firstHERing()) { + neighbors[0]=HcalDetId(HcalBarrel,(aieta-1)*id.zside(),id.iphi(),1); + } else if (aieta==firstHFRing()) { + neighbors[0]=HcalDetId(HcalEndcap,etaHF2HE_*id.zside(),id.iphi(),1); } else neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth()); @@ -444,10 +584,10 @@ void HcalTopology::depthBinInformation(HcalSubdetector subdet, int etaRing, } } else { if (etaRing<=14) { - nDepthBins = 1; + nDepthBins = 1; startingBin = 1; } else { - nDepthBins = 2; + nDepthBins = 2; startingBin = 1; } } @@ -462,13 +602,13 @@ void HcalTopology::depthBinInformation(HcalSubdetector subdet, int etaRing, } } else { if (etaRing==firstHERing()) { - nDepthBins = 1; + nDepthBins = 1; startingBin = 3; } else if (etaRing==17) { - nDepthBins = 1; + nDepthBins = 1; startingBin = 1; } else if (etaRing==lastHERing()) { - nDepthBins = 2; + nDepthBins = 2; startingBin = 1; } else { nDepthBins = (etaRing >= firstHETripleDepthRing()) ? 3 : 2; @@ -476,19 +616,18 @@ void HcalTopology::depthBinInformation(HcalSubdetector subdet, int etaRing, } } } else if(subdet == HcalForward) { - nDepthBins = 2; + nDepthBins = maxDepthHF_; startingBin = 1; } else if(subdet == HcalOuter) { - nDepthBins = 1; + nDepthBins = 1; startingBin = 4; } else { std::cerr << "Bad HCAL subdetector " << subdet << std::endl; } } +bool HcalTopology::incrementDepth(HcalDetId & detId) const { -bool HcalTopology::incrementDepth(HcalDetId & detId) const -{ HcalSubdetector subdet = detId.subdet(); int ieta = detId.ieta(); int etaRing = detId.ietaAbs(); @@ -498,21 +637,23 @@ bool HcalTopology::incrementDepth(HcalDetId & detId) const // see if the new depth bin exists ++depth; - if(depth > nDepthBins) { + if (depth > nDepthBins) { // handle on a case-by-case basis - if(subdet == HcalBarrel && etaRing < lastHORing()) { + if (subdet == HcalBarrel && etaRing < lastHORing()) { // HO subdet = HcalOuter; - depth = 4; - } else if(subdet == HcalBarrel && etaRing == lastHBRing()) { + depth = 4; + } else if (subdet == HcalBarrel && etaRing == lastHBRing()) { // overlap subdet = HcalEndcap; - } else if(subdet == HcalEndcap && etaRing == lastHERing()-1) { + } else if (subdet == HcalEndcap && etaRing == lastHERing()-1 && + mode_ != HcalTopologyMode::SLHC) { // guard ring HF29 is behind HE 28 subdet = HcalForward; (ieta > 0) ? ++ieta : --ieta; depth = 1; - } else if(subdet == HcalEndcap && etaRing == lastHERing()) { + } else if (subdet == HcalEndcap && etaRing == lastHERing() && + mode_ != HcalTopologyMode::SLHC) { // split cells go to bigger granularity. Ring 29 -> 28 (ieta > 0) ? --ieta : ++ieta; } else { @@ -535,25 +676,30 @@ bool HcalTopology::decrementDepth(HcalDetId & detId) const { // see if the new depth bin exists --depth; - if (subdet == HcalOuter) { + if ((subdet == HcalOuter) || + (subdet == HcalEndcap && etaRing == firstHERing())) { subdet = HcalBarrel; - if (mode_==HcalTopologyMode::SLHC || mode_==HcalTopologyMode::H2HE) { - depth = maxDepthHB_; - } else { - depth = (etaRing<=14) ? 1 : 2; + for (int i=0; i 0) ? --ieta : ++ieta; } else if (depth <= 0) { if (subdet == HcalForward && etaRing == firstHFRing()) { // overlap subdet = HcalEndcap; - etaRing= lastHERing()-1; + etaRing= etaHF2HE_; ieta = (ieta > 0) ? etaRing : -etaRing; + for (unsigned int i=0; i= firstHFQuadPhiRing()) lastPhiBin=doublePhiBins_/2; + if (etaRing>= firstHFQuadPhiRing()) lastPhiBin=doublePhiBins_/2; + else if (etaRing>= firstHEQuadPhiRing()) lastPhiBin=doublePhiBins_/2; else if (etaRing>= firstHEDoublePhiRing()) lastPhiBin=doublePhiBins_; return lastPhiBin; } -void HcalTopology::getDepthSegmentation(unsigned ring, std::vector & readoutDepths) const -{ +int HcalTopology::nPhiBins(HcalSubdetector bc, int etaRing) const { + static const double twopi = M_PI+M_PI; + int lastPhiBin=singlePhiBins_; + if (bc == HcalForward) { + lastPhiBin = (int)((twopi+0.001)/dPhiTableHF[etaRing-firstHFRing_]); + } else { + lastPhiBin = (int)((twopi+0.001)/dPhiTable[etaRing-firstHBRing_]); + } + return lastPhiBin; +} + +int HcalTopology::maxDepth(HcalSubdetector bc) const { + if (bc == HcalBarrel) return maxDepthHB_; + else if (bc == HcalEndcap) return maxDepthHE_; + else if (bc == HcalForward) return maxDepthHF_; + else return 4; +} + +int HcalTopology::etaRing(HcalSubdetector bc, double abseta) const { + int etaring = firstHBRing_; + if (bc == HcalForward) { + etaring = firstHFRing_; + for (unsigned int k=0; k etaTable[etaTable.size()-1]) etaring = lastHERing_; + } + return etaring; +} + +int HcalTopology::phiBin(HcalSubdetector bc, int etaring, double phi) const { + static const double twopi = M_PI+M_PI; + //put phi in correct range (0->2pi) + int index(0); + if (bc == HcalBarrel) { + index = (etaring-firstHBRing_); + phi -= phioff[0]; + } else if (bc == HcalEndcap) { + index = (etaring-firstHBRing_); + phi -= phioff[1]; + } else if (bc == HcalForward) { + index = (etaring-firstHFRing_); + if (index < (int)(dPhiTableHF.size())) { + if (unitPhiHF[index] > 2) phi -= phioff[4]; + else phi -= phioff[2]; + } + } + if (phi<0.0) phi += twopi; + if (phi>twopi) phi -= twopi; + int phibin(1), unit(1); + if (bc == HcalForward) { + if (index < (int)(dPhiTableHF.size())) { + unit = unitPhiHF[index]; + phibin = static_cast(phi/dPhiTableHF[index])+1; + } + } else { + if (index < (int)(dPhiTable.size())) { + phibin = static_cast(phi/dPhiTable[index])+1; + unit = unitPhi[index]; + } + } + int iphi(phibin); + if (unit == 2) iphi = (phibin-1)*2+1; + else if (unit == 4) iphi = (phibin-1)*4+3; + return iphi; +} + +void HcalTopology::getDepthSegmentation(unsigned ring, std::vector & readoutDepths) const { // if it doesn't exist, return the first entry with a lower index. So if we only // have entries for 1 and 17, any input from 1-16 should return the entry for ring 1 SegmentationMap::const_iterator pos = depthSegmentation_.upper_bound(ring); - if(pos == depthSegmentation_.begin()) { + if (pos == depthSegmentation_.begin()) { throw cms::Exception("HcalTopology") << "No depth segmentation found for ring" << ring; } --pos; - // pos now refers to the last element with key <= ring. + // pos now refers to the last element with key <= ring. readoutDepths = pos->second; } -void HcalTopology::setDepthSegmentation(unsigned ring, const std::vector & readoutDepths) -{ +void HcalTopology::setDepthSegmentation(unsigned ring, const std::vector & readoutDepths) { depthSegmentation_[ring] = readoutDepths; } @@ -597,6 +819,36 @@ std::pair HcalTopology::segmentBoundaries(unsigned ring, unsigned dept return std::pair(d1, d2); } +double HcalTopology::etaMax(HcalSubdetector subdet) const { + double eta(0); + switch (subdet) { + case(HcalBarrel): + if (lastHBRing_ < (int)(etaTable.size())) eta=etaTable[lastHBRing_]; break; + case(HcalEndcap): + if (lastHERing_ < (int)(etaTable.size()) && nEtaHE_ > 0) eta=etaTable[lastHERing_]; break; + case(HcalOuter): + if (lastHORing_ < (int)(etaTable.size())) eta=etaTable[lastHORing_]; break; + case(HcalForward): + if (etaTableHF.size() > 0) eta=etaTableHF[etaTableHF.size()-1]; break; + default: eta=0; + } + return eta; +} +std::pair HcalTopology::etaRange(HcalSubdetector subdet, + int ieta) const { + + if (subdet == HcalForward) { + unsigned int ii = (unsigned int)(ieta-firstHFRing_); + return std::pair(etaTableHF[ii],etaTableHF[ii+1]); + } else { + if (mode_==HcalTopologyMode::LHC && ieta == lastHERing_-1) { + return std::pair(etaTable[ieta-1],etaTable[ieta+1]); + } else { + return std::pair(etaTable[ieta-1],etaTable[ieta]); + } + } +} + unsigned int HcalTopology::detId2denseIdPreLS1 (const DetId& id) const { HcalDetId hid(id); @@ -634,7 +886,9 @@ unsigned int HcalTopology::detId2denseIdHB(const DetId& id) const { if (topoVersion_==0) { retval=( ip - 1 )*18 + dp - 1 + ie - ( ie<16 ? 1 : 0 ) + zn*kHBhalf; } else if (topoVersion_==10) { - retval=dp-1 + maxDepthHB_*(ip-1)+maxDepthHB_*72*(hid.ieta()-1+33*zn); + retval=(dp-1)+maxDepthHB_*(ip-1); + if (hid.ieta()>0) retval+=maxDepthHB_*72*(hid.ieta()-firstHBRing()); + else retval+=maxDepthHB_*72*(hid.ieta()+lastHBRing()+nEtaHB_); } return retval; } @@ -654,7 +908,9 @@ unsigned int HcalTopology::detId2denseIdHE(const DetId& id) const { ( ( ie>=27 && ie<=28 ) ? 20 + 3*( ie - 27 ) + dp - 1 : 26 + 2*( ie - 29 ) + dp - 1 ) ) ) ) + zn*kHEhalf; } else if (topoVersion_==10) { - retval=(dp-1)+maxDepthHE_*(ip-1)+maxDepthHE_*72*(hid.ieta()-16+zn*(14+29+16)); + retval=(dp-1)+maxDepthHE_*(ip-1); + if (hid.ieta()>0) retval+=maxDepthHE_*72*(hid.ieta()-firstHERing()); + else retval+=maxDepthHE_*72*(hid.ieta()+lastHERing()+nEtaHE_); } return retval; } @@ -669,7 +925,8 @@ unsigned int HcalTopology::detId2denseIdHO(const DetId& id) const { if (topoVersion_==0) { retval=( ip - 1 )*15 + ( ie - 1 ) + zn*kHOhalf; } else if (topoVersion_==10) { - retval=( ip - 1 )*15 + ( ie - 1 ) + zn*kHOhalf; + if (hid.ieta()>0) retval=(ip-1)+72*(hid.ieta()-1); + else retval=(ip-1)+72*(30+hid.ieta()); } return retval; } @@ -686,8 +943,9 @@ unsigned int HcalTopology::detId2denseIdHF(const DetId& id) const { retval = ( ( ip - 1 )/4 )*4 + ( ( ip - 1 )/2 )*22 + 2*( ie - 29 ) + ( dp - 1 ) + zn*kHFhalf; } else if (topoVersion_==10) { - retval = ( ( ip - 1 )/4 )*4 + ( ( ip - 1 )/2 )*22 + - 2*( ie - 29 ) + ( dp - 1 ) + zn*kHFhalf; + retval=dp-1+2*(ip-1); + if (hid.ieta()>0) retval+=maxDepthHF_*72*(hid.ieta()-29); + else retval+=maxDepthHF_*72*((41+13)+hid.ieta()); } return retval; } @@ -740,7 +998,7 @@ unsigned int HcalTopology::detId2denseIdCALIB(const DetId& id) const { //std::cout<<"CALIB_HO: "; //there are 5 special calib crosstalk channels, one in each ring if (channel==7) { - // Value stored to 'channel' is never read: channel = 2; + channel = 2; index = (ieta+2) + 420; //for HOM/HOP dphi = 6 (12 phi values), 2 channel types (0,1), eta = -2,-1 or 1,2 //for HO0/YB0 dphi = 12 (6 phi values), 2 channel types (0,1), eta = 0 @@ -750,7 +1008,7 @@ unsigned int HcalTopology::detId2denseIdCALIB(const DetId& id) const { else index = ((iphi+1)/6-1) + 36*channel + 6*(ieta+2) + 348; } } else { - std::cout << "HCAL Det Id not valid!" << std::endl; + edm::LogWarning("CaloTopology") << "HCAL Det Id not valid!"; index = 0; } @@ -773,29 +1031,23 @@ unsigned int HcalTopology::detId2denseId(const DetId& id) const { } else if (topoVersion_==10) { HcalDetId hid(id); if (hid.subdet()==HcalBarrel) { - retval=(hid.depth()-1)+maxDepthHB_*(hid.iphi()-1); - if (hid.ieta()>0) { - retval+=maxDepthHB_*72*(hid.ieta()-1); - } else { - retval+=maxDepthHB_*72*(32+hid.ieta()); - } + retval = (hid.depth()-1)+maxDepthHB_*(hid.iphi()-1); + if (hid.ieta()>0) retval+=maxDepthHB_*72*(hid.ieta()-firstHBRing()); + else retval+=maxDepthHB_*72*(hid.ieta()+lastHBRing()+nEtaHB_); } else if (hid.subdet()==HcalEndcap) { - retval=HBSize_; - retval+=(hid.depth()-1)+maxDepthHE_*(hid.iphi()-1); - if (hid.ieta()>0) { - retval+=maxDepthHE_*72*(hid.ieta()-16); - } else { - retval+=maxDepthHE_*72*((14+29)+hid.ieta()); - } + retval = HBSize_; + retval+= (hid.depth()-1)+maxDepthHE_*(hid.iphi()-1); + if (hid.ieta()>0) retval+=maxDepthHE_*72*(hid.ieta()-firstHERing()); + else retval+=maxDepthHE_*72*(hid.ieta()+lastHERing()+nEtaHE_); } else if (hid.subdet()==HcalOuter) { - retval=HBSize_+HESize_; + retval = HBSize_+HESize_; if (hid.ieta()>0) retval+=(hid.iphi()-1)+72*(hid.ieta()-1); - else retval+=(hid.iphi()-1)+72*(30+hid.ieta()); + else retval+=(hid.iphi()-1)+72*(30+hid.ieta()); } else if (hid.subdet()==HcalForward) { - retval=HBSize_+HESize_+HOSize_; - retval+=hid.depth()-1+2*(hid.iphi()-1); - if (hid.ieta()>0) retval+=2*72*(hid.ieta()-29); - else retval+=2*72*((41+13)+hid.ieta()); + retval = HBSize_+HESize_+HOSize_; + retval+= (hid.depth()-1)+maxDepthHF_*(hid.iphi()-1); + if (hid.ieta()>0) retval+=maxDepthHF_*72*(hid.ieta()-29); + else retval+=maxDepthHF_*72*((41+13)+hid.ieta()); } else { return 0xFFFFFFFu; } @@ -869,10 +1121,10 @@ DetId HcalTopology::denseId2detId(unsigned int denseid) const { if (denseid >= (HBSize_+HESize_+HOSize_)) { sd = HcalForward ; in -= (HBSize_+HESize_+HOSize_); - dp = (in%2) + 1; - ip = (in - dp + 1)%144; - ip = (ip/2) + 1; - ie = (in - dp + 1 - 2*(ip -1))/144; + dp = (in%maxDepthHF_) + 1; + ip = (in - dp + 1)%(maxDepthHF_*72); + ip = (ip/maxDepthHF_) + 1; + ie = (in - dp + 1 - maxDepthHF_*(ip -1))/(72*maxDepthHF_); if (ie > 12) {ie = 54 -ie; iz = -1;} else {ie += 29; iz = 1;} } else if (denseid >= (HBSize_+HESize_)) { @@ -890,16 +1142,16 @@ DetId HcalTopology::denseId2detId(unsigned int denseid) const { ip = (in - dp + 1)%(maxDepthHE_*72); ip = (ip/maxDepthHE_) + 1; ie = (in - dp + 1 - maxDepthHE_*(ip-1))/(72*maxDepthHE_); - if (ie > 13) {ie = 43 - ie; iz = -1;} - else {ie += 16; iz = 1;} + if (ie >= nEtaHE_) {ie = lastHERing()+nEtaHE_ - ie; iz = -1;} + else {ie = firstHERing() + ie; iz = 1;} } else { sd = HcalBarrel ; dp = (in%maxDepthHB_)+1; ip = (in - dp + 1)%(maxDepthHB_*72); ip = (ip/maxDepthHB_) + 1; ie = (in - dp + 1 - maxDepthHB_*(ip-1))/(72*maxDepthHB_); - if (ie > 15) {ie = 32 - ie; iz = -1;} - else {ie += 1; iz = 1;} + if (ie >= nEtaHB_) {ie = lastHBRing()+nEtaHB_ - ie; iz = -1;} + else {ie = firstHERing() + ie; iz = 1;} } } } diff --git a/Geometry/HcalCommonData/data/Phase0/hcalSimNumbering.xml b/Geometry/HcalCommonData/data/Phase0/hcalSimNumbering.xml index 05cb041e4efa6..56a08f89952ad 100644 --- a/Geometry/HcalCommonData/data/Phase0/hcalSimNumbering.xml +++ b/Geometry/HcalCommonData/data/Phase0/hcalSimNumbering.xml @@ -56,7 +56,7 @@ 16, 29, 41, 15 - 2, 3, 2, 4 + 2, 3, 2, 4 1.392, 3.000, 5.500, 1.305 diff --git a/Geometry/HcalCommonData/data/Run2/hcalSimNumbering.xml b/Geometry/HcalCommonData/data/Run2/hcalSimNumbering.xml new file mode 100644 index 0000000000000..51c0722283e88 --- /dev/null +++ b/Geometry/HcalCommonData/data/Run2/hcalSimNumbering.xml @@ -0,0 +1,104 @@ + + + + + + 0.0*deg, 0.0*deg, 0.0*deg, 10.0*deg, 10.0*deg + + + 0.000, 0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696, + 0.783, 0.870, 0.957, 1.044, 1.131, 1.218, 1.305, 1.392, 1.479, + 1.566, 1.653, 1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500, + 2.650, 2.868, 3.000 + + + 12.50*cm, 16.90*cm, 20.10*cm, 24.00*cm, 28.60*cm, 34.00*cm, + 40.60*cm, 48.30*cm, 57.60*cm, 68.60*cm, 81.80*cm, 97.50*cm, + 116.20*cm, 130.00*cm + + + 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, + 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, + 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 10.0*deg, + 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, + 10.0*deg, 10.0*deg + + + 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, + 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 20.0*deg, + 20.0*deg + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4 + + + 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 16, 29, 1 + + + 16, 29, 41, 15 + + + 2, 3, 4, 4 + + + 1.392, 3.000, 5.500, 1.305 + + + 22.0*cm, 165.0*cm, 30.0*cm, 0.0*cm, 1115.0*cm, 0.375*cm, + 1137.0*cm + + + 15, 29, 4, 10, 5, 2, 4, 18, 19, 11, 12, 13, 14 + + + 0.5, 0.5 + + + 117.0, 117.0, 117.0, 217.0 + + + 0, 0, 0, 0 + + + 178.0, 178.0, 178.0, 0.000 + + + 0, 0, 0, 0 + + + 2.840, 2.090, 0.000, 0.000 + + + 0, 0, 0, 0 + + + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h b/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h index 6f0d335bc0eb3..3e2c32ad6a3f2 100644 --- a/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h +++ b/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h @@ -6,7 +6,6 @@ * this class reads the constant section of * the hcal-sim-numbering xml-file * - * $Date: 2013/12/25 00:06:50 $ * \author Sunanda Banerjee, SINP * */ @@ -56,14 +55,14 @@ class HcalDDDRecConstants { std::vector getEtaBins(const int itype) const; std::pair getEtaPhi(int subdet, int ieta, int iphi) const; std::pair getEtaRange(const int i) const - {return std::pair(hpar->etaMin[i],hpar->etaMax[i]);} - const std::vector & getEtaTable() const {return hpar->etaTable;} + {return std::pair(iEtaMin[i],iEtaMax[i]);} + const std::vector & getEtaTable() const {return etaTable;} const std::vector & getEtaTableHF() const {return hpar->etaTableHF;} std::pair getEtaLimit(const int i) const - {return std::pair(hpar->etaTable[i],hpar->etaTable[i+1]);} + {return std::pair(etaTable[i],etaTable[i+1]);} HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const; - int getMaxDepth(const int type) const {return hpar->maxDepth[type];} + int getMaxDepth(const int type) const {return maxDepth[type];} int getNEta() const {return hpar->etagroup.size();} double getPhiBin(const int i) const {return phibin[i];} double getPhiOff(const int i) const {return hpar->phioff[i];} @@ -86,7 +85,10 @@ class HcalDDDRecConstants { const HcalParameters *hpar; const HcalDDDSimConstants &hcons; std::vector > etaSimValu; // eta ranges at Sim stage + std::vector etaTable; // Eta table (HB+HE) std::vector ietaMap; // Map Sim level ieta to Rec level ieta + std::vector iEtaMin, iEtaMax; // Minimum and maximum eta + std::vector maxDepth; // Maximum depth in HB/HE/HF/HO std::vector phibin; // Phi step for all eta bins (HB, HE, HO) std::vector phiUnitS; // Phi unit at SIM stage std::vector > gconsHB; // Geometry constatnts HB diff --git a/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h b/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h index 666b6f3872304..af972196e8aeb 100644 --- a/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h +++ b/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h @@ -6,7 +6,6 @@ * this class reads the constant section of * the hcal-sim-numbering xml-file * - * $Date: 2013/12/25 00:06:50 $ * \author Sunanda Banerjee, SINP * */ @@ -37,11 +36,14 @@ class HcalDDDSimConstants { double getEtaHO(double& etaR, double& x, double& y, double& z) const; std::pair getiEtaRange(const int i) const {return std::pair(hpar->etaMin[i],hpar->etaMax[i]);} + const std::vector & getEtaTableHF() const {return hpar->etaTableHF;} unsigned int findLayer(int layer, const std::vector& layerGroup) const; const std::vector & getGparHF() const {return hpar->gparHF;} const std::vector & getLayer0Wt() const {return hpar->Layer0Wt;} std::pair getModHalfHBHE(const int type) const; std::pair getPhiCons(int det, int ieta); + const std::vector & getPhiTableHF() const {return hpar->phitable;} + const std::vector & getRTableHF() const {return hpar->rTable;} std::vector HcalCellTypes() const; std::vector HcalCellTypes(HcalSubdetector, int ieta=-1, int depth=-1) const; diff --git a/Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h b/Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h index 9f58f8863bdb1..4be86a1342647 100644 --- a/Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h +++ b/Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h @@ -5,23 +5,19 @@ #ifndef HcalNumberingFromDDD_h #define HcalNumberingFromDDD_h -#include "Geometry/HcalCommonData/interface/HcalCellType.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" -#include "DetectorDescription/Core/interface/DDsvalues.h" #include "CLHEP/Vector/ThreeVector.h" #include #include -class DDCompactView; -class DDFilteredView; - class HcalNumberingFromDDD { public: - HcalNumberingFromDDD(std::string & name, const DDCompactView & cpv); + HcalNumberingFromDDD(HcalDDDSimConstants * hcons); ~HcalNumberingFromDDD(); struct HcalID { @@ -36,66 +32,10 @@ class HcalNumberingFromDDD { int lay=-1) const; HcalID unitID(int det, int zside, int depth, int etaR, int phi, int lay=-1) const; - HcalCellType::HcalCell cell(int det, int zside, int depth, int etaR, - int iphi, bool corr=true) const; - std::vector getEtaTable() const; - unsigned int numberOfCells(HcalSubdetector) const; - std::vector HcalCellTypes() const; - std::vector HcalCellTypes(HcalSubdetector) const; - void printTile(); - -private: - - double getEta(int det, int etaR, int zside, int depth=1) const; - double getEta(double r, double z) const; - double deltaEta(int det, int eta, int depth) const; - void initialize(std::string & name, const DDCompactView & cpv); - void loadSpecPars(const DDFilteredView&); - void loadGeometry(const DDFilteredView&); - std::vector getDDDArray(const std::string &, const DDsvalues_type &, - int&) const; - int getShift(HcalSubdetector subdet, int depth) const; - double getGain (HcalSubdetector subdet, int depth) const; - unsigned find (int element, std::vector& array) const; - int unitPhi (int det, int etaR) const; - void tileHB(int eta, int depth); - void tileHE(int eta, int depth); - double getEtaHO(double& etaR, double& x, double& y, double& z) const; private: - std::vector phioff; // Phi offset for barrel, endcap, forward - std::vector etaTable; // Eta table - int nEta; // Number of bins in eta for HB and HE - std::vector rTable; // R-table - int nR; // Number of bins in r - std::vector etaMin; // Minimum eta bin number for HB/HE/HF - std::vector etaMax; // Maximum eta bin number for HB/HE/HF - std::vector phibin; // Phi step for all eta bins (HB, HE and HF) - int nPhi; // Number of bins in dphi - std::vector depth1; // Maximum layer number for depth 1 - std::vector depth2; // Maximum layer number for depth 2 - std::vector depth3; // Maximum layer number for depth 3 - int nDepth; // Number of bins in depth1/depth2/depth3 - std::vector gainHB; // Gain factor for HB - std::vector shiftHB; // Readout shift .. .. - std::vector gainHE; // Gain factor for HE - std::vector shiftHE; // Readout shift .. .. - std::vector gainHF; // Gain factor for HF - std::vector shiftHF; // Readout shift .. .. - double zVcal; // Z-position of the front of HF - double dzVcal; // Half length of the HF - double dlShort; // Diference of length between long and short - std::vector nOff; // Speical eta bin #'s in barrel and endcap - std::vector rHB, drHB; // Radial positions of HB layers - std::vector zHE, dzHE; // Z-positions of HE layers - std::vector zho; // Z-positions of HO layers - int nzHB, nmodHB; // Number of halves and modules in HB - int nzHE, nmodHE; // Number of halves and modules in HE - double etaHO[4], rminHO; // eta in HO ring boundaries - std::vector rhoxb, zxb, dyxb, dzxb; // Geometry parameters to - std::vector layb, laye; // get tile size for HB & HE - std::vector zxe, rhoxe, dyxe, dx1e, dx2e; // in different layers + HcalDDDSimConstants *hcalConstants; }; #endif diff --git a/Geometry/HcalCommonData/plugins/HcalDDDRecConstantsESMoudle.cc b/Geometry/HcalCommonData/plugins/HcalDDDRecConstantsESMoudle.cc index 93576d532a39e..036395fd15bce 100644 --- a/Geometry/HcalCommonData/plugins/HcalDDDRecConstantsESMoudle.cc +++ b/Geometry/HcalCommonData/plugins/HcalDDDRecConstantsESMoudle.cc @@ -33,7 +33,7 @@ #include #include -#define DebugLog +//#define DebugLog class HcalDDDRecConstantsESModule : public edm::ESProducer { diff --git a/Geometry/HcalCommonData/plugins/HcalParametersESModule.cc b/Geometry/HcalCommonData/plugins/HcalParametersESModule.cc index 34c308aaa7a0f..050932075fd54 100644 --- a/Geometry/HcalCommonData/plugins/HcalParametersESModule.cc +++ b/Geometry/HcalCommonData/plugins/HcalParametersESModule.cc @@ -40,8 +40,8 @@ void HcalParametersESModule::fillDescriptions( edm::ConfigurationDescriptions & HcalParametersESModule::ReturnType HcalParametersESModule::produce( const HcalParametersRcd& iRecord ) { - //edm::LogInfo("HcalParametersESModule") - std::cout << "HcalParametersESModule::produce(const HcalParametersRcd& iRecord)" << std::endl; + edm::LogInfo("HcalESModule") + << "HcalParametersESModule::produce(const HcalParametersRcd& iRecord)"; edm::ESTransientHandle cpv; iRecord.getRecord().get( cpv ); diff --git a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc index 732cc9385e57b..5377f7e10e0cb 100644 --- a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc @@ -31,14 +31,14 @@ HcalDDDRecConstants::getEtaBins(const int itype) const { std::vector bins; unsigned int type = (itype == 0) ? 0 : 1; unsigned int lymax = (type == 0) ? 17 : 19; - for (int ieta = hpar->etaMin[type]; ieta <= hpar->etaMax[type]; ++ieta) { + for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) { int nfi = (int)((20.001*nModule[itype]*CLHEP::deg)/phibin[ieta-1]); - HcalDDDRecConstants::HcalEtaBin etabin = HcalDDDRecConstants::HcalEtaBin(ieta,hpar->etaTable[ieta-1], hpar->etaTable[ieta], nfi, hpar->phioff[type], phibin[ieta-1]); + HcalDDDRecConstants::HcalEtaBin etabin = HcalDDDRecConstants::HcalEtaBin(ieta, etaTable[ieta-1], etaTable[ieta], nfi, hpar->phioff[type], phibin[ieta-1]); int dstart = -1; if (layerGroupSize( ieta-1 ) > 0) { int lmin(0), lmax(0); int dep = layerGroup( ieta-1, 0 ); - if (type == 1 && ieta == hpar->etaMin[type]) dep = 3; + if (type == 1 && ieta == iEtaMin[type]) dep = 3; unsigned lymx0 = (layerGroupSize( ieta-1 ) > lymax) ? lymax : layerGroupSize( ieta-1 ); for (unsigned int l=0; letaMax[type] && dep > 2) break; + if (type == 0 && ieta == iEtaMax[type] && dep > 2) break; } if (lmax >= lmin) { if (ieta+1 == hpar->noff[1]) { } else if (ieta == hpar->noff[1]) { - HcalDDDRecConstants::HcalEtaBin etabin0 = HcalDDDRecConstants::HcalEtaBin(ieta-1,hpar->etaTable[ieta-2], hpar->etaTable[ieta], nfi, hpar->phioff[type], phibin[ieta-1]); + HcalDDDRecConstants::HcalEtaBin etabin0 = HcalDDDRecConstants::HcalEtaBin(ieta-1, etaTable[ieta-2], etaTable[ieta], nfi, hpar->phioff[type], phibin[ieta-1]); etabin0.depthStart = dep; etabin0.layer.push_back(std::pair(lmin,lmax)); bins.push_back(etabin0); @@ -97,11 +97,11 @@ HcalDDDRecConstants::getEtaPhi(int subdet, int ieta, int iphi) const { (subdet == static_cast(HcalOuter))) { // Use Eta Table int unit = (int)(phibin[ietaAbs-1]/fiveDegInRad+0.5); int kphi = (unit == 2) ? ((iphi-1)/2 + 1) : iphi; - double foff = (ietaAbs <= hpar->etaMax[0]) ? hpar->phioff[0] : hpar->phioff[1]; - eta = 0.5*(hpar->etaTable[ietaAbs-1]+hpar->etaTable[ietaAbs]); + double foff = (ietaAbs <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1]; + eta = 0.5*(etaTable[ietaAbs-1]+etaTable[ietaAbs]); phi = foff + (kphi-0.5)*phibin[ietaAbs-1]; } else { - ietaAbs -= hpar->etaMin[3]; + ietaAbs -= iEtaMin[3]; int unit = (int)(hpar->phitable[ietaAbs-1]/fiveDegInRad+0.5); int kphi = (unit == 4) ? ((iphi-3)/4 + 1) : ((iphi-1)/2 + 1); double foff = (unit > 2) ? hpar->phioff[4] : hpar->phioff[2]; @@ -142,7 +142,7 @@ HcalDDDRecConstants::getHCID(int subdet, int ieta, int iphi, int lay, unit = hcons.unitPhi(phibin[eta-1]); phi = hcons.phiNumber(phi0,unit); depth = layerGroup( eta-1, lay-1 ); - if (eta == hpar->etaMin[1]) { + if (eta == iEtaMin[1]) { if (subdet == static_cast(HcalBarrel)) { if (depth > 2) depth = 2; } else { @@ -335,10 +335,22 @@ unsigned int HcalDDDRecConstants::nCells() const { void HcalDDDRecConstants::initialize(void) { + //Eta grouping + int nEta = (int)(hpar->etagroup.size()); + if (nEta != (int)(hpar->phigroup.size())) { + edm::LogError("HCalGeom") << "HcalDDDRecConstants: sizes of the vectors " + << " etaGroup (" << nEta << ") and phiGroup (" + << hpar->phigroup.size() << ") do not match"; + throw cms::Exception("DDException") << "HcalDDDRecConstants: inconsistent array sizes" << nEta << ":" << hpar->phigroup.size(); + } + // First eta table - ietaMap.clear(); etaSimValu.clear(); + iEtaMin = hpar->etaMin; + iEtaMax = hpar->etaMax; + etaTable.clear(); ietaMap.clear(); etaSimValu.clear(); int ieta(0), ietaHB(0), ietaHE(0); - for( unsigned int i=0; ietagroup.size(); ++i ) { + etaTable.push_back(hpar->etaTable[ieta]); + for (int i=0; ietagroup[i]); if (ieta >= (int)(hpar->etaTable.size())) { @@ -350,19 +362,20 @@ void HcalDDDRecConstants::initialize(void) { << " at index " << i << " of etaTable from SimConstant"; } else { + etaTable.push_back(hpar->etaTable[ieta]); etaSimValu.push_back(std::pair(ef,ieta)); } - for (int k=0; ketagroup[i]; ++k) ietaMap.push_back(i+1); + for (int k=0; k<(hpar->etagroup[i]); ++k) ietaMap.push_back(i+1); if (ieta <= hpar->etaMax[0]) ietaHB = i+1; if (ieta <= hpar->etaMin[1]) ietaHE = i+1; } - assert( hpar->etaMin[1] == ietaHE ); - assert( hpar->etaMax[0] == ietaHB ); + iEtaMin[1] = ietaHE; + iEtaMax[0] = ietaHB; // Then Phi bins ieta = 0; phibin.clear(); phiUnitS.clear(); - for (unsigned int i=0; ietagroup.size(); ++i) { + for (int i=0; iphigroup[i])*(hpar->phibin[ieta]); phibin.push_back(dphi); ieta += (hpar->etagroup[i]); @@ -373,9 +386,9 @@ void HcalDDDRecConstants::initialize(void) { } #ifdef DebugLog - std::cout << "Modified eta/deltaphi table for " << hpar->etagroup.size() << " bins" << std::endl; - for (unsigned int i=0; ietagroup.size(); ++i) - std::cout << "Eta[" << i << "] = " << hpar->etaTable[i] << ":" << hpar->etaTable[i+1] + std::cout << "Modified eta/deltaphi table for " << nEta << " bins" << std::endl; + for (int i=0; imaxDepth; + maxDepth[0] = maxDepth[1] = 0; + for (int i=0; i 0) ? layerGroup(i,imx-1) : 0; + if (i < iEtaMax[0]) { + int laymax0 = (imx > 16) ? layerGroup(i,16) : laymax; + if (i+1 == iEtaMax[0] && laymax0 > 2) laymax0 = 2; +#ifdef DebugLog + std::cout << "HB " << i << " " << imx << " " << laymax << " " << laymax0 << std::endl; +#endif + if (maxDepth[0] < laymax0) maxDepth[0] = laymax0; + } + if (i >= iEtaMin[1]-1 && i < iEtaMax[1]) { +#ifdef DebugLog + std::cout << "HE " << i << " " << imx << " " << laymax << std::endl; +#endif + if (maxDepth[1] < laymax) maxDepth[1] = laymax; + } + } +#ifdef DebugLog + for (int i=0; i<4; ++i) + std::cout << "Detector Type[" << i << "] iEta " << iEtaMin[i] << ":" + << iEtaMax[i] << " MaxDepth " << maxDepth[i] << std::endl; +#endif + //Now the geometry constants nModule[0] = hpar->modHB[0]; nHalves[0] = hpar->modHB[1]; @@ -420,6 +460,7 @@ void HcalDDDRecConstants::initialize(void) { << gconsHE[i].second << std::endl; #endif } + unsigned int HcalDDDRecConstants::layerGroupSize( unsigned int eta ) const { diff --git a/Geometry/HcalCommonData/src/HcalNumberingFromDDD.cc b/Geometry/HcalCommonData/src/HcalNumberingFromDDD.cc index 16b5592f8e498..aca7c642e4a47 100644 --- a/Geometry/HcalCommonData/src/HcalNumberingFromDDD.cc +++ b/Geometry/HcalCommonData/src/HcalNumberingFromDDD.cc @@ -3,13 +3,9 @@ // Description: Usage of DDD to get to numbering scheme for hadron calorimeter /////////////////////////////////////////////////////////////////////////////// +#include "CondFormats/GeometryObjects/interface/HcalParameters.h" #include "Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h" -#include "DetectorDescription/Core/interface/DDFilter.h" -#include "DetectorDescription/Core/interface/DDFilteredView.h" -#include "DetectorDescription/Core/interface/DDSolid.h" -#include "DetectorDescription/Core/interface/DDValue.h" - #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "CLHEP/Units/GlobalPhysicalConstants.h" @@ -18,10 +14,9 @@ //#define DebugLog -HcalNumberingFromDDD::HcalNumberingFromDDD(std::string & name, - const DDCompactView & cpv) { +HcalNumberingFromDDD::HcalNumberingFromDDD(HcalDDDSimConstants *hcons) : + hcalConstants(hcons) { edm::LogInfo("HCalGeom") << "Creating HcalNumberingFromDDD"; - initialize(name, cpv); } HcalNumberingFromDDD::~HcalNumberingFromDDD() { @@ -55,7 +50,7 @@ HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID(int det, etaR = heta; if (det == 3) { hsubdet = static_cast(HcalBarrel); - if (zho.size() > 4) etaR = getEtaHO(heta,hx,hy,hz); + etaR = hcalConstants->getEtaHO(heta,hx,hy,hz); } else { hsubdet = static_cast(HcalEndcap); } @@ -63,39 +58,17 @@ HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID(int det, #ifdef DebugLog LogDebug("HCalGeom") << "HcalNumberingFromDDD: point = " << point << " det " - << hsubdet << " eta/R " << etaR << " phi " << hphi; + << det << ":" << hsubdet << " eta/R " << etaR << " phi " + << hphi; #endif - HcalNumberingFromDDD::HcalID tmp = unitID(hsubdet,etaR,hphi,depth,lay); - return tmp; - + return unitID(hsubdet,etaR,hphi,depth,lay); } HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID(double eta,double fi, int depth, int lay) const { - - int ieta = 0; - double heta = fabs(eta); - for (int i = 0; i < nEta; i++) - if (heta > etaTable[i]) ieta = i + 1; - int hsubdet=0; - double etaR; - if (ieta <= etaMin[1]) { - if ((ieta <= etaMin[1] && depth==3) || ieta > etaMax[0]) { - hsubdet = static_cast(HcalEndcap); - } else { - hsubdet = static_cast(HcalBarrel); - } - etaR = eta; - } else { - hsubdet = static_cast(HcalForward); - double theta = 2.*atan(exp(-heta)); - double hR = zVcal*tan(theta); - etaR = (eta >= 0. ? hR : -hR); - } - - HcalNumberingFromDDD::HcalID tmp = unitID(hsubdet,etaR,fi,depth,lay); - return tmp; + std::pair detEta = hcalConstants->getDetEta(eta, depth); + return unitID(detEta.first,detEta.second,fi,depth,lay); } @@ -105,52 +78,23 @@ HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID(int det, int depth, int lay) const { - int ieta=0; - double fioff, fibin; double hetaR = fabs(etaR); + int ieta = hcalConstants->getEta(det, lay, hetaR); + std::pair ficons = hcalConstants->getPhiCons(det, ieta); - //First eta index - if (det == static_cast(HcalForward)) { // Forward HCal - fioff = phioff[2]; - ieta = etaMax[2]; - for (int i = nR-1; i > 0; i--) - if (hetaR < rTable[i]) ieta = etaMin[2] + nR - i - 1; - fibin = phibin[nEta+ieta-etaMin[2]-1]; - if (ieta > etaMax[2]-2 ) { // HF double-phi - fioff += 0.5*fibin; - } - } else { // Barrel or Endcap - ieta = 1; - for (int i = 0; i < nEta-1; i++) - if (hetaR > etaTable[i]) ieta = i + 1; - if (det == static_cast(HcalBarrel)) { - fioff = phioff[0]; - if (ieta > etaMax[0]) ieta = etaMax[0]; - if (lay == 18 && nOff.size() > 13) { - if (hetaR > etaHO[1] && ieta == nOff[13]) ieta++; - } - } else { - fioff = phioff[1]; - if (ieta <= etaMin[1]) ieta = etaMin[1]; - } - fibin = phibin[ieta-1]; - } - - int nphi = int((CLHEP::twopi+0.1*fibin)/fibin); + int nphi = int((CLHEP::twopi+0.1*ficons.second)/ficons.second); int zside = etaR>0 ? 1: 0; - double hphi = phi+fioff; + double hphi = phi+ficons.first; if (hphi < 0) hphi += CLHEP::twopi; - int iphi = int(hphi/fibin) + 1; + int iphi = int(hphi/ficons.second) + 1; if (iphi > nphi) iphi = 1; #ifdef DebugLog LogDebug("HCalGeom") << "HcalNumberingFromDDD: etaR = " << etaR << " : " - << zside << "/" << ieta << " phi " << hphi << " : " - << iphi; + << zside << "/" << ieta << " phi " << hphi << " : " + << iphi; #endif - HcalNumberingFromDDD::HcalID tmp = unitID(det,zside,depth,ieta,iphi,lay); - return tmp; - + return unitID(det,zside,depth,ieta,iphi,lay); } HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID(int det, int zside, @@ -158,1171 +102,26 @@ HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID(int det, int zside, int phi, int lay) const { - //Modify the depth index - if (det == static_cast(HcalForward)) { // Forward HCal - } else { - if (lay >= 0) { - double fibin = phibin[etaR-1]; - int depth0 = depth1[etaR-1]; - int kphi = phi + int((phioff[3]+0.1)/fibin); - kphi = (kphi-1)%4 + 1; - if (etaR == nOff[0] && (kphi == 2 || kphi == 3)) depth0--; - if (lay <= depth2[etaR-1]) { - if (lay <= depth0) depth = 1; - else depth = 2; - } else if (lay <= depth3[etaR-1]) { - depth = 3; - } else depth = 4; - } else if (det == static_cast(HcalBarrel)) { - if (depth==3) depth = 2; - } - if (det != static_cast(HcalBarrel)) { - if (etaR <= etaMin[1]) depth = 3; - } - } - if (etaR == nOff[1] && depth > 2 && det == static_cast(HcalEndcap)) - etaR = nOff[1]-1; - if (det == static_cast(HcalBarrel) && depth == 4) { + + std::pair etaDepth = hcalConstants->getEtaDepth(det, etaR, phi, depth, lay); + if (det == static_cast(HcalBarrel) && etaDepth.second == 4) { det = static_cast(HcalOuter); } - int units = unitPhi(det, etaR); - int iphi_skip = phi; - if (units==2) iphi_skip = (phi-1)*2+1; - else if (units==4) iphi_skip = (phi-1)*4-1; - if (iphi_skip < 0) iphi_skip += 72; + int units = hcalConstants->unitPhi(det, etaDepth.first); + int iphi_skip = hcalConstants->phiNumber(phi, units); #ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: phi units=" << units - << " iphi_skip=" << iphi_skip; + LogDebug("HCalGeom") << "HcalNumberingFromDDD: phi units= " << units + << " iphi_skip= " << iphi_skip; #endif - HcalNumberingFromDDD::HcalID tmp(det,zside,depth,etaR,phi,iphi_skip,lay); + HcalNumberingFromDDD::HcalID tmp(det,zside,etaDepth.second,etaDepth.first,phi,iphi_skip,lay); #ifdef DebugLog LogDebug("HCalGeom") << "HcalNumberingFromDDD: det = " << det << " " - << tmp.subdet << " zside = " << tmp.zside << " depth = " - << tmp.depth << " eta/R = " << tmp.etaR << " phi = " - << tmp.phi << " layer = " << tmp.lay; -#endif - return tmp; -} - -HcalCellType::HcalCell HcalNumberingFromDDD::cell(int det, int zside, - int depth, int etaR, - int iphi, bool corr) const { - - int idet = det; - double etaMn = etaMin[0]; - double etaMx = etaMax[0]; - if (idet==static_cast(HcalEndcap)) { - etaMn = etaMin[1]; etaMx = etaMax[1]; - } else if (idet==static_cast(HcalForward)) { - etaMn = etaMin[2]; etaMx = etaMax[2]; - } - if (corr) { - if (etaR >= nOff[2] && depth == 3 && idet == static_cast(HcalBarrel)) - idet = static_cast(HcalEndcap); - } - double eta = 0, deta = 0, phi = 0, dphi = 0, rz = 0, drz = 0; - bool ok = false, flagrz = true; - if ((idet==static_cast(HcalBarrel)||idet==static_cast(HcalEndcap)|| - idet==static_cast(HcalOuter)||idet==static_cast(HcalForward)) - && etaR >=etaMn && etaR <= etaMx) - ok = true; - if (idet == static_cast(HcalEndcap)) { - if (depth < 3 && etaR <= etaMin[1]) ok = false; - else if (depth > 2 && etaR == nOff[1]) ok = false; - } - if (ok) { - int maxlay = (int)(rHB.size()); - if (idet == static_cast(HcalEndcap)) maxlay = (int)(zHE.size()); - eta = getEta(idet, etaR, zside, depth); - deta = deltaEta(idet, etaR, depth); - double fibin, fioff; - if (idet == static_cast(HcalBarrel)|| - idet == static_cast(HcalOuter)) { - fioff = phioff[0]; - fibin = phibin[etaR-1]; - } else if (idet == static_cast(HcalEndcap)) { - fioff = phioff[1]; - fibin = phibin[etaR-1]; - } else { - fioff = phioff[2]; - fibin = phibin[nEta+etaR-etaMin[2]-1]; - if (etaR > etaMax[2]-2 ) fioff += 0.5*fibin; - } - phi = fioff + (iphi - 0.5)*fibin; - dphi = 0.5*fibin; - if (idet == static_cast(HcalForward)) { - int ir = nR + etaMin[2] - etaR - 1; - if (ir > 0 && ir < nR) { - rz = 0.5*(rTable[ir]+rTable[ir-1]); - drz = 0.5*(rTable[ir]-rTable[ir-1]); - } else { - ok = false; -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: wrong eta " << etaR - << " (" << ir << "/" << nR << ") Detector " - << idet; -#endif - } - if (depth != 1 && depth != 2) { - ok = false; -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: wrong depth " << depth - << " in Detector " << idet; -#endif - } - } else if (etaR <= nEta) { - int depth0 = depth1[etaR-1]; - int kphi = iphi + int((phioff[3]+0.1)/fibin); - kphi = (kphi-1)%4 + 1; - if (etaR == nOff[0] && (kphi == 2 || kphi == 3)) depth0--; - int laymin, laymax; - if (depth == 1) { - laymin = 1; - if (idet==static_cast(HcalEndcap)) laymin = 2; - laymax = depth0; - if (nOff.size() > 12) { - if (etaR == nOff[6]) { - laymin = nOff[7]; - laymax = nOff[8]; - } else if (etaR == nOff[9]) { - laymin = nOff[10]; - } - } - } else if (depth == 2) { - laymin = depth0+1; - laymax = depth2[etaR-1]; - if (etaR==etaMax[0] && idet==static_cast(HcalBarrel) && - nOff.size()>3) laymax = nOff[3]; - if (nOff.size() > 12) { - if (etaR == nOff[9]) laymax = nOff[11]; - if (etaR == nOff[6]) laymax = nOff[12]; - } - } else if (depth == 3) { - laymin = depth2[etaR-1]+1; - laymax = depth3[etaR-1]; - if (etaR<=etaMin[1] && idet==static_cast(HcalEndcap)) { - if (nOff.size() > 4) laymin = nOff[4]; - if (nOff.size() > 5) laymax = nOff[5]; - } - } else { - laymin = depth3[etaR-1]+1; - laymax = maxlay; - } - if (idet == static_cast(HcalOuter) && nOff.size() > 13) { - if (etaR > nOff[13] && laymin <= laymax) laymin = laymax; - } - double d1=0, d2=0; - if (laymin <= maxlay && laymax <= maxlay && laymin <= laymax) { - if (idet == static_cast(HcalEndcap)) { - flagrz = false; - if (depth == 1 || laymin <= 1) d1 = zHE[laymin-1] - dzHE[laymin-1]; - else d1 = zHE[laymin-2] + dzHE[laymin-2]; - d2 = zHE[laymax-1] + dzHE[laymax-1]; - } else { - if (idet == static_cast(HcalOuter) || - depth == 1 || laymin <=1) d1 = rHB[laymin-1] - drHB[laymin-1]; - else d1 = rHB[laymin-2] + drHB[laymin-1]; - d2 = rHB[laymax-1] + drHB[laymax-1]; - } - rz = 0.5*(d2+d1); - drz = 0.5*(d2-d1); - } else { - ok = false; -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: wrong depth " << depth - << " (Layer minimum " << laymin << " maximum " - << laymax << " maxLay " << maxlay << ")"; -#endif - } - } else { - ok = false; -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: wrong eta " << etaR - << "/" << nEta << " Detector " << idet; -#endif - } - } else { - ok = false; -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: wrong eta " << etaR - << " det " << idet; -#endif - } - HcalCellType::HcalCell tmp(ok,eta,deta,phi,dphi,rz,drz,flagrz); - -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: det/side/depth/etaR/phi " - << det << "/" << zside << "/" << depth << "/" << etaR - << "/" << iphi << " Cell Flag " << tmp.ok << " " - << tmp.eta << " " << tmp.deta << " phi " << tmp.phi - << " " << tmp.dphi << " r(z) " << tmp.rz << " " - << tmp.drz << " " << tmp.flagrz; -#endif - return tmp; -} - -std::vector HcalNumberingFromDDD::getEtaTable() const { - - std::vector tmp = etaTable; - return tmp; -} - -unsigned int HcalNumberingFromDDD::numberOfCells(HcalSubdetector subdet) const{ - - unsigned int num = 0; - std::vector cellTypes = HcalCellTypes(subdet); - for (unsigned int i=0; i 1) - num += (unsigned int)(cellTypes[i].nPhiBins()); - num -= (unsigned int)(cellTypes[i].nPhiMissingBins()); - } -#ifdef DebugLog - LogDebug ("HCalGeom") << "HcalNumberingFromDDD:numberOfCells " - << cellTypes.size() << " " << num - << " for subdetector " << subdet; -#endif - return num; -} - -std::vector HcalNumberingFromDDD::HcalCellTypes() const{ - - std::vector cellTypes =HcalCellTypes(HcalBarrel); -#ifdef DebugLog - LogDebug ("HCalGeom") << "HcalNumberingFromDDD: " << cellTypes.size() - << " cells of type HCal Barrel"; - for (unsigned int i=0; i hoCells =HcalCellTypes(HcalOuter); -#ifdef DebugLog - LogDebug ("HCalGeom") << "HcalNumberingFromDDD: " << hoCells.size() - << " cells of type HCal Outer"; - for (unsigned int i=0; i heCells =HcalCellTypes(HcalEndcap); -#ifdef DebugLog - LogDebug ("HCalGeom") << "HcalNumberingFromDDD: " << heCells.size() - << " cells of type HCal Endcap"; - for (unsigned int i=0; i hfCells =HcalCellTypes(HcalForward); -#ifdef DebugLog - LogDebug ("HCalGeom") << "HcalNumberingFromDDD: " << hfCells.size() - << " cells of type HCal Forward"; - for (unsigned int i=0; i HcalNumberingFromDDD::HcalCellTypes(HcalSubdetector subdet) const { - - std::vector cellTypes; - if (subdet == HcalForward) { - if (dzVcal < 0) return cellTypes; - } - - int dmin, dmax, indx, nz, nmod; - double hsize = 0; - switch(subdet) { - case HcalEndcap: - dmin = 1; dmax = 3; indx = 1; nz = nzHE; nmod = nmodHE; - break; - case HcalForward: - dmin = 1; dmax = 2; indx = 2; nz = 2; nmod = 18; - break; - case HcalOuter: - dmin = 4; dmax = 4; indx = 0; nz = nzHB; nmod = nmodHB; - break; - default: - dmin = 1; dmax = 3; indx = 0; nz = nzHB; nmod = nmodHB; - break; - } - - int phi = 1, zside = 1; - bool cor = false; - - // Get the Cells - int subdet0 = static_cast(subdet); - for (int depth=dmin; depth<=dmax; depth++) { - int shift = getShift(subdet, depth); - double gain = getGain (subdet, depth); - if (subdet == HcalForward) { - if (depth == 1) hsize = dzVcal; - else hsize = dzVcal-0.5*dlShort; - } - for (int eta=etaMin[indx]; eta<= etaMax[indx]; eta++) { - HcalCellType::HcalCell temp1 = cell(subdet0,zside,depth,eta,phi,cor); - if (temp1.ok) { - int units = unitPhi (subdet0, eta); - HcalCellType temp2(subdet, eta, phi, depth, temp1, - shift, gain, nz, nmod, hsize, units); - if (subdet == HcalOuter && nOff.size() > 17) { - if (eta == nOff[15]) { - std::vector missPlus, missMinus; - int kk = 18; - for (int miss=0; miss 18) { - dmax = 1; - } else if (depth2[eta-1] > 18) { - dmax = 2; - } - for (int depth=dmin; depth<=dmax; depth++) - tileHE(eta, depth); - } -} - -double HcalNumberingFromDDD::getEta(int det, int etaR, int zside, - int depth) const { - - double tmp = 0; - if (det == static_cast(HcalForward)) { - int ir = nR + etaMin[2] - etaR - 1; - if (ir > 0 && ir < nR) { - double z = zVcal; - if (depth != 1) z += dlShort; - tmp = 0.5*(getEta(rTable[ir-1],z)+getEta(rTable[ir],z)); - } - } else { - if (etaR > 0 && etaR < nEta) { - if (etaR == nOff[1]-1 && depth > 2) { - tmp = 0.5*(etaTable[etaR+1]+etaTable[etaR-1]); - } else if (det == static_cast(HcalOuter) && nOff.size() > 13) { - if (etaR == nOff[13]) { - tmp = 0.5*(etaHO[0]+etaTable[etaR-1]); - } else if (etaR == nOff[13]+1) { - tmp = 0.5*(etaTable[etaR]+etaHO[1]); - } else if (etaR == nOff[14]) { - tmp = 0.5*(etaHO[2]+etaTable[etaR-1]); - } else if (etaR == nOff[14]+1) { - tmp = 0.5*(etaTable[etaR]+etaHO[3]); - } else { - tmp = 0.5*(etaTable[etaR]+etaTable[etaR-1]); - } - } else { - tmp = 0.5*(etaTable[etaR]+etaTable[etaR-1]); - } - } - } - if (zside == 0) tmp = -tmp; -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD::getEta " << etaR << " " - << zside << " " << depth << " ==> " << tmp; + << tmp.subdet << " zside = " << tmp.zside << " depth = " + << tmp.depth << " eta/R = " << tmp.etaR << " phi = " + << tmp.phi << " layer = " << tmp.lay; #endif return tmp; } - -double HcalNumberingFromDDD::getEta(double r, double z) const { - - double tmp = 0; - if (z != 0) tmp = -log(tan(0.5*atan(r/z))); -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD::getEta " << r << " " << z - << " ==> " << tmp; -#endif - return tmp; -} - -double HcalNumberingFromDDD::deltaEta(int det, int etaR, int depth) const { - - double tmp = 0; - if (det == static_cast(HcalForward)) { - int ir = nR + etaMin[2] - etaR - 1; - if (ir > 0 && ir < nR) { - double z = zVcal; - if (depth != 1) z += dlShort; - tmp = 0.5*(getEta(rTable[ir-1],z)-getEta(rTable[ir],z)); - } - } else { - if (etaR > 0 && etaR < nEta) { - if (etaR == nOff[1]-1 && depth > 2) { - tmp = 0.5*(etaTable[etaR+1]-etaTable[etaR-1]); - } else if (det == static_cast(HcalOuter) && nOff.size() > 13) { - if (etaR == nOff[13]) { - tmp = 0.5*(etaHO[0]-etaTable[etaR-1]); - } else if (etaR == nOff[13]+1) { - tmp = 0.5*(etaTable[etaR]-etaHO[1]); - } else if (etaR == nOff[14]) { - tmp = 0.5*(etaHO[2]-etaTable[etaR-1]); - } else if (etaR == nOff[14]+1) { - tmp = 0.5*(etaTable[etaR]-etaHO[3]); - } else { - tmp = 0.5*(etaTable[etaR]-etaTable[etaR-1]); - } - } else { - tmp = 0.5*(etaTable[etaR]-etaTable[etaR-1]); - } - } - } -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD::deltaEta " << etaR << " " - << depth << " ==> " << tmp; -#endif - return tmp; -} - -void HcalNumberingFromDDD::initialize(std::string & name, - const DDCompactView & cpv) { - - std::string attribute = "ReadOutName"; - edm::LogInfo("HCalGeom") << "HcalNumberingFromDDD: Initailise for " << name - << " as " << attribute; - - DDSpecificsFilter filter; - DDValue ddv(attribute,name,0); - filter.setCriteria(ddv,DDCompOp::equals); - DDFilteredView fv(cpv); - fv.addFilter(filter); - bool ok = fv.firstChild(); - - if (ok) { - //Load the SpecPars - loadSpecPars(fv); - - //Load the Geometry parameters - loadGeometry(fv); - } else { - edm::LogError("HCalGeom") << "HcalNumberingFromDDD: cannot get filtered " - << " view for " << attribute << " matching " - << name; - throw cms::Exception("DDException") << "HcalNumberingFromDDD: cannot match " << attribute << " to " << name; - } - -#ifdef DebugLog - std::vector cellTypes = HcalCellTypes(); - LogDebug ("HCalGeom") << "HcalNumberingFromDDD: " << cellTypes.size() - << " cells of type HCal (All)"; - for (unsigned int i=0; i tmp1 = getDDDArray("phioff",sv,nphi); - phioff.resize(tmp1.size()); - for (i=0; i d2 = getDDDArray("depth2",sv,nDepth); - nDepth = nEta - 1; - std::vector d3 = getDDDArray("depth3",sv,nDepth); -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: " << nDepth << " Depths"; -#endif - depth1.resize(nDepth); - depth2.resize(nDepth); - depth3.resize(nDepth); - for (i=0; i(d1[i]); - depth2[i] = static_cast(d2[i]); - depth3[i] = static_cast(d3[i]); -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: depth1[" << i << "] = " - << depth1[i] << " depth2[" << i << "] = "<< depth2[i] - << " depth3[" << i << "] = " << depth3[i]; -#endif - } - - // Minimum and maximum eta boundaries - int ndx = 3; - std::vector tmp5 = getDDDArray("etaMin",sv,ndx); - std::vector tmp6 = getDDDArray("etaMax",sv,ndx); - etaMin.resize(ndx); - etaMax.resize(ndx); - for (i=0; i(tmp5[i]); - etaMax[i] = static_cast(tmp6[i]); - } - etaMin[0] = 1; - etaMax[1] = nEta-1; - etaMax[2] = etaMin[2]+nR-2; -#ifdef DebugLog - for (i=0; i nvec = getDDDArray("noff",sv,noff); - nOff.resize(noff); - for (i=0; i(nvec[i]); -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD: nOff[" << i << "] = " - << nOff[i]; -#endif - } - - //Gains and Shifts for HB depths - ndx = 4; - gainHB = getDDDArray("HBGains",sv,ndx); - std::vector tmp7 = getDDDArray("HBShift",sv,ndx); - shiftHB.resize(ndx); -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD:: Gain factor and Shift for " - << "HB depth layers:"; -#endif - for (i=0; i(tmp7[i]); -#ifdef DebugLog - LogDebug("HCalGeom") <<"HcalNumberingFromDDD:: gainHB[" << i << "] = " - << gainHB[i] << " shiftHB[" << i << "] = " - << shiftHB[i]; -#endif - } - - //Gains and Shifts for HB depths - ndx = 4; - gainHE = getDDDArray("HEGains",sv,ndx); - std::vector tmp8 = getDDDArray("HEShift",sv,ndx); - shiftHE.resize(ndx); -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD:: Gain factor and Shift for " - << "HE depth layers:"; -#endif - for (i=0; i(tmp8[i]); -#ifdef DebugLog - LogDebug("HCalGeom") <<"HcalNumberingFromDDD:: gainHE[" << i << "] = " - << gainHE[i] << " shiftHE[" << i << "] = " - << shiftHE[i]; -#endif - } - - //Gains and Shifts for HF depths - ndx = 4; - gainHF = getDDDArray("HFGains",sv,ndx); - std::vector tmp9 = getDDDArray("HFShift",sv,ndx); - shiftHF.resize(ndx); -#ifdef DebugLog - LogDebug("HCalGeom") << "HcalNumberingFromDDD:: Gain factor and Shift for " - << "HF depth layers:"; -#endif - for (i=0; i(tmp9[i]); -#ifdef DebugLog - LogDebug("HCalGeom") <<"HcalNumberingFromDDD:: gainHF[" << i << "] = " - << gainHF[i] << " shiftHF[" << i << "] = " - << shiftHF[i]; -#endif - } -} - -void HcalNumberingFromDDD::loadGeometry(const DDFilteredView& _fv) { - - DDFilteredView fv = _fv; - bool dodet=true, hf=false; - std::vector rb(20,0.0), ze(20,0.0), thkb(20,-1.0), thke(20,-1.0); - std::vector ib(20,0), ie(20,0); - std::vector izb, phib, ize, phie, izf, phif; - std::vector rxb; - rhoxb.clear(); zxb.clear(); dyxb.clear(); dzxb.clear(); - layb.clear(); laye.clear(); - zxe.clear(); rhoxe.clear(); dyxe.clear(); dx1e.clear(); dx2e.clear(); - double zf = 0; - dzVcal = -1.; - - while (dodet) { - DDTranslation t = fv.translation(); - std::vector copy = fv.copyNumbers(); - const DDSolid & sol = fv.logicalPart().solid(); - int idet = 0, lay = -1; - int nsiz = (int)(copy.size()); - if (nsiz>0) lay = copy[nsiz-1]/10; - if (nsiz>1) idet = copy[nsiz-2]/1000; - double dx=0, dy=0, dz=0, dx1=0, dx2=0; - if (sol.shape() == 1) { - const DDBox & box = static_cast(fv.logicalPart().solid()); - dx = box.halfX(); - dy = box.halfY(); - dz = box.halfZ(); - } else if (sol.shape() == 3) { - const DDTrap & trp = static_cast(fv.logicalPart().solid()); - dx1= trp.x1(); - dx2= trp.x2(); - dx = 0.25*(trp.x1()+trp.x2()+trp.x3()+trp.x4()); - dy = 0.5*(trp.y1()+trp.y2()); - dz = trp.halfZ(); - } else if (sol.shape() == 2) { - const DDTubs & tub = static_cast(fv.logicalPart().solid()); - dx = tub.rIn(); - dy = tub.rOut(); - dz = tub.zhalf(); - } - if (idet == 3) { - // HB -#ifdef DebugLog - LogDebug("HCalGeom") << "HB " << sol.name() << " Shape " << sol.shape() - << " Layer " << lay << " R " << t.Rho(); -#endif - if (lay >=0 && lay < 20) { - ib[lay]++; - rb[lay] += t.Rho(); - if (thkb[lay] <= 0) { - if (lay < 17) thkb[lay] = dx; - else thkb[lay] = std::min(dx,dy); - } - if (lay < 17) { - bool found = false; - for (unsigned int k=0; k2) ifi = copy[nsiz-3]; - if (nsiz>3) ich = copy[nsiz-4]; - double z1 = std::abs((t.z()) + dz); - double z2 = std::abs((t.z()) - dz); - if (std::abs(z1-z2) < 0.01) z1 = 0; - if (ifi == 1 && ich == 4) { - if (z1 > z2) { - double tmp = z1; - z1 = z2; - z2 = tmp; - } - bool sok = true; - for (unsigned int kk=0; kkkk+1; kz=kz-2) { - zho[kz] = zho[kz-2]; - zho[kz-1] = zho[kz-3]; - } - zho[kk+1] = z2; - zho[kk] = z1; - sok = false; - break; - } - } - if (sok) { - zho.push_back(z1); - zho.push_back(z2); - } -#ifdef DebugLog - LogDebug("HCalGeom") << "Detector " << idet << " Lay " << lay << " fi " << ifi << " " << ich << " z " << z1 << " " << z2; -#endif - } - } - } else if (idet == 4) { - // HE -#ifdef DebugLog - LogDebug("HCalGeom") << "HE " << sol.name() << " Shape " << sol.shape() - << " Layer " << lay << " Z " << t.z(); -#endif - if (lay >=0 && lay < 20) { - ie[lay]++; - ze[lay] += std::abs(t.z()); - if (thke[lay] <= 0) thke[lay] = dz; - bool found = false; - for (unsigned int k=0; k & paras = sol.parameters(); -#ifdef DebugLog - LogDebug("HCalGeom") << "HF " << sol.name() << " Shape " << sol.shape() - << " Z " << t.z() << " with " << paras.size() - << " Parameters"; - for (unsigned j=0; j0) { - rb[i] /= (double)(ib[i]); - ibmx = i+1; - } - if (ie[i]>0) { - ze[i] /= (double)(ie[i]); - iemx = i+1; - } -#ifdef DebugLog - LogDebug("HCalGeom") << "Index " << i << " Barrel " << ib[i] << " " - << rb[i] << " Endcap " << ie[i] << " " << ze[i]; -#endif - } - for (int i = 4; i >= 0; i--) { - if (ib[i] == 0) {rb[i] = rb[i+1]; thkb[i] = thkb[i+1];} - if (ie[i] == 0) {ze[i] = ze[i+1]; thke[i] = thke[i+1];} -#ifdef DebugLog - if (ib[i] == 0 || ie[i] == 0) - LogDebug("HCalGeom") << "Index " << i << " Barrel " << ib[i] << " " - << rb[i] << " Endcap " << ie[i] << " " << ze[i]; -#endif - } - -#ifdef DebugLog - for (unsigned int k=0; k 0) { - rHB.resize(ibmx); - drHB.resize(ibmx); - for (int i=0; i & fvec = value.doubles(); - int nval = fvec.size(); - if (nmin > 0) { - if (nval < nmin) { - edm::LogError("HCalGeom") << "HcalNumberingFromDDD : # of " << str - << " bins " << nval << " < " << nmin - << " ==> illegal"; - throw cms::Exception("DDException") << "HcalNumberingFromDDD: cannot get array " << str; - } - } else { - if (nval < 2) { - edm::LogError("HCalGeom") << "HcalNumberingFromDDD : # of " << str - << " bins " << nval << " < 2 ==> illegal" - << " (nmin=" << nmin << ")"; - throw cms::Exception("DDException") << "HcalNumberingFromDDD: cannot get array " << str; - } - } - nmin = nval; - return fvec; - } else { - edm::LogError("HCalGeom") << "HcalNumberingFromDDD: cannot get array " - << str; - throw cms::Exception("DDException") << "HcalNumberingFromDDD: cannot get array " << str; - } -} - -int HcalNumberingFromDDD::getShift(HcalSubdetector subdet, int depth) const { - - int shift; - switch(subdet) { - case HcalEndcap: - shift = shiftHE[depth-1]; - break; - case HcalForward: - shift = shiftHF[depth-1]; - break; - default: - shift = shiftHB[depth-1]; - break; - } - return shift; -} - -double HcalNumberingFromDDD::getGain(HcalSubdetector subdet, int depth) const { - - double gain; - switch(subdet) { - case HcalEndcap: - gain = gainHE[depth-1]; - break; - case HcalForward: - gain = gainHF[depth-1]; - break; - default: - gain = gainHB[depth-1]; - break; - } - return gain; -} - -unsigned int HcalNumberingFromDDD::find(int element, - std::vector& array) const { - - unsigned int id = array.size(); - for (unsigned int i = 0; i < array.size(); i++) { - if (element == array[i]) { - id = i; - break; - } - } - return id; -} - -int HcalNumberingFromDDD::unitPhi(int det, int etaR) const { - - const double fiveDegInRad = 2*M_PI/72; - int units=0; - if (det == static_cast(HcalForward)) - units=int(phibin[nEta+etaR-etaMin[2]-1]/fiveDegInRad+0.5); - else - units=int(phibin[etaR-1]/fiveDegInRad+0.5); - - return units; -} - -void HcalNumberingFromDDD::tileHB(int eta, int depth) { - - double etaL = etaTable[eta-1]; - double thetaL = 2.*atan(exp(-etaL)); - double etaH = etaTable[eta]; - double thetaH = 2.*atan(exp(-etaH)); - int layL=0, layH=0; - if (depth == 1) { - layH = depth1[eta-1]; - } else { - layL = depth1[eta-1]; - layH = depth2[eta-1]; - } - std::cout << "\ntileHB:: eta|depth " << eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << "\n"; - for (int lay=layL; lay area(2,0); - int kk=0; - for (unsigned int k=0; k 0) { - area[kk] = dz*dyxb[k]; - kk++; - } - } - } - if (area[0] > 0) std::cout << std::setw(2) << lay << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n"; - } -} - -void HcalNumberingFromDDD::tileHE(int eta, int depth) { - - double etaL = etaTable[eta-1]; - double thetaL = 2.*atan(exp(-etaL)); - double etaH = etaTable[eta]; - double thetaH = 2.*atan(exp(-etaH)); - int layL=0, layH=0; - if (eta == 16) { - layH = depth3[eta-1]; - } else if (depth == 1) { - layH = depth1[eta-1]; - } else if (depth == 2) { - layL = depth1[eta-1]; - layH = depth2[eta-1]; - } else { - layL = depth2[eta-1]; - layH = depth3[eta-1]; - } - double phib = phibin[eta-1]; - int nphi = 2; - if (phib > 6*CLHEP::deg) nphi = 1; - std::cout << "\ntileHE:: Eta/depth " << eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << " phi " << nphi << "\n"; - for (int lay=layL; lay area(4,0); - int kk=0; - for (unsigned int k=0; k 1000) || (eta != 18 && rhoxe[k]-dyxe[k] < 1000)) && - rmin+30 < rhoxe[k]+dyxe[k] && rmax > rhoxe[k]-dyxe[k]) { - rmin = std::max(rmin,rhoxe[k]-dyxe[k]); - rmax = std::min(rmax,rhoxe[k]+dyxe[k]); - double dx1 = rmin*std::tan(phib); - double dx2 = rmax*std::tan(phib); - double ar1=0, ar2=0; - if (nphi == 1) { - ar1 = 0.5*(rmax-rmin)*(dx1+dx2-4.*dx1e[k]); - } else { - ar1 = 0.5*(rmax-rmin)*(dx1+dx2-2.*dx1e[k]); - ar2 = 0.5*(rmax-rmin)*((rmax+rmin)*tan(10.*CLHEP::deg)-4*dx1e[k])-ar1; - } - area[kk] = ar1; - area[kk+2] = ar2; - kk++; - } - } - } - if (area[0] > 0 && area[1] > 0) { - int lay0 = lay-1; - if (eta == 18) lay0++; - if (nphi == 1) { - std::cout << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n"; - } else { - std::cout << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << ":" << std::setw(8) << area[2] << " " << std::setw(8) << area[3] << "\n"; - } - } - } -} - -double HcalNumberingFromDDD::getEtaHO(double& etaR, double& x, double& y, - double& z) const { - - double eta = fabs(etaR); - double r = std::sqrt(x*x+y*y); - if (r > rminHO) { - double zz = fabs(z); - if (zz > zho[3]) { - if (eta <= etaTable[10]) eta = etaTable[10]+0.001; - } else if (zz > zho[1]) { - if (eta <= etaTable[4]) eta = etaTable[4]+0.001; - } - } - eta = (z >= 0. ? eta : -eta); - // std::cout << "R " << r << " Z " << z << " eta " << etaR << ":" << eta <<"\n"; - // if (eta != etaR) std::cout << "**** Check *****\n"; - return eta; -} diff --git a/Geometry/HcalCommonData/test/HcalParametersAnalyzer.cc b/Geometry/HcalCommonData/test/HcalParametersAnalyzer.cc index d1d8871a9a127..c5200271ec141 100644 --- a/Geometry/HcalCommonData/test/HcalParametersAnalyzer.cc +++ b/Geometry/HcalCommonData/test/HcalParametersAnalyzer.cc @@ -6,8 +6,7 @@ #include "Geometry/Records/interface/HcalParametersRcd.h" #include -class HcalParametersAnalyzer : public edm::one::EDAnalyzer<> -{ +class HcalParametersAnalyzer : public edm::one::EDAnalyzer<> { public: explicit HcalParametersAnalyzer( const edm::ParameterSet& ); ~HcalParametersAnalyzer( void ); diff --git a/Geometry/HcalCommonData/test/HcalRecNumberingTester.cc b/Geometry/HcalCommonData/test/HcalRecNumberingTester.cc index d9c74f4517e49..a5dbc5505b082 100644 --- a/Geometry/HcalCommonData/test/HcalRecNumberingTester.cc +++ b/Geometry/HcalCommonData/test/HcalRecNumberingTester.cc @@ -40,8 +40,7 @@ #include "CoralBase/Exception.h" -class HcalRecNumberingTester : public edm::one::EDAnalyzer<> -{ +class HcalRecNumberingTester : public edm::one::EDAnalyzer<> { public: explicit HcalRecNumberingTester( const edm::ParameterSet& ); ~HcalRecNumberingTester(); diff --git a/Geometry/HcalCommonData/test/python/runHcalRecNumberingTester_cfg.py b/Geometry/HcalCommonData/test/python/runHcalRecNumberingTester_cfg.py index f7f297bfe3ad9..b83b3451948c1 100644 --- a/Geometry/HcalCommonData/test/python/runHcalRecNumberingTester_cfg.py +++ b/Geometry/HcalCommonData/test/python/runHcalRecNumberingTester_cfg.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms process = cms.Process("HcalParametersTest") -process.load('Configuration.Geometry.GeometryExtended2015_cff') +process.load('Geometry.HcalCommonData.testPhase0GeometryXML_cfi') process.load('Geometry.HcalCommonData.hcalDDConstants_cff') process.source = cms.Source("EmptySource") diff --git a/Geometry/HcalCommonData/test/python/runHcalSimNumberingTester_cfg.py b/Geometry/HcalCommonData/test/python/runHcalSimNumberingTester_cfg.py index fae82be4e3639..beded9b0ecfd9 100644 --- a/Geometry/HcalCommonData/test/python/runHcalSimNumberingTester_cfg.py +++ b/Geometry/HcalCommonData/test/python/runHcalSimNumberingTester_cfg.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms process = cms.Process("HcalParametersTest") -process.load('Configuration.Geometry.GeometryExtended2015_cff') +process.load('Geometry.HcalCommonData.testPhase0GeometryXML_cfi') process.load('Geometry.HcalCommonData.hcalDDDSimConstants_cfi') process.load('Geometry.HcalCommonData.hcalParameters_cfi') diff --git a/Geometry/HcalEventSetup/interface/HcalDDDGeometryEP.h b/Geometry/HcalEventSetup/interface/HcalDDDGeometryEP.h new file mode 100644 index 0000000000000..a9ebe3301f20c --- /dev/null +++ b/Geometry/HcalEventSetup/interface/HcalDDDGeometryEP.h @@ -0,0 +1,46 @@ +#ifndef Geometry_HcalEventSetup_HcalDDDGeometryEP_H +#define Geometry_HcalEventSetup_HcalDDDGeometryEP_H 1 + + +// system include files +#include +#include "boost/shared_ptr.hpp" + +// user include files +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/ESProducer.h" + +#include "FWCore/Framework/interface/ESHandle.h" + +#include "Geometry/Records/interface/HcalGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/HcalTowerAlgo/interface/HcalDDDGeometryLoader.h" + +// +// class decleration +// + +class HcalDDDGeometryEP : public edm::ESProducer { + +public: + + HcalDDDGeometryEP(const edm::ParameterSet&); + ~HcalDDDGeometryEP(); + + typedef boost::shared_ptr ReturnType; + + void idealRecordCallBack(const HcalRecNumberingRecord&) {} + + ReturnType produceIdeal(const HcalRecNumberingRecord&); + ReturnType produceAligned(const HcalGeometryRecord&); + +private: + + // ----------member data --------------------------- + + HcalDDDGeometryLoader* m_loader ; + bool m_applyAlignment ; +}; +#endif + diff --git a/Geometry/HcalEventSetup/interface/HcalHardcodeGeometryEP.h b/Geometry/HcalEventSetup/interface/HcalHardcodeGeometryEP.h index 93f0e24b508f3..f3f7558dd128b 100644 --- a/Geometry/HcalEventSetup/interface/HcalHardcodeGeometryEP.h +++ b/Geometry/HcalEventSetup/interface/HcalHardcodeGeometryEP.h @@ -1,6 +1,5 @@ -#ifndef GEOMETRY_HCALEVENTSETUP_HCALHARDCODEGEOMETRYEP_H -#define GEOMETRY_HCALEVENTSETUP_HCALHARDCODEGEOMETRYEP_H 1 - +#ifndef Geometry_HcalEventSetup_HcalHardcodeGeometryEP_H +#define Geometry_HcalEventSetup_HcalHardcodeGeometryEP_H 1 // system include files #include @@ -12,10 +11,9 @@ // class declarations class CaloSubdetectorGeometry; -class IdealGeometryRecord; +class HcalRecNumberingRecord; class HcalGeometryRecord; - class HcalHardcodeGeometryEP : public edm::ESProducer { public: @@ -24,15 +22,13 @@ class HcalHardcodeGeometryEP : public edm::ESProducer { typedef boost::shared_ptr ReturnType; - ReturnType produceIdeal( const IdealGeometryRecord&); - ReturnType produceAligned( const HcalGeometryRecord& ); + ReturnType produceIdeal(const HcalRecNumberingRecord&); + ReturnType produceAligned(const HcalGeometryRecord& ); - void idealRecordCallBack( const IdealGeometryRecord& ); + void idealRecordCallBack(const HcalRecNumberingRecord&) {} private: edm::ParameterSet ps0; + bool useOld_; }; - - - #endif diff --git a/Geometry/HcalEventSetup/interface/HcalTopologyIdealEP.h b/Geometry/HcalEventSetup/interface/HcalTopologyIdealEP.h index c86307e6a64ec..c2aa6f30de0e8 100644 --- a/Geometry/HcalEventSetup/interface/HcalTopologyIdealEP.h +++ b/Geometry/HcalEventSetup/interface/HcalTopologyIdealEP.h @@ -12,6 +12,7 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "Geometry/CaloTopology/interface/HcalTopology.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" namespace edm { @@ -30,20 +31,15 @@ class HcalTopologyIdealEP : public edm::ESProducer { typedef boost::shared_ptr ReturnType; - static void fillDescriptions( edm::ConfigurationDescriptions & descriptions ); + static void fillDescriptions(edm::ConfigurationDescriptions & descriptions); - ReturnType produce(const IdealGeometryRecord&); + ReturnType produce(const HcalRecNumberingRecord&); + + void hcalRecordCallBack( const IdealGeometryRecord& ) {} private: // ----------member data --------------------------- std::string m_restrictions; const edm::ParameterSet m_pSet; - - // can be specified in the config - struct RingSegmentation { - int ring; - std::vector segmentation; - }; - std::vector m_segmentation; }; #endif diff --git a/Geometry/HcalEventSetup/python/HcalGeometryDBWriter_cfi.py b/Geometry/HcalEventSetup/python/HcalGeometryDBWriter_cfi.py index 28e91f593e5da..2a77b65c7a10c 100644 --- a/Geometry/HcalEventSetup/python/HcalGeometryDBWriter_cfi.py +++ b/Geometry/HcalEventSetup/python/HcalGeometryDBWriter_cfi.py @@ -3,6 +3,7 @@ HcalHardcodeGeometryEP = cms.ESProducer( "HcalHardcodeGeometryEP" , appendToDataLabel = cms.string("_master"), + UseOldLoader = cms.bool(False), HcalReLabel = HcalReLabel ) diff --git a/Geometry/HcalEventSetup/python/HcalGeometry_cfi.py b/Geometry/HcalEventSetup/python/HcalGeometry_cfi.py index ada467097910d..f9bf4bd0de09e 100644 --- a/Geometry/HcalEventSetup/python/HcalGeometry_cfi.py +++ b/Geometry/HcalEventSetup/python/HcalGeometry_cfi.py @@ -2,5 +2,6 @@ from Geometry.HcalEventSetup.HcalRelabel_cfi import HcalReLabel HcalHardcodeGeometryEP = cms.ESProducer("HcalHardcodeGeometryEP" , + UseOldLoader = cms.bool(False), HcalReLabel = HcalReLabel ) diff --git a/Geometry/HcalEventSetup/python/HcalHardcodeGeometry_cfi.py b/Geometry/HcalEventSetup/python/HcalHardcodeGeometry_cfi.py index 518aee9eed675..c6ced9e832466 100644 --- a/Geometry/HcalEventSetup/python/HcalHardcodeGeometry_cfi.py +++ b/Geometry/HcalEventSetup/python/HcalHardcodeGeometry_cfi.py @@ -3,6 +3,7 @@ HcalHardcodeGeometryEP = cms.ESProducer("HcalHardcodeGeometryEP" , appendToDataLabel = cms.string("_master"), + UseOldLoader = cms.bool(False), HcalReLabel = HcalReLabel ) diff --git a/Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.cc b/Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.cc index fa4689e4d7c3a..25c3318132b09 100644 --- a/Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.cc +++ b/Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.cc @@ -17,6 +17,9 @@ // #include "Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" +#include "Geometry/CaloTopology/interface/HcalTopology.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" // // constants, enums and typedefs @@ -29,19 +32,20 @@ // // constructors and destructor // -CaloTowerHardcodeGeometryEP::CaloTowerHardcodeGeometryEP(const edm::ParameterSet& iConfig) -{ - //the following line is needed to tell the framework what - // data is being produced - setWhatProduced(this,"TOWER"); +CaloTowerHardcodeGeometryEP::CaloTowerHardcodeGeometryEP(const edm::ParameterSet& iConfig) { + //the following line is needed to tell the framework what + // data is being produced + setWhatProduced(this, + &CaloTowerHardcodeGeometryEP::produce, + dependsOn( &CaloTowerHardcodeGeometryEP::idealRecordCallBack ), + "TOWER"); - //now do what ever other initialization is needed - loader_=new CaloTowerHardcodeGeometryLoader(); /// TODO : allow override of Topology. + //now do what ever other initialization is needed + loader_=new CaloTowerHardcodeGeometryLoader(); /// TODO : allow override of Topology. } -CaloTowerHardcodeGeometryEP::~CaloTowerHardcodeGeometryEP() -{ +CaloTowerHardcodeGeometryEP::~CaloTowerHardcodeGeometryEP() { delete loader_; } @@ -52,12 +56,13 @@ CaloTowerHardcodeGeometryEP::~CaloTowerHardcodeGeometryEP() // ------------ method called to produce the data ------------ CaloTowerHardcodeGeometryEP::ReturnType -CaloTowerHardcodeGeometryEP::produce(const CaloTowerGeometryRecord& iRecord) -{ - edm::ESHandle hcalTopology; - iRecord.getRecord().get( hcalTopology ); +CaloTowerHardcodeGeometryEP::produce(const CaloTowerGeometryRecord& iRecord) { + edm::ESHandle hcaltopo; + iRecord.getRecord().get( hcaltopo ); + edm::ESHandle pHRNDC; + iRecord.getRecord().get( pHRNDC ); - std::auto_ptr pCaloSubdetectorGeometry( loader_->load( &*hcalTopology )); + std::auto_ptr pCaloSubdetectorGeometry( loader_->load( &*hcaltopo, &*pHRNDC )); return pCaloSubdetectorGeometry ; } diff --git a/Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.h b/Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.h index f2cafe7a1dc86..d7dc706b2966f 100644 --- a/Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.h +++ b/Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.h @@ -17,15 +17,21 @@ // // class decleration // +class HcalRecNumberingRecord; +class IdealGeometryRecord; + class CaloTowerHardcodeGeometryEP : public edm::ESProducer { - public: - CaloTowerHardcodeGeometryEP(const edm::ParameterSet&); - ~CaloTowerHardcodeGeometryEP(); +public: + CaloTowerHardcodeGeometryEP(const edm::ParameterSet&); + ~CaloTowerHardcodeGeometryEP(); + + typedef std::auto_ptr ReturnType; + + ReturnType produce(const CaloTowerGeometryRecord&); - typedef std::auto_ptr ReturnType; + void idealRecordCallBack( const HcalRecNumberingRecord& ) {} - ReturnType produce(const CaloTowerGeometryRecord&); private: // ----------member data --------------------------- CaloTowerHardcodeGeometryLoader* loader_; diff --git a/Geometry/HcalEventSetup/src/HcalDDDGeometryEP.cc b/Geometry/HcalEventSetup/src/HcalDDDGeometryEP.cc new file mode 100644 index 0000000000000..75a6fc9030a5c --- /dev/null +++ b/Geometry/HcalEventSetup/src/HcalDDDGeometryEP.cc @@ -0,0 +1,82 @@ +// -*- C++ -*- +// +// Package: HcalDDDGeometryEP +// Class: HcalDDDGeometryEP +// +/**\class HcalDDDGeometryEP HcalDDDGeometryEP.h tmp/HcalDDDGeometryEP/interface/HcalDDDGeometryEP.h + + Description: + + Implementation: + +*/ +// +// Original Author: Sunanda Banerjee +// Created: Thu Oct 20 11:35:27 CDT 2006 +// +// + +#include "Geometry/HcalEventSetup/interface/HcalDDDGeometryEP.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +//#define DebugLog +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// + +HcalDDDGeometryEP::HcalDDDGeometryEP(const edm::ParameterSet& ps ) : + m_loader ( 0 ) , + m_applyAlignment(ps.getUntrackedParameter("applyAlignment", false) ) { + + //the following line is needed to tell the framework what + // data is being produced + setWhatProduced( this, + &HcalDDDGeometryEP::produceAligned, + dependsOn( &HcalDDDGeometryEP::idealRecordCallBack ), + "HCAL"); +} + +HcalDDDGeometryEP::~HcalDDDGeometryEP() { + if (m_loader) delete m_loader ; +} + + +// +// member functions +// + +// ------------ method called to produce the data ------------ +HcalDDDGeometryEP::ReturnType +HcalDDDGeometryEP::produceIdeal(const HcalRecNumberingRecord& iRecord) { + + edm::LogInfo("HCAL") << "Using default HCAL topology" ; + edm::ESHandle hcons; + iRecord.get( hcons ) ; + + edm::ESHandle topology ; + iRecord.get( topology ) ; + + assert( 0 == m_loader ) ; + m_loader = new HcalDDDGeometryLoader(&(*hcons)); +#ifdef DebugLog + LogDebug("HCalGeom")<<"HcalDDDGeometryEP:Initialize HcalDDDGeometryLoader"; +#endif + ReturnType pC ( m_loader->load(*topology) ) ; + + return pC; +} + +HcalDDDGeometryEP::ReturnType +HcalDDDGeometryEP::produceAligned(const HcalGeometryRecord& iRecord) { + + const HcalRecNumberingRecord& idealRecord = iRecord.getRecord(); + return produceIdeal (idealRecord); +} diff --git a/Geometry/HcalEventSetup/src/HcalHardcodeGeometryEP.cc b/Geometry/HcalEventSetup/src/HcalHardcodeGeometryEP.cc index f870766e69d0f..3fb913edc6b4d 100644 --- a/Geometry/HcalEventSetup/src/HcalHardcodeGeometryEP.cc +++ b/Geometry/HcalEventSetup/src/HcalHardcodeGeometryEP.cc @@ -19,10 +19,12 @@ #include "Geometry/HcalEventSetup/interface/HcalHardcodeGeometryEP.h" #include "FWCore/Framework/interface/ESHandle.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/HcalGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" #include "Geometry/HcalTowerAlgo/interface/HcalFlexiHardcodeGeometryLoader.h" +#include "Geometry/HcalTowerAlgo/interface/HcalHardcodeGeometryLoader.h" #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -41,7 +43,7 @@ class HcalTopology; // HcalHardcodeGeometryEP::HcalHardcodeGeometryEP( const edm::ParameterSet& ps ) : ps0(ps) { - + useOld_ = ps.getParameter("UseOldLoader"); //the following line is needed to tell the framework what // data is being produced setWhatProduced( this, @@ -56,37 +58,34 @@ HcalHardcodeGeometryEP::HcalHardcodeGeometryEP( const edm::ParameterSet& ps ) : } -HcalHardcodeGeometryEP::~HcalHardcodeGeometryEP() -{ -} +HcalHardcodeGeometryEP::~HcalHardcodeGeometryEP() { } // // member functions // -// ------------ method called to produce the data ------------ - -void -HcalHardcodeGeometryEP::idealRecordCallBack( const IdealGeometryRecord& iRecord ) -{ -} HcalHardcodeGeometryEP::ReturnType -HcalHardcodeGeometryEP::produceIdeal( const IdealGeometryRecord& iRecord ) -{ +HcalHardcodeGeometryEP::produceIdeal( const HcalRecNumberingRecord& iRecord ) { edm::LogInfo("HCAL") << "Using default HCAL topology" ; + edm::ESHandle hcons; + iRecord.get( hcons ) ; edm::ESHandle topology ; iRecord.get( topology ) ; - HcalFlexiHardcodeGeometryLoader loader(ps0); - return ReturnType (loader.load (*topology)); + if (useOld_) { + HcalHardcodeGeometryLoader loader(ps0); + return ReturnType (loader.load (*topology)); + } else { + HcalFlexiHardcodeGeometryLoader loader(ps0); + return ReturnType (loader.load (*topology, *hcons)); + } } HcalHardcodeGeometryEP::ReturnType -HcalHardcodeGeometryEP::produceAligned( const HcalGeometryRecord& iRecord ) -{ - const IdealGeometryRecord& idealRecord = iRecord.getRecord(); +HcalHardcodeGeometryEP::produceAligned( const HcalGeometryRecord& iRecord ) { + const HcalRecNumberingRecord& idealRecord = iRecord.getRecord(); return produceIdeal (idealRecord); } diff --git a/Geometry/HcalEventSetup/src/HcalTopologyIdealEP.cc b/Geometry/HcalEventSetup/src/HcalTopologyIdealEP.cc index eb5ccfa67145c..5be351e5ac767 100644 --- a/Geometry/HcalEventSetup/src/HcalTopologyIdealEP.cc +++ b/Geometry/HcalEventSetup/src/HcalTopologyIdealEP.cc @@ -18,11 +18,14 @@ #include "Geometry/HcalEventSetup/interface/HcalTopologyIdealEP.h" #include "Geometry/CaloTopology/interface/HcalTopologyRestrictionParser.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +//#define DebugLog + // // constants, enums and typedefs // @@ -36,35 +39,20 @@ // HcalTopologyIdealEP::HcalTopologyIdealEP(const edm::ParameterSet& conf) : m_restrictions(conf.getUntrackedParameter("Exclude")), - m_pSet( conf ) -{ - //std::cout << "HcalTopologyIdealEP::HcalTopologyIdealEP" << std::endl; + m_pSet(conf) { +#ifdef DebugLog + std::cout << "HcalTopologyIdealEP::HcalTopologyIdealEP" << std::endl; edm::LogInfo("HCAL") << "HcalTopologyIdealEP::HcalTopologyIdealEP"; - - // copied from HcalHitRelabeller, input like {1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4} - m_segmentation.resize(29); - std::vector segmentation; - for (int iring=1; iring<=29; ++iring) { - char name[10]; - snprintf(name,10,"Eta%d",iring); - if(conf.existsAs >(name, false)) { - RingSegmentation entry; - entry.ring = iring; - entry.segmentation = conf.getUntrackedParameter >(name); - m_segmentation.push_back(entry); - } - } - setWhatProduced(this); +#endif + setWhatProduced(this, + &HcalTopologyIdealEP::produce, + dependsOn( &HcalTopologyIdealEP::hcalRecordCallBack )); } -HcalTopologyIdealEP::~HcalTopologyIdealEP() -{ -} +HcalTopologyIdealEP::~HcalTopologyIdealEP() { } -void -HcalTopologyIdealEP::fillDescriptions( edm::ConfigurationDescriptions & descriptions ) -{ +void HcalTopologyIdealEP::fillDescriptions( edm::ConfigurationDescriptions & descriptions ) { edm::ParameterSetDescription hcalTopologyConstants; hcalTopologyConstants.add( "mode", "HcalTopologyMode::LHC" ); hcalTopologyConstants.add( "maxDepthHB", 2 ); @@ -92,28 +80,25 @@ HcalTopologyIdealEP::fillDescriptions( edm::ConfigurationDescriptions & descript // ------------ method called to produce the data ------------ HcalTopologyIdealEP::ReturnType -HcalTopologyIdealEP::produce(const IdealGeometryRecord& iRecord) -{ - // std::cout << "HcalTopologyIdealEP::produce(const IdealGeometryRecord& iRecord)" << std::endl; - edm::LogInfo("HCAL") << "HcalTopologyIdealEP::produce(const IdealGeometryRecord& iRecord)"; - - using namespace edm::es; - - HcalTopologyMode::Mode mode = HcalTopologyMode::LHC; - int maxDepthHB = 2; - int maxDepthHE = 3; - if( m_pSet.exists( "hcalTopologyConstants" )) - { - const edm::ParameterSet hcalTopoConsts( m_pSet.getParameter( "hcalTopologyConstants" )); - StringToEnumParser eparser; - mode = (HcalTopologyMode::Mode) eparser.parseString(hcalTopoConsts.getParameter("mode")); - maxDepthHB = hcalTopoConsts.getParameter("maxDepthHB"); - maxDepthHE = hcalTopoConsts.getParameter("maxDepthHE"); - } - // std::cout << "mode = " << mode << ", maxDepthHB = " << maxDepthHB << ", maxDepthHE = " << maxDepthHE << std::endl; - edm::LogInfo("HCAL") << "mode = " << mode << ", maxDepthHB = " << maxDepthHB << ", maxDepthHE = " << maxDepthHE; - - ReturnType myTopo(new HcalTopology( mode, maxDepthHB, maxDepthHE )); +HcalTopologyIdealEP::produce(const HcalRecNumberingRecord& iRecord) { +#ifdef DebugLog + std::cout << "HcalTopologyIdealEP::produce(const IdealGeometryRecord& iRecord)" << std::endl; + edm::LogInfo("HCAL") << "HcalTopologyIdealEP::produce(const HcalGeometryRecord& iRecord)"; +#endif + edm::ESHandle pHRNDC; + iRecord.get( pHRNDC ); + const HcalDDDRecConstants* hdc = &(*pHRNDC); + +#ifdef DebugLog + std::cout << "mode = " << hdc->getTopoMode() << ", maxDepthHB = " + << hdc->getMaxDepth(0) << ", maxDepthHE = " << hdc->getMaxDepth(1) + << ", maxDepthHF = " << hdc->getMaxDepth(2) << std::endl; + edm::LogInfo("HCAL") << "mode = " << hdc->getTopoMode() << ", maxDepthHB = " + << hdc->getMaxDepth(0) << ", maxDepthHE = " + << hdc->getMaxDepth(1) << ", maxDepthHF = " + << hdc->getMaxDepth(2); +#endif + ReturnType myTopo(new HcalTopology(hdc)); HcalTopologyRestrictionParser parser(*myTopo); if (!m_restrictions.empty()) { @@ -122,12 +107,6 @@ HcalTopologyIdealEP::produce(const IdealGeometryRecord& iRecord) throw cms::Exception("Parse Error","Parse error on Exclude "+error); } } - - // see if any depth segmentation needs to be added - for(std::vector::const_iterator ringSegItr = m_segmentation.begin(); - ringSegItr != m_segmentation.end(); ++ringSegItr) { - myTopo->setDepthSegmentation(ringSegItr->ring, ringSegItr->segmentation); - } return myTopo ; } diff --git a/Geometry/HcalEventSetup/src/SealModule.cc b/Geometry/HcalEventSetup/src/SealModule.cc index 2001c2df4902d..ff45d31d64825 100644 --- a/Geometry/HcalEventSetup/src/SealModule.cc +++ b/Geometry/HcalEventSetup/src/SealModule.cc @@ -1,9 +1,11 @@ #include "Geometry/HcalEventSetup/interface/HcalHardcodeGeometryEP.h" +#include "Geometry/HcalEventSetup/interface/HcalDDDGeometryEP.h" #include "Geometry/HcalEventSetup/src/CaloTowerHardcodeGeometryEP.h" #include "Geometry/HcalEventSetup/interface/HcalTopologyIdealEP.h" #include "Geometry/HcalEventSetup/interface/HcalAlignmentEP.h" //define this as a plug-in DEFINE_FWK_EVENTSETUP_MODULE(HcalHardcodeGeometryEP); +DEFINE_FWK_EVENTSETUP_MODULE(HcalDDDGeometryEP); DEFINE_FWK_EVENTSETUP_MODULE(CaloTowerHardcodeGeometryEP); DEFINE_FWK_EVENTSETUP_MODULE(HcalTopologyIdealEP); DEFINE_FWK_EVENTSETUP_MODULE(HcalAlignmentEP); diff --git a/Geometry/HcalEventSetup/src/moduleDB.cc b/Geometry/HcalEventSetup/src/moduleDB.cc index ba3543aa8eb03..063e431fb6b10 100644 --- a/Geometry/HcalEventSetup/src/moduleDB.cc +++ b/Geometry/HcalEventSetup/src/moduleDB.cc @@ -56,7 +56,7 @@ CaloGeometryDBEP::produceAligned( const type edm::ESHandle hcalTopology; - iRecord.getRecord().get( hcalTopology ); + iRecord.getRecord().get( hcalTopology ); // We know that the numer of shapes chanes with changing depth // so, this check is temporary disabled. We need to implement diff --git a/Geometry/HcalTowerAlgo/BuildFile.xml b/Geometry/HcalTowerAlgo/BuildFile.xml index 294bdf61fb52a..d7bb51ceb0feb 100644 --- a/Geometry/HcalTowerAlgo/BuildFile.xml +++ b/Geometry/HcalTowerAlgo/BuildFile.xml @@ -9,3 +9,4 @@ + diff --git a/Geometry/HcalTowerAlgo/interface/CaloTowerHardcodeGeometryLoader.h b/Geometry/HcalTowerAlgo/interface/CaloTowerHardcodeGeometryLoader.h index 217b5c0276715..7302873238c98 100644 --- a/Geometry/HcalTowerAlgo/interface/CaloTowerHardcodeGeometryLoader.h +++ b/Geometry/HcalTowerAlgo/interface/CaloTowerHardcodeGeometryLoader.h @@ -3,7 +3,9 @@ #include "Geometry/HcalTowerAlgo/interface/CaloTowerGeometry.h" #include "Geometry/CaloTopology/interface/HcalTopology.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" #include +#include /** \class CaloTowerHardcodeGeometryLoader * @@ -11,10 +13,13 @@ */ class CaloTowerHardcodeGeometryLoader { public: - std::auto_ptr load(const HcalTopology *limits); + std::auto_ptr load(const HcalTopology *hcaltopo, const HcalDDDRecConstants* hcons); private: void makeCell(int ieta, int iphi, CaloSubdetectorGeometry* geom) const; - const HcalTopology *m_limits; // just for the ring limits + const HcalTopology *m_hcaltopo; + const HcalDDDRecConstants *m_hcons; + std::vector theHBHEEtaBounds, theHFEtaBounds; + }; diff --git a/Geometry/HcalTowerAlgo/interface/HcalDDDGeometryLoader.h b/Geometry/HcalTowerAlgo/interface/HcalDDDGeometryLoader.h index c344465effd51..ee8dbebf049e9 100644 --- a/Geometry/HcalTowerAlgo/interface/HcalDDDGeometryLoader.h +++ b/Geometry/HcalTowerAlgo/interface/HcalDDDGeometryLoader.h @@ -2,11 +2,10 @@ #define Geometry_HcalTowerAlgo_HcalDDDGeometryLoader_H 1 #include "Geometry/CaloGeometry/interface/CaloVGeometryLoader.h" -#include "Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" #include "Geometry/HcalTowerAlgo/interface/HcalDDDGeometry.h" #include "Geometry/CaloTopology/interface/HcalTopology.h" -class DDCompactView; class CaloCellGeometry; class HcalDetId; @@ -18,17 +17,17 @@ class HcalDetId; * \author S. Banerjee */ -class HcalDDDGeometryLoader // : public CaloVGeometryLoader { -{ - public: +class HcalDDDGeometryLoader { - explicit HcalDDDGeometryLoader(const DDCompactView & cpv); - virtual ~HcalDDDGeometryLoader(); +public: + + explicit HcalDDDGeometryLoader(const HcalDDDRecConstants * hcons); + virtual ~HcalDDDGeometryLoader(); - typedef CaloSubdetectorGeometry* ReturnType ; - ReturnType load(const HcalTopology& topo, DetId::Detector , int ); - /// Load all of HCAL - ReturnType load(const HcalTopology& topo); + typedef CaloSubdetectorGeometry* ReturnType ; + ReturnType load(const HcalTopology& topo, DetId::Detector , int ); + /// Load all of HCAL + ReturnType load(const HcalTopology& topo); private: @@ -39,10 +38,10 @@ class HcalDDDGeometryLoader // : public CaloVGeometryLoader { void fill(HcalSubdetector, HcalDDDGeometry*, CaloSubdetectorGeometry*); void makeCell( const HcalDetId &, - const HcalCellType&, double, + const HcalCellType& , double, double, CaloSubdetectorGeometry* geom) const; - HcalNumberingFromDDD* numberingFromDDD; + const HcalDDDRecConstants* hcalConstants; HcalTopology* dummyTopology_; diff --git a/Geometry/HcalTowerAlgo/interface/HcalFlexiHardcodeGeometryLoader.h b/Geometry/HcalTowerAlgo/interface/HcalFlexiHardcodeGeometryLoader.h index 411dba8ed9799..135185f0fddde 100644 --- a/Geometry/HcalTowerAlgo/interface/HcalFlexiHardcodeGeometryLoader.h +++ b/Geometry/HcalTowerAlgo/interface/HcalFlexiHardcodeGeometryLoader.h @@ -12,46 +12,51 @@ #include class HcalTopology; +class HcalDDDRecConstants; class HcalFlexiHardcodeGeometryLoader { public: HcalFlexiHardcodeGeometryLoader(const edm::ParameterSet&); - CaloSubdetectorGeometry* load(const HcalTopology& fTopology); + CaloSubdetectorGeometry* load(const HcalTopology& fTopology, const HcalDDDRecConstants& hcons); private: struct HBHOCellParameters { - HBHOCellParameters (int f_eta, int f_depth, int f_phiFirst, int f_phiStep, int f_dPhi, float f_rMin, float f_rMax, float f_etaMin, float f_etaMax) - : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), phiStep(f_phiStep), dphi(f_dPhi), rMin(f_rMin), rMax(f_rMax), etaMin(f_etaMin), etaMax(f_etaMax) + HBHOCellParameters (int f_eta, int f_depth, int f_phiFirst, int f_nphi, int f_phiStep, double f_phiStart, double f_dPhi, double f_rMin, double f_rMax, double f_etaMin, double f_etaMax) + : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), nPhi(f_nphi), phiStep(f_phiStep), phiStart(f_phiStart), dphi(f_dPhi), rMin(f_rMin), rMax(f_rMax), etaMin(f_etaMin), etaMax(f_etaMax) {} int eta; int depth; int phiFirst; + int nPhi; int phiStep; - int dphi; - float rMin; - float rMax; - float etaMin; + double phiStart; + double dphi; + double rMin; + double rMax; + double etaMin; float etaMax; }; struct HECellParameters { - HECellParameters (int f_eta, int f_depth, int f_phiFirst, int f_phiStep, int f_dPhi, float f_zMin, float f_zMax, float f_etaMin, float f_etaMax) - : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), phiStep(f_phiStep), dphi(f_dPhi), zMin(f_zMin), zMax(f_zMax), etaMin(f_etaMin), etaMax(f_etaMax) + HECellParameters (int f_eta, int f_depth, int f_phiFirst, int f_nphi, int f_phiStep, double f_phiStart, double f_dPhi, double f_zMin, double f_zMax, double f_etaMin, double f_etaMax) + : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), nPhi(f_nphi), phiStep(f_phiStep), phiStart(f_phiStart), dphi(f_dPhi), zMin(f_zMin), zMax(f_zMax), etaMin(f_etaMin), etaMax(f_etaMax) {} int eta; int depth; int phiFirst; + int nPhi; int phiStep; - int dphi; - float zMin; - float zMax; - float etaMin; - float etaMax; + double phiStart; + double dphi; + double zMin; + double zMax; + double etaMin; + double etaMax; }; struct HFCellParameters { @@ -70,9 +75,9 @@ class HcalFlexiHardcodeGeometryLoader { float rMax; }; - std::vector makeHBCells (const HcalTopology & topology); + std::vector makeHBCells (const HcalDDDRecConstants& hcons); std::vector makeHOCells (); - std::vector makeHECells (const HcalTopology & topology); + std::vector makeHECells (const HcalDDDRecConstants& hcons); std::vector makeHECells_H2 (); std::vector makeHFCells (); @@ -82,9 +87,6 @@ class HcalFlexiHardcodeGeometryLoader { int MAX_HCAL_PHI; double DEGREE2RAD; - - std::vector > m_segmentation; - }; #endif diff --git a/Geometry/HcalTowerAlgo/interface/HcalGeometry.h b/Geometry/HcalTowerAlgo/interface/HcalGeometry.h index 5849c181a7bf1..e124415fe7a0a 100644 --- a/Geometry/HcalTowerAlgo/interface/HcalGeometry.h +++ b/Geometry/HcalTowerAlgo/interface/HcalGeometry.h @@ -119,8 +119,7 @@ class HcalGeometry : public CaloSubdetectorGeometry { /// helper methods for getClosestCell int etaRing(HcalSubdetector bc, double abseta) const; - int phiBin(double phi, int etaring) const; - + int phiBin(HcalSubdetector bc, int etaring, double phi) const; const HcalTopology& theTopology; diff --git a/Geometry/HcalTowerAlgo/interface/HcalHardcodeGeometryLoader.h b/Geometry/HcalTowerAlgo/interface/HcalHardcodeGeometryLoader.h index a8eb4eb876d15..1b0690077fa5f 100644 --- a/Geometry/HcalTowerAlgo/interface/HcalHardcodeGeometryLoader.h +++ b/Geometry/HcalTowerAlgo/interface/HcalHardcodeGeometryLoader.h @@ -1,58 +1,90 @@ #ifndef GEOMETRY_HCALTOWERALGO_HCALHARDCODEGEOMETRYLOADER_H #define GEOMETRY_HCALTOWERALGO_HCALHARDCODEGEOMETRYLOADER_H 1 -#include "Geometry/CaloGeometry/interface/CaloVGeometryLoader.h" -#include "Geometry/CaloTopology/interface/HcalTopology.h" - -class CaloCellGeometry; -class HcalDetId; - /** \class HcalHardcodeGeometryLoader * - * - * \note The HE geometry is not currently correct. The z positions must be corrected. - * - * \author R. Wilkinson - Caltech + * \author F.Ratnikov, UMd */ -class HcalHardcodeGeometryLoader -{ - public: - typedef CaloSubdetectorGeometry* ReturnType ; +#include "Geometry/CaloGeometry/interface/CaloVGeometryLoader.h" +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include - explicit HcalHardcodeGeometryLoader(const HcalTopology& ht); - virtual ~HcalHardcodeGeometryLoader() { delete theTopology ; } - - ReturnType load(DetId::Detector det, int subdet); - /// Load all of HCAL - ReturnType load(); - - private: - void init(); - /// helper functions to make all the ids and cells, and put them into the - /// vectors and mpas passed in. - - void fill( HcalSubdetector subdet, - int firstEtaRing, - int lastEtaRing, - ReturnType cg ); - - void makeCell( const HcalDetId& detId, - ReturnType geom ) const; - - HcalTopology* theTopology; - const HcalTopology* extTopology; +class HcalTopology; + +class HcalHardcodeGeometryLoader { + +public: + HcalHardcodeGeometryLoader(const edm::ParameterSet&); - double theBarrelRadius; - double theOuterRadius; - double theHEZPos[4]; - double theHFZPos[2]; + CaloSubdetectorGeometry* load(const HcalTopology& fTopology); + +private: + + struct HBHOCellParameters { + HBHOCellParameters (int f_eta, int f_depth, int f_phiFirst, int f_phiStep, int f_dPhi, float f_rMin, float f_rMax, float f_etaMin, float f_etaMax) + : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), phiStep(f_phiStep), dphi(f_dPhi), rMin(f_rMin), rMax(f_rMax), etaMin(f_etaMin), etaMax(f_etaMax) + {} + + int eta; + int depth; + int phiFirst; + int phiStep; + int dphi; + float rMin; + float rMax; + float etaMin; + float etaMax; + }; + + struct HECellParameters { + HECellParameters (int f_eta, int f_depth, int f_phiFirst, int f_phiStep, int f_dPhi, float f_zMin, float f_zMax, float f_etaMin, float f_etaMax) + : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), phiStep(f_phiStep), dphi(f_dPhi), zMin(f_zMin), zMax(f_zMax), etaMin(f_etaMin), etaMax(f_etaMax) + {} + + int eta; + int depth; + int phiFirst; + int phiStep; + int dphi; + float zMin; + float zMax; + float etaMin; + float etaMax; + }; + + struct HFCellParameters { + HFCellParameters (int f_eta, int f_depth, int f_phiFirst, int f_phiStep, int f_dPhi, float f_zMin, float f_zMax, float f_rMin, float f_rMax) + : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), phiStep(f_phiStep), dphi(f_dPhi), zMin(f_zMin), zMax(f_zMax), rMin(f_rMin), rMax(f_rMax) + {} + + int eta; + int depth; + int phiFirst; + int phiStep; + int dphi; + float zMin; + float zMax; + float rMin; + float rMax; + }; + + std::vector makeHBCells (const HcalTopology & topology); + std::vector makeHOCells (); + std::vector makeHECells (const HcalTopology & topology); + std::vector makeHECells_H2 (); + std::vector makeHFCells (); + + void fillHBHO (CaloSubdetectorGeometry* fGeometry, const std::vector & fCells, bool fHB); + void fillHE (CaloSubdetectorGeometry* fGeometry, const std::vector & fCells); + void fillHF (CaloSubdetectorGeometry* fGeometry, const std::vector & fCells); + + int MAX_HCAL_PHI; + double DEGREE2RAD; + + std::vector > m_segmentation; - double theHBThickness; - double theHB15aThickness,theHB15bThickness; - double theHB16aThickness,theHB16bThickness; - double theHFThickness; - double theHOThickness; }; #endif diff --git a/Geometry/HcalTowerAlgo/plugins/HcalTrigTowerGeometryESProducer.cc b/Geometry/HcalTowerAlgo/plugins/HcalTrigTowerGeometryESProducer.cc index 5b4f04c24fd28..fc692c4116dd1 100644 --- a/Geometry/HcalTowerAlgo/plugins/HcalTrigTowerGeometryESProducer.cc +++ b/Geometry/HcalTowerAlgo/plugins/HcalTrigTowerGeometryESProducer.cc @@ -1,7 +1,7 @@ #include "HcalTrigTowerGeometryESProducer.h" #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ESHandle.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include HcalTrigTowerGeometryESProducer::HcalTrigTowerGeometryESProducer( const edm::ParameterSet & config ) @@ -18,7 +18,7 @@ boost::shared_ptr HcalTrigTowerGeometryESProducer::produce( const CaloGeometryRecord & iRecord ) { edm::ESHandle hcalTopology; - iRecord.getRecord().get( hcalTopology ); + iRecord.getRecord().get( hcalTopology ); m_hcalTrigTowerGeom = boost::shared_ptr( new HcalTrigTowerGeometry( &*hcalTopology)); diff --git a/Geometry/HcalTowerAlgo/src/CaloTowerHardcodeGeometryLoader.cc b/Geometry/HcalTowerAlgo/src/CaloTowerHardcodeGeometryLoader.cc index be95dacb65500..8cbc8692e5094 100644 --- a/Geometry/HcalTowerAlgo/src/CaloTowerHardcodeGeometryLoader.cc +++ b/Geometry/HcalTowerAlgo/src/CaloTowerHardcodeGeometryLoader.cc @@ -1,5 +1,4 @@ #include "Geometry/HcalTowerAlgo/interface/CaloTowerHardcodeGeometryLoader.h" -#include "Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryData.h" #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" #include "Geometry/CaloGeometry/interface/IdealObliquePrism.h" @@ -7,9 +6,15 @@ typedef CaloCellGeometry::CCGFloat CCGFloat ; -std::auto_ptr CaloTowerHardcodeGeometryLoader::load(const HcalTopology *limits) { - m_limits = limits; - +std::auto_ptr CaloTowerHardcodeGeometryLoader::load(const HcalTopology *hcaltopo, const HcalDDDRecConstants* hcons) { + + m_hcaltopo = hcaltopo; + m_hcons = hcons; + + //get eta limits from hcal rec constants + theHFEtaBounds = m_hcons->getEtaTableHF(); + theHBHEEtaBounds = m_hcons->getEtaTable(); + CaloTowerGeometry* geom=new CaloTowerGeometry(); if( 0 == geom->cornersMgr() ) geom->allocateCorners ( @@ -20,11 +25,11 @@ std::auto_ptr CaloTowerHardcodeGeometryLoader::load(con int nnn=0; // simple loop - for (int ieta=-m_limits->lastHFRing(); ieta<=m_limits->lastHFRing(); ieta++) { + for (int ieta=-m_hcaltopo->lastHFRing(); ieta<=m_hcaltopo->lastHFRing(); ieta++) { if (ieta==0) continue; // skip not existing eta=0 ring for (int iphi=1; iphi<=72; iphi++) { - if (abs(ieta)>=m_limits->firstHFQuadPhiRing() && ((iphi-1)%4)==0) continue; - if (abs(ieta)>=m_limits->firstHEDoublePhiRing() && ((iphi-1)%2)!=0) continue; + if (abs(ieta)>=m_hcaltopo->firstHFQuadPhiRing() && ((iphi-1)%4)==0) continue; + if (abs(ieta)>=m_hcaltopo->firstHEDoublePhiRing() && ((iphi-1)%2)!=0) continue; ++nnn; } } @@ -33,11 +38,11 @@ std::auto_ptr CaloTowerHardcodeGeometryLoader::load(con int n=0; // simple loop - for (int ieta=-m_limits->lastHFRing(); ieta<=m_limits->lastHFRing(); ieta++) { + for (int ieta=-m_hcaltopo->lastHFRing(); ieta<=m_hcaltopo->lastHFRing(); ieta++) { if (ieta==0) continue; // skip not existing eta=0 ring for (int iphi=1; iphi<=72; iphi++) { - if (abs(ieta)>=m_limits->firstHFQuadPhiRing() && ((iphi-1)%4)==0) continue; - if (abs(ieta)>=m_limits->firstHEDoublePhiRing() && ((iphi-1)%2)!=0) continue; + if (abs(ieta)>=m_hcaltopo->firstHFQuadPhiRing() && ((iphi-1)%4)==0) continue; + if (abs(ieta)>=m_hcaltopo->firstHEDoublePhiRing() && ((iphi-1)%2)!=0) continue; makeCell(ieta,iphi, geom); n++; } @@ -61,9 +66,9 @@ CaloTowerHardcodeGeometryLoader::makeCell( int ieta, int etaRing=abs(ieta); int sign=(ieta>0)?(1):(-1); double eta1, eta2; - if (etaRing>m_limits->lastHERing()) { - eta1 = theHFEtaBounds[etaRing-m_limits->firstHFRing()]; - eta2 = theHFEtaBounds[etaRing-m_limits->firstHFRing()+1]; + if (abs(ieta)>m_hcaltopo->lastHERing()) { + eta1 = theHFEtaBounds[etaRing-m_hcaltopo->firstHFRing()]; + eta2 = theHFEtaBounds[etaRing-m_hcaltopo->firstHFRing()+1]; } else { eta1 = theHBHEEtaBounds[etaRing-1]; eta2 = theHBHEEtaBounds[etaRing]; @@ -72,21 +77,21 @@ CaloTowerHardcodeGeometryLoader::makeCell( int ieta, double deta = (eta2-eta1); // in radians - double dphi_nominal = 2.0*M_PI / m_limits->nPhiBins(1); // always the same - double dphi_half = M_PI / m_limits->nPhiBins(etaRing); // half-width + double dphi_nominal = 2.0*M_PI / m_hcaltopo->nPhiBins(1); // always the same + double dphi_half = M_PI / m_hcaltopo->nPhiBins(etaRing); // half-width double phi_low = dphi_nominal*(iphi-1); // low-edge boundaries are constant... double phi = phi_low+dphi_half; double x,y,z,thickness; bool alongZ=true; - if (etaRing>m_limits->lastHERing()) { // forward + if (abs(ieta)>m_hcaltopo->lastHERing()) { // forward z=HFz; double r=z/sinh(eta); x=r * cos(phi); y=r * sin(phi); thickness=HFthick/tanh(eta); - } else if (etaRing>17) { // EE-containing + } else if (abs(ieta)>m_hcaltopo->firstHERing()+1) { // EE-containing z=EEz; double r=z/sinh(eta); x=r * cos(phi); diff --git a/Geometry/HcalTowerAlgo/src/HcalDDDGeometryLoader.cc b/Geometry/HcalTowerAlgo/src/HcalDDDGeometryLoader.cc index fb8613badcc86..03bc98fd0bea5 100644 --- a/Geometry/HcalTowerAlgo/src/HcalDDDGeometryLoader.cc +++ b/Geometry/HcalTowerAlgo/src/HcalDDDGeometryLoader.cc @@ -1,5 +1,6 @@ #include "Geometry/HcalTowerAlgo/interface/HcalDDDGeometryLoader.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "Geometry/HcalCommonData/interface/HcalParametersFromDD.h" #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" #include "Geometry/CaloGeometry/interface/IdealObliquePrism.h" #include "Geometry/CaloGeometry/interface/IdealZPrism.h" @@ -12,16 +13,12 @@ typedef CaloCellGeometry::CCGFloat CCGFloat ; //#define DebugLog -HcalDDDGeometryLoader::HcalDDDGeometryLoader(const DDCompactView & cpv) { - std::string name = "HcalHits"; - numberingFromDDD = new HcalNumberingFromDDD(name, cpv); -} +HcalDDDGeometryLoader::HcalDDDGeometryLoader(const HcalDDDRecConstants* hcons) + : hcalConstants(hcons) { } HcalDDDGeometryLoader::~HcalDDDGeometryLoader() { - delete numberingFromDDD; } - HcalDDDGeometryLoader::ReturnType HcalDDDGeometryLoader::load(const HcalTopology& topo, DetId::Detector det, int subdet) { @@ -32,10 +29,10 @@ HcalDDDGeometryLoader::load(const HcalTopology& topo, DetId::Detector det, int s ReturnType geom ( gDDD ); if ( geom->cornersMgr() == 0 ) { - const unsigned int count (numberingFromDDD->numberOfCells(HcalBarrel ) + - numberingFromDDD->numberOfCells(HcalEndcap ) + - numberingFromDDD->numberOfCells(HcalForward) + - numberingFromDDD->numberOfCells(HcalOuter ) ); + const unsigned int count (hcalConstants->numberOfCells(HcalBarrel ) + + hcalConstants->numberOfCells(HcalEndcap ) + + hcalConstants->numberOfCells(HcalForward) + + hcalConstants->numberOfCells(HcalOuter ) ); geom->allocateCorners( count ) ; } @@ -51,22 +48,22 @@ HcalDDDGeometryLoader::ReturnType HcalDDDGeometryLoader::load(const HcalTopology& topo) { HcalDDDGeometry* gDDD ( new HcalDDDGeometry(topo) ); - ReturnType geom ( gDDD ); + ReturnType geom ( gDDD ); - if( geom->cornersMgr() == 0 ) { - const unsigned int count (numberingFromDDD->numberOfCells(HcalBarrel ) + - numberingFromDDD->numberOfCells(HcalEndcap ) + - numberingFromDDD->numberOfCells(HcalForward) + - numberingFromDDD->numberOfCells(HcalOuter ) ); - geom->allocateCorners( count ) ; - } - if( geom->parMgr() == 0 ) geom->allocatePar( 500, 3 ) ; - - fill(HcalBarrel, gDDD, geom); - fill(HcalEndcap, gDDD, geom); - fill(HcalForward, gDDD, geom); - fill(HcalOuter, gDDD, geom); - return geom ; + if( geom->cornersMgr() == 0 ) { + const unsigned int count (hcalConstants->numberOfCells(HcalBarrel ) + + hcalConstants->numberOfCells(HcalEndcap ) + + hcalConstants->numberOfCells(HcalForward) + + hcalConstants->numberOfCells(HcalOuter ) ); + geom->allocateCorners( count ) ; + } + if( geom->parMgr() == 0 ) geom->allocatePar( 500, 3 ) ; + + fill(HcalBarrel, gDDD, geom); + fill(HcalEndcap, gDDD, geom); + fill(HcalForward, gDDD, geom); + fill(HcalOuter, gDDD, geom); + return geom ; } void HcalDDDGeometryLoader::fill(HcalSubdetector subdet, @@ -74,7 +71,7 @@ void HcalDDDGeometryLoader::fill(HcalSubdetector subdet, CaloSubdetectorGeometry* geom ) { // start by making the new HcalDetIds - std::vector hcalCells = numberingFromDDD->HcalCellTypes(subdet); + std::vector hcalCells = hcalConstants->HcalCellTypes(subdet); geometryDDD->insertCell(hcalCells); #ifdef DebugLog LogDebug("HCalGeom") << "HcalDDDGeometryLoader::fill gets " @@ -224,14 +221,11 @@ HcalDDDGeometryLoader::makeCell( const HcalDetId& detId, std::vector hp ; hp.reserve(3) ; - if (subdet==HcalForward) - { + if (subdet==HcalForward) { hp.push_back(deta/2.) ; hp.push_back(dphi/2.) ; hp.push_back(thickness/2.) ; - } - else - { + } else { const double sign ( isBarrel ? 1 : -1 ) ; hp.push_back(deta/2.) ; hp.push_back(dphi/2.) ; diff --git a/Geometry/HcalTowerAlgo/src/HcalFlexiHardcodeGeometryLoader.cc b/Geometry/HcalTowerAlgo/src/HcalFlexiHardcodeGeometryLoader.cc index cd7e181093d66..a1e98c8c07bbc 100644 --- a/Geometry/HcalTowerAlgo/src/HcalFlexiHardcodeGeometryLoader.cc +++ b/Geometry/HcalTowerAlgo/src/HcalFlexiHardcodeGeometryLoader.cc @@ -2,7 +2,9 @@ #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" #include "Geometry/CaloGeometry/interface/IdealObliquePrism.h" #include "Geometry/CaloGeometry/interface/IdealZPrism.h" +#include "Geometry/CaloTopology/interface/HcalTopology.h" #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include @@ -11,157 +13,94 @@ typedef CaloCellGeometry::CCGFloat CCGFloat ; //#define DebugLog // ==============> Loader Itself <========================== -HcalFlexiHardcodeGeometryLoader::HcalFlexiHardcodeGeometryLoader(const edm::ParameterSet& ps) { +HcalFlexiHardcodeGeometryLoader::HcalFlexiHardcodeGeometryLoader(const edm::ParameterSet&) { MAX_HCAL_PHI = 72; DEGREE2RAD = M_PI / 180.; - - edm::ParameterSet ps0 = ps.getParameter("HcalReLabel"); - bool relabel_= ps0.getUntrackedParameter("RelabelHits",false); - if (relabel_) { - edm::ParameterSet ps1 = ps0.getUntrackedParameter("RelabelRules"); - m_segmentation.resize(29); - for (int i=0; i<29; i++) { - char name[10]; - snprintf(name,10,"Eta%d",i+1); - if (i>0) { - m_segmentation[i]=ps1.getUntrackedParameter >(name,m_segmentation[i-1]); - } else { - m_segmentation[i]=ps1.getUntrackedParameter >(name); - } -#ifdef DebugLog - std::cout << name; - for (unsigned int k=0; kcornersMgr() ) hcalGeometry->allocateCorners ( fTopology.ncells() ); if( 0 == hcalGeometry->parMgr() ) hcalGeometry->allocatePar (hcalGeometry->numberOfShapes(), HcalGeometry::k_NumberOfParametersPerShape ) ; if (fTopology.mode() == HcalTopologyMode::H2) { // TB geometry - fillHBHO (hcalGeometry, makeHBCells(fTopology), true); + fillHBHO (hcalGeometry, makeHBCells(hcons), true); fillHBHO (hcalGeometry, makeHOCells(), false); fillHE (hcalGeometry, makeHECells_H2()); - } else { // regular geometry - fillHBHO (hcalGeometry, makeHBCells(fTopology), true); + } else { // regular geometry + fillHBHO (hcalGeometry, makeHBCells(hcons), true); fillHBHO (hcalGeometry, makeHOCells(), false); fillHF (hcalGeometry, makeHFCells()); - fillHE (hcalGeometry, makeHECells(fTopology)); + fillHE (hcalGeometry, makeHECells(hcons)); } return hcalGeometry; } // ----------> HB <----------- -std::vector HcalFlexiHardcodeGeometryLoader::makeHBCells (const HcalTopology & topology) { +std::vector HcalFlexiHardcodeGeometryLoader::makeHBCells (const HcalDDDRecConstants& hcons) { + + std::vector result; + std::vector > gconsHB = hcons.getConstHBHE(0); + std::vector layerDepths; + layerDepths.push_back(gconsHB[0].first-gconsHB[0].second); + for (int i=0; i<17; ++i) + layerDepths.push_back(gconsHB[i].first+gconsHB[i].second); + std::vector etabins = hcons.getEtaBins(0); - const float HBRMIN = 181.1; - const float HBRMAX = 288.8; - - float normalDepths[2] = {HBRMIN, HBRMAX}; - float ring15Depths[3] = {HBRMIN, 258.4, HBRMAX}; - float ring16Depths[3] = {HBRMIN, 190.4, 232.6}; - float layerDepths[18] = {HBRMIN, 188.7, 194.7, 200.7, 206.7, 212.7, 218.7, - 224.7, 230.7, 236.7, 242.7, 249.3, 255.9, 262.5, - 269.1, 275.7, 282.3, HBRMAX}; - float slhcDepths[4] = {HBRMIN, 214., 239., HBRMAX}; -#ifdef DebugLog - std::cout <<"FlexiGeometryLoader called for "<< topology.mode() << ":" << HcalTopologyMode::SLHC << std::endl; -#endif - std::vector result; - for(int iring = 1; iring <= 16; ++iring) { - std::vector depths; - if (topology.mode() != HcalTopologyMode::SLHC) { - if (iring == 15) { - for (int i=0; i<3; ++i) depths.push_back(ring15Depths[i]); - } else if (iring == 16) { - for (int i=0; i<3; ++i) depths.push_back(ring16Depths[i]); - } else { - for (int i=0; i<2; ++i) depths.push_back(normalDepths[i]); - } - } else { - if (m_segmentation.size() >= (unsigned int)(iring)) { - int depth = m_segmentation[iring-1][0]; - depths.push_back(layerDepths[depth]); - int layer = 1; - for (unsigned int i=1; i= 17) break; - } - if (layer <= 17) depths.push_back(HBRMAX); - } else { - for (int i=0; i<4; ++i) { - if (iring != 16 || i < 3) { - depths.push_back(slhcDepths[i]); - } - } - } - } - unsigned int ndepth=depths.size()-1; - unsigned int startingDepth=1; - float etaMin=(iring-1)*0.087; - float etaMax=iring*0.087; - // topology.depthBinInformation(HcalBarrel, iring, ndepth, startingDepth); #ifdef DebugLog - std::cout << "HBRing " << iring << " eta " << etaMin << ":" << etaMax << " depths " << ndepth << ":" << startingDepth; - for (unsigned int i=0; i HO <----------- -std::vector HcalFlexiHardcodeGeometryLoader::makeHOCells () { - const float HORMIN0 = 390.0; - const float HORMIN1 = 412.6; - const float HORMAX = 413.6; - - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters cells [] = { - // eta, depth, firstPhi, stepPhi, deltaPhi, rMin, rMax, etaMin, etaMax - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters ( 1, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*0, 0.087*1), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters ( 2, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*1, 0.087*2), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters ( 3, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*2, 0.087*3), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters ( 4, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*3, 0.3075), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters ( 5, 4, 1, 1, 5, HORMIN1, HORMAX, 0.3395, 0.087*5), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters ( 6, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*5, 0.087*6), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters ( 7, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*6, 0.087*7), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters ( 8, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*7, 0.087*8), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters ( 9, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*8, 0.087*9), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters (10, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*9, 0.8494), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters (11, 4, 1, 1, 5, HORMIN1, HORMAX, 0.873, 0.087*11), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters (12, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*11, 0.087*12), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters (13, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*12, 0.087*13), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters (14, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*13, 0.087*14), - HcalFlexiHardcodeGeometryLoader::HBHOCellParameters (15, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*14, 0.087*15) - }; - int nCells = sizeof(cells)/sizeof(HcalFlexiHardcodeGeometryLoader::HBHOCellParameters); - std::vector result; +std::vector HcalFlexiHardcodeGeometryLoader::makeHOCells () { + const double HORMIN0 = 390.0; + const double HORMIN1 = 412.6; + const double HORMAX = 413.6; + const int nCells = 15; + const double etamin[nCells] = {0.000,0.087,0.174, 0.261, 0.3395,0.435,0.522, + 0.609,0.696,0.783, 0.873, 0.957, 1.044,1.131, + 1.218}; + const double etamax[nCells] = {0.087,0.174,0.261, 0.3075,0.435, 0.522,0.609, + 0.696,0.783,0.8494,0.957, 1.044, 1.131,1.218, + 1.305}; + std::vector result; result.reserve (nCells); - for (int i = 0; i < nCells; ++i) result.push_back (cells[i]); + double dphi = 5*DEGREE2RAD; + for (int i = 0; i < nCells; ++i) { + double rmin = ((i < 4) ? HORMIN0 : HORMIN1); + // eta, depth, firstPhi, stepPhi, deltaPhi, rMin, rMax, etaMin, etaMax + result.push_back (HcalFlexiHardcodeGeometryLoader::HBHOCellParameters(i+1, 4, 1, 72, 1, 0, dphi, rmin, HORMAX, etamin[i], etamax[i])); + } return result; } @@ -169,14 +108,14 @@ std::vector HcalFlexiHardc // // Convert constants to appropriate cells // -void HcalFlexiHardcodeGeometryLoader::fillHBHO (CaloSubdetectorGeometry* fGeometry, const std::vector & fCells, bool fHB) { +void HcalFlexiHardcodeGeometryLoader::fillHBHO (CaloSubdetectorGeometry* fGeometry, const std::vector& fCells, bool fHB) { for (size_t iCell = 0; iCell < fCells.size(); ++iCell) { const HcalFlexiHardcodeGeometryLoader::HBHOCellParameters& param = fCells[iCell]; - for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) { + for (int iPhi = param.phiFirst; iPhi <= param.nPhi; iPhi += param.phiStep) { for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical HcalDetId hid (fHB ? HcalBarrel : HcalOuter, param.eta*iside, iPhi, param.depth); - float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; // middle of the cell + float phiCenter = param.phiStart+(iPhi-0.5)*param.dphi; // middle of the cell float etaCenter = 0.5*(param.etaMin + param.etaMax); float x = param.rMin* cos (phiCenter); float y = param.rMin* sin (phiCenter); @@ -186,12 +125,12 @@ void HcalFlexiHardcodeGeometryLoader::fillHBHO (CaloSubdetectorGeometry* fGeomet std::vector cellParams; cellParams.reserve (5); cellParams.push_back (0.5 * (param.etaMax - param.etaMin)); // deta_half - cellParams.push_back (0.5 * param.dphi * DEGREE2RAD); // dphi_half + cellParams.push_back (0.5 * param.dphi); // dphi_half cellParams.push_back (0.5 * (param.rMax - param.rMin) * cosh (etaCenter)); // dr_half cellParams.push_back ( fabs( refPoint.eta() ) ) ; cellParams.push_back ( fabs( refPoint.z() ) ) ; #ifdef DebugLog - std::cout << "HcalFlexiHardcodeGeometryLoader::fillHBHO-> " << hid << hid.ieta() << '/' << hid.iphi() << '/' << hid.depth() << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl; + std::cout << "HcalFlexiHardcodeGeometryLoader::fillHBHO-> " << hid << " " << hid.rawId() << " " << std::hex << hid.rawId() << std::dec << " " << hid.ieta() << '/' << hid.iphi() << '/' << hid.depth() << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl; #endif fGeometry->newCell(refPoint, refPoint, refPoint, CaloCellGeometry::getParmPtr(cellParams, @@ -205,110 +144,64 @@ void HcalFlexiHardcodeGeometryLoader::fillHBHO (CaloSubdetectorGeometry* fGeomet // ----------> HE <----------- -std::vector HcalFlexiHardcodeGeometryLoader::makeHECells (const HcalTopology & topology) { +std::vector HcalFlexiHardcodeGeometryLoader::makeHECells (const HcalDDDRecConstants& hcons) { - std::vector result; - const float HEZMIN = 400.458; - const float HEZMID = 436.168; - const float HEZMAX = 549.268; - float normalDepths[3] = {HEZMIN, HEZMID, HEZMAX}; - float tripleDepths[4] = {HEZMIN, 418.768, HEZMID, HEZMAX}; - float slhcDepths[5] = {HEZMIN, 418.768, HEZMID, 493., HEZMAX}; - float ring16Depths[2] = {418.768,470.968}; - float ring16slhcDepths[3] = {418.768, 450., 470.968}; - float ring17Depths[2] = {409.698,514.468}; - float ring17slhcDepths[5] = {409.698, 435., 460., 495., 514.468}; - float ring18Depths[3] = {391.883,427.468,540.568}; - float ring18slhcDepths[5] = {391.883, 439., 467., 504. , 540.568}; - float etaBounds[] = {0.087*15, 0.087*16, 0.087*17, 0.087*18, 0.087*19, - 1.74, 1.83, 1.93, 2.043, 2.172, 2.322, 2.500, - 2.650, 2.868, 3.000}; - float layerDepths[19] = {HEZMIN, 408.718, 416.978, 425.248, 433.508, 441.768, - 450.038,458.298, 466.558, 474.828, 483.088, 491.348, - 499.618,507.878, 516.138, 524.398, 532.668, 540.928, - HEZMAX}; - - // count by ring - 16 - for(int iringm16=0; iringm16 <= 13; ++iringm16) { - int iring = iringm16 + 16; - std::vector depths; - unsigned int startingDepth = 1; - if (topology.mode() != HcalTopologyMode::SLHC) { - if (iring == 16) - {for (int i=0; i<2; ++i) depths.push_back(ring16Depths[i]); startingDepth = 3;} - else if (iring == 17) - for (int i=0; i<2; ++i) depths.push_back(ring17Depths[i]); - else if (iring == 18) - for (int i=0; i<3; ++i) depths.push_back(ring18Depths[i]); - else if (iring == topology.lastHERing()) - for (int i=0; i<3; ++i) depths.push_back(tripleDepths[i]); - else if (iring >= topology.firstHETripleDepthRing()) - for (int i=0; i<4; ++i) depths.push_back(tripleDepths[i]); - else - for (int i=0; i<3; ++i) depths.push_back(normalDepths[i]); - } else { - if (m_segmentation.size() >= (unsigned int)(iring)) { - int depth = m_segmentation[iring-1][0]; - if (iring == 16) depths.push_back(ring16Depths[0]); - else if (iring == 17) depths.push_back(ring17Depths[0]); - else if (iring == 18) depths.push_back(ring18Depths[0]); - else depths.push_back(layerDepths[depth]); - int layer = 1; - float lastDepth = depths[0]; - for (unsigned int i=1; i lastDepth && (iring != 16 || depth > 3)) { - depths.push_back(layerDepths[depth]); - lastDepth = layerDepths[depth]; - } - } - } - if (layer <= 17) depths.push_back(HEZMAX); - if (iring == 16) startingDepth = 3; - } else { - if (iring == 16) {for (int i=0; i<3; ++i) depths.push_back(ring16slhcDepths[i]); startingDepth = 3;} - else if (iring == 17) for (int i=0; i<5; ++i) depths.push_back(ring17slhcDepths[i]); - else if (iring == 18) for (int i=0; i<5; ++i) depths.push_back(ring18slhcDepths[i]); - else for (int i=0; i<5; ++i) depths.push_back(slhcDepths[i]); - } - } - float etamin = etaBounds[iringm16]; - float etamax = etaBounds[iringm16+1]; - unsigned int ndepth = depths.size()-1; - // topology.depthBinInformation(HcalEndcap, iring, ndepth, startingDepth); -#ifdef DebugLog - std::cout << "HERing " << iring << " eta " << etamin << ":" << etamax << " depths " << ndepth << ":" << startingDepth; - for (unsigned int i=0; i result; + std::vector > gconsHE = hcons.getConstHBHE(1); + std::vector layerDepths; #ifdef DebugLog - std::cout << "HE Depth " << idepth << ":" << depthIndex << " Z " << zmin << ":" << zmax << "\n"; + std::cout << "HcalFlexiHardcodeGeometryLoader:HE with " << gconsHE.size() << " cells" << std::endl; #endif - int stepPhi = (iring >= topology.firstHEDoublePhiRing() ? 2 : 1); - int deltaPhi = (iring >= topology.firstHEDoublePhiRing() ? 10 : 5); - if (topology.mode() != HcalTopologyMode::SLHC && - iring == topology.lastHERing()-1 && idepth == ndepth-1) { + if (gconsHE.size() > 0) { + unsigned int istart = 1; + layerDepths.push_back(gconsHE[istart].first-gconsHE[istart].second); + for (unsigned int i=istart; i etabins = hcons.getEtaBins(1); + #ifdef DebugLog - std::cout << "HE iEta " << iring << " Depth " << depthIndex << " Eta " << etamin << ":" << etaBounds[iringm16+2] << std::endl; + std::cout << "FlexiGeometryLoader called for HE with " << etabins.size() + << " Eta Bins and " << layerDepths.size() << " depths" + << std::endl; + for (unsigned int i=0; i HcalFlexiHardcode // ----------> HE @ H2 <----------- std::vector HcalFlexiHardcodeGeometryLoader::makeHECells_H2 () { - const float HEZMIN_H2 = 400.715; - const float HEZMID_H2 = 436.285; - const float HEZMAX_H2 = 541.885; + const double HEZMIN_H2 = 400.715; + const double HEZMID_H2 = 436.285; + const double HEZMAX_H2 = 541.885; + const double dphi1 = 5*DEGREE2RAD; + const double dphi2 = 2*dphi1; HcalFlexiHardcodeGeometryLoader::HECellParameters cells [] = { - // eta, depth, firstPhi, stepPhi, deltaPhi, zMin, zMax, etaMin, etaMax - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 16, 3, 1, 1, 5, 409.885, 462.685, 1.305, 1.373), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 17, 1, 1, 1, 5, HEZMIN_H2, 427.485, 1.373, 1.444), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 17, 2, 1, 1, 5, 427.485, 506.685, 1.373, 1.444), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 18, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.444, 1.521), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 18, 2, 1, 1, 5, HEZMID_H2, 524.285, 1.444, 1.521), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 19, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.521, 1.603), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 19, 2, 1, 1, 5, HEZMID_H2, HEZMAX_H2, 1.521, 1.603), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 20, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.603, 1.693), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 20, 2, 1, 1, 5, HEZMID_H2, HEZMAX_H2, 1.603, 1.693), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 21, 1, 1, 2, 5, HEZMIN_H2, HEZMID_H2, 1.693, 1.79), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 21, 2, 1, 2, 5, HEZMID_H2, HEZMAX_H2, 1.693, 1.79), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 22, 1, 1, 2,10, HEZMIN_H2, HEZMID_H2, 1.79, 1.88), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 22, 2, 1, 2,10, HEZMID_H2, HEZMAX_H2, 1.79, 1.88), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 23, 1, 1, 2,10, HEZMIN_H2, HEZMID_H2, 1.88, 1.98), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 23, 2, 1, 2,10, HEZMID_H2, HEZMAX_H2, 1.88, 1.98), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 24, 1, 1, 2,10, HEZMIN_H2, 418.685, 1.98, 2.09), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 24, 2, 1, 2,10, 418.685, HEZMID_H2, 1.98, 2.09), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 24, 3, 1, 2,10, HEZMID_H2, HEZMAX_H2, 1.98, 2.09), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 25, 1, 1, 2,10, HEZMIN_H2, 418.685, 2.09, 2.21), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 25, 2, 1, 2,10, 418.685, HEZMID_H2, 2.09, 2.21), - HcalFlexiHardcodeGeometryLoader::HECellParameters ( 25, 3, 1, 2,10, HEZMID_H2, HEZMAX_H2, 2.09, 2.21) + // eta, depth, firstPhi, nPhi, stepPhi, phiStart, deltaPhi, zMin, zMax, etaMin, etaMax + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 16, 3, 1, 8, 1, 0, dphi1, 409.885, 462.685, 1.305, 1.373), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 17, 1, 1, 8, 1, 0, dphi1, HEZMIN_H2, 427.485, 1.373, 1.444), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 17, 2, 1, 8, 1, 0, dphi1, 427.485, 506.685, 1.373, 1.444), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 18, 1, 1, 8, 1, 0, dphi1, HEZMIN_H2, HEZMID_H2, 1.444, 1.521), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 18, 2, 1, 8, 1, 0, dphi1, HEZMID_H2, 524.285, 1.444, 1.521), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 19, 1, 1, 8, 1, 0, dphi1, HEZMIN_H2, HEZMID_H2, 1.521, 1.603), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 19, 2, 1, 8, 1, 0, dphi1, HEZMID_H2, HEZMAX_H2, 1.521, 1.603), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 20, 1, 1, 8, 1, 0, dphi1, HEZMIN_H2, HEZMID_H2, 1.603, 1.693), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 20, 2, 1, 8, 1, 0, dphi1, HEZMID_H2, HEZMAX_H2, 1.603, 1.693), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 21, 1, 1, 8, 2, 0, dphi1, HEZMIN_H2, HEZMID_H2, 1.693, 1.79), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 21, 2, 1, 8, 2, 0, dphi1, HEZMID_H2, HEZMAX_H2, 1.693, 1.79), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 22, 1, 1, 8, 2, 0, dphi2, HEZMIN_H2, HEZMID_H2, 1.79, 1.88), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 22, 2, 1, 8, 2, 0, dphi2, HEZMID_H2, HEZMAX_H2, 1.79, 1.88), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 23, 1, 1, 8, 2, 0, dphi2, HEZMIN_H2, HEZMID_H2, 1.88, 1.98), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 23, 2, 1, 8, 2, 0, dphi2, HEZMID_H2, HEZMAX_H2, 1.88, 1.98), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 24, 1, 1, 8, 2, 0, dphi2, HEZMIN_H2, 418.685, 1.98, 2.09), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 24, 2, 1, 8, 2, 0, dphi2, 418.685, HEZMID_H2, 1.98, 2.09), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 24, 3, 1, 8, 2, 0, dphi2, HEZMID_H2, HEZMAX_H2, 1.98, 2.09), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 25, 1, 1, 8, 2, 0, dphi2, HEZMIN_H2, 418.685, 2.09, 2.21), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 25, 2, 1, 8, 2, 0, dphi2, 418.685, HEZMID_H2, 2.09, 2.21), + HcalFlexiHardcodeGeometryLoader::HECellParameters ( 25, 3, 1, 8, 2, 0, dphi2, HEZMID_H2, HEZMAX_H2, 2.09, 2.21) }; int nCells = sizeof(cells)/sizeof(HcalFlexiHardcodeGeometryLoader::HECellParameters); std::vector result; @@ -398,10 +293,11 @@ void HcalFlexiHardcodeGeometryLoader::fillHE (CaloSubdetectorGeometry* fGeometry for (size_t iCell = 0; iCell < fCells.size(); ++iCell) { const HcalFlexiHardcodeGeometryLoader::HECellParameters& param = fCells[iCell]; - for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) { + int kPhi(param.phiFirst); + for (int iPhi = param.phiFirst; iPhi <= param.nPhi; iPhi += param.phiStep, ++kPhi) { for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical HcalDetId hid (HcalEndcap, param.eta*iside, iPhi, param.depth); - float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; // middle of the cell + float phiCenter = param.phiStart + (kPhi-0.5)*param.dphi; // middle of the cell float etaCenter = 0.5 * (param.etaMin + param.etaMax); float perp = param.zMin / sinh (etaCenter); @@ -413,12 +309,12 @@ void HcalFlexiHardcodeGeometryLoader::fillHE (CaloSubdetectorGeometry* fGeometry std::vector cellParams; cellParams.reserve (5); cellParams.push_back (0.5 * (param.etaMax - param.etaMin)); //deta_half - cellParams.push_back (0.5 * param.dphi * DEGREE2RAD); // dphi_half + cellParams.push_back (0.5 * param.dphi); // dphi_half cellParams.push_back (-0.5 * (param.zMax - param.zMin) / tanh (etaCenter)); // dz_half, "-" means edges in Z cellParams.push_back ( fabs( refPoint.eta() ) ) ; cellParams.push_back ( fabs( refPoint.z() ) ) ; #ifdef DebugLog - std::cout << "HcalFlexiHardcodeGeometryLoader::fillHE-> " << hid << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl; + std::cout << "HcalFlexiHardcodeGeometryLoader::fillHE-> " << hid << " " << hid.rawId() << " " << std::hex << hid.rawId() << std::dec << " " << hid.ieta() << '/' << hid.iphi() << '/' << hid.depth() << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl; #endif fGeometry->newCell(refPoint, refPoint, refPoint, CaloCellGeometry::getParmPtr(cellParams, @@ -434,10 +330,13 @@ void HcalFlexiHardcodeGeometryLoader::fillHF (CaloSubdetectorGeometry* fGeometry for (size_t iCell = 0; iCell < fCells.size(); ++iCell) { const HcalFlexiHardcodeGeometryLoader::HFCellParameters& param = fCells[iCell]; +// int kPhi(0); for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) { for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical HcalDetId hid (HcalForward, param.eta*iside, iPhi, param.depth); - float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; // middle of the cell + // middle of the cell +// float phiCenter = ((kPhi + 0.5) * param.dphi) * DEGREE2RAD; + float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; GlobalPoint inner (param.rMin, 0, param.zMin); GlobalPoint outer (param.rMax, 0, param.zMin); float iEta = inner.eta(); @@ -458,7 +357,7 @@ void HcalFlexiHardcodeGeometryLoader::fillHF (CaloSubdetectorGeometry* fGeometry cellParams.push_back ( fabs( refPoint.eta())); cellParams.push_back ( fabs( refPoint.z() ) ) ; #ifdef DebugLog - std::cout << "HcalFlexiHardcodeGeometryLoader::fillHF-> " << hid << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl; + std::cout << "HcalFlexiHardcodeGeometryLoader::fillHF-> " << hid << " " << hid.rawId() << " " << std::hex << hid.rawId() << std::dec << " " << hid.ieta() << '/' << hid.iphi() << '/' << hid.depth() << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl; #endif fGeometry->newCell(refPoint, refPoint, refPoint, CaloCellGeometry::getParmPtr(cellParams, diff --git a/Geometry/HcalTowerAlgo/src/HcalGeometry.cc b/Geometry/HcalTowerAlgo/src/HcalGeometry.cc index 9db44d034f80c..4d9a59f2f835e 100644 --- a/Geometry/HcalTowerAlgo/src/HcalGeometry.cc +++ b/Geometry/HcalTowerAlgo/src/HcalGeometry.cc @@ -1,6 +1,5 @@ #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" -#include "Geometry/HcalTowerAlgo//src/HcalHardcodeGeometryData.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include @@ -12,7 +11,7 @@ typedef CaloCellGeometry::Pt3D Pt3D ; typedef CaloCellGeometry::Pt3DVec Pt3DVec ; typedef CaloCellGeometry::Tr3D Tr3D ; -HcalGeometry::HcalGeometry( const HcalTopology& topology ) : +HcalGeometry::HcalGeometry(const HcalTopology& topology) : theTopology( topology ) { init(); } @@ -32,105 +31,82 @@ void HcalGeometry::init() { m_hfCellVec = HFCellVec( theTopology.getHFSize() ) ; } -void -HcalGeometry::fillDetIds() const -{ - if(!m_emptyIds.isSet()) { - std::unique_ptr> p_hbIds{new std::vector}; - std::unique_ptr> p_heIds{new std::vector}; - std::unique_ptr> p_hoIds{new std::vector}; - std::unique_ptr> p_hfIds{new std::vector}; - std::unique_ptr> p_emptyIds{new std::vector}; - - const std::vector& baseIds ( CaloSubdetectorGeometry::getValidDetIds() ) ; - for( unsigned int i ( 0 ) ; i != baseIds.size() ; ++i ) - { - const DetId id ( baseIds[i] ); - if( id.subdetId() == HcalBarrel ) - { - p_hbIds->push_back( id ) ; - } - else - { - if( id.subdetId() == HcalEndcap ) - { - p_heIds->push_back( id ) ; - } - else - { - if( id.subdetId() == HcalOuter ) - { - p_hoIds->push_back( id ) ; - } - else - { - if( id.subdetId() == HcalForward ) - { - p_hfIds->push_back( id ) ; - } - } - } - } - } - std::sort( p_hbIds->begin(), p_hbIds->end() ) ; - std::sort( p_heIds->begin(), p_heIds->end() ) ; - std::sort( p_hoIds->begin(), p_hoIds->end() ) ; - std::sort( p_hfIds->begin(), p_hfIds->end() ) ; - p_emptyIds->resize( 0 ) ; - - m_hbIds.set(std::move(p_hbIds)); - m_heIds.set(std::move(p_heIds)); - m_hoIds.set(std::move(p_hoIds)); - m_hfIds.set(std::move(p_hfIds)); - m_emptyIds.set(std::move(p_emptyIds)); - } +void HcalGeometry::fillDetIds() const { + if(!m_emptyIds.isSet()) { + std::unique_ptr> p_hbIds{new std::vector}; + std::unique_ptr> p_heIds{new std::vector}; + std::unique_ptr> p_hoIds{new std::vector}; + std::unique_ptr> p_hfIds{new std::vector}; + std::unique_ptr> p_emptyIds{new std::vector}; + + const std::vector& baseIds (CaloSubdetectorGeometry::getValidDetIds()); + for (unsigned int i ( 0 ) ; i != baseIds.size() ; ++i) { + const DetId id ( baseIds[i] ); + if (id.subdetId() == HcalBarrel) { + p_hbIds->push_back( id ) ; + } else if (id.subdetId() == HcalEndcap) { + p_heIds->push_back( id ) ; + } else if (id.subdetId() == HcalOuter) { + p_hoIds->push_back( id ) ; + } else if (id.subdetId() == HcalForward) { + p_hfIds->push_back( id ) ; + } + } + std::sort( p_hbIds->begin(), p_hbIds->end() ) ; + std::sort( p_heIds->begin(), p_heIds->end() ) ; + std::sort( p_hoIds->begin(), p_hoIds->end() ) ; + std::sort( p_hfIds->begin(), p_hfIds->end() ) ; + p_emptyIds->resize( 0 ) ; + + m_hbIds.set(std::move(p_hbIds)); + m_heIds.set(std::move(p_heIds)); + m_hoIds.set(std::move(p_hoIds)); + m_hfIds.set(std::move(p_hfIds)); + m_emptyIds.set(std::move(p_emptyIds)); + } } const std::vector& HcalGeometry::getValidDetIds( DetId::Detector det, - int subdet ) const -{ - if( 0 != subdet && !m_hbIds.isSet() ) fillDetIds() ; - return ( 0 == subdet ? CaloSubdetectorGeometry::getValidDetIds() : - ( HcalBarrel == subdet ? *m_hbIds.load() : - ( HcalEndcap == subdet ? *m_heIds.load() : - ( HcalOuter == subdet ? *m_hoIds.load() : - ( HcalForward == subdet ? *m_hfIds.load() : *m_emptyIds.load() ) ) ) ) ) ; + int subdet ) const { + if( 0 != subdet && !m_hbIds.isSet() ) fillDetIds() ; + return ( 0 == subdet ? CaloSubdetectorGeometry::getValidDetIds() : + ( HcalBarrel == subdet ? *m_hbIds.load() : + ( HcalEndcap == subdet ? *m_heIds.load() : + ( HcalOuter == subdet ? *m_hoIds.load() : + ( HcalForward == subdet ? *m_hfIds.load() : *m_emptyIds.load() ) ) ) ) ) ; } DetId HcalGeometry::getClosestCell(const GlobalPoint& r) const { // Now find the closest eta_bin, eta value of a bin i is average // of eta[i] and eta[i-1] + static const double z_long=1100.0; double abseta = fabs(r.eta()); + double absz = fabs(r.z()); // figure out subdetector, giving preference to HE in HE/HF overlap region HcalSubdetector bc= HcalEmpty; - if (abseta <= theHBHEEtaBounds[theTopology.lastHBRing()] ) { + if (abseta <= theTopology.etaMax(HcalBarrel) ) { bc = HcalBarrel; - } else if (abseta <= theHBHEEtaBounds[theTopology.lastHERing()] ) { + } else if (absz >= z_long) { + bc = HcalForward; + } else if (theTopology.etaMax(HcalEndcap) ) { bc = HcalEndcap; } else { bc = HcalForward; } + // find eta bin + int etaring = etaRing(bc, abseta); + + int phibin = phiBin(bc, etaring, r.phi()); + + // add a sign to the etaring + int etabin = (r.z() > 0) ? etaring : -etaring; + if (bc == HcalForward) { static const double z_short=1137.0; - int etaring = etaRing(bc, abseta); // This is safer - /* - static const double z_long=1115.0; - // determine front-face eta - double radius=sqrt(pow(r.x(),2)+pow(r.y(),2)); - double trueAeta=asinh(z_long/radius); - // find eta bin - int etaring = etaRing(bc, trueAeta); - */ - if (etaring>theTopology.lastHFRing()) etaring=theTopology.lastHFRing(); - - int phibin = phiBin(r.phi(), etaring); - - // add a sign to the etaring - int etabin = (r.z() > 0) ? etaring : -etaring; // Next line is premature depth 1 and 2 can coexist for large z-extent // HcalDetId bestId(bc,etabin,phibin,((fabs(r.z())>=z_short)?(2):(1))); // above line is no good with finite precision @@ -138,14 +114,6 @@ DetId HcalGeometry::getClosestCell(const GlobalPoint& r) const { return bestId; } else { - // find eta bin - int etaring = etaRing(bc, abseta); - - int phibin = phiBin(r.phi(), etaring); - - // add a sign to the etaring - int etabin = (r.z() > 0) ? etaring : -etaring; - //Now do depth if required int dbin = 1; double pointrz=0, drz=99999.; @@ -153,22 +121,19 @@ DetId HcalGeometry::getClosestCell(const GlobalPoint& r) const { if (bc == HcalBarrel) pointrz = r.mag(); else pointrz = std::abs(r.z()); HcalDetId bestId; -// std::cout << "Current ID " << currentId << std::endl; for ( ; currentId != HcalDetId(); theTopology.incrementDepth(currentId)) { -// std::cout << "Incremented Current ID " << currentId << std::endl; const CaloCellGeometry * cell = getGeometry(currentId); if (cell == 0) { -// std::cout << "Cell 0 for " << currentId << " Best " << bestId << " dummy " << HcalDetId() << std::endl; - assert (bestId != HcalDetId()); - break; + assert (bestId != HcalDetId()); + break; } else { - double rz; - if (bc == HcalEndcap) rz = std::abs(cell->getPosition().z()); - else rz = cell->getPosition().mag(); - if (std::abs(pointrz-rz)getPosition().z()); + else rz = cell->getPosition().mag(); + if (std::abs(pointrz-rz) abseta) break; - } - } - else - { - for(etaring = 1; - etaring <= theTopology.lastHERing(); ++etaring) - { - if(theHBHEEtaBounds[etaring] >= abseta) break; - } - } - - return etaring; +int HcalGeometry::etaRing(HcalSubdetector bc, double abseta) const { + return theTopology.etaRing(bc, abseta); } -int -HcalGeometry::phiBin(double phi, int etaring) const -{ - constexpr double twopi = M_PI+M_PI; - //put phi in correct range (0->2pi) - if(phi<0.0) phi += twopi; - if(phi>twopi) phi -= twopi; - int nphibins = theTopology.nPhiBins(etaring); - int phibin= static_cast(phi/twopi*nphibins)+1; - int iphi; - - // rings 40 and 41 are offset wrt the other phi numbering - // 1 1 1 2 - // ------------------------------ - // 72 36 36 1 - if(etaring >= theTopology.firstHFQuadPhiRing()) - { - phi+=(twopi/36); //shift by half tower. - phibin=static_cast(phi/twopi*nphibins); - if (phibin==0) phibin=18; - iphi=phibin*4-1; // 71,3,5, - } else { - // convert to the convention of numbering 1,3,5, in 36 phi bins - iphi=(phibin-1)*(72/nphibins) + 1; - } - - return iphi; +int HcalGeometry::phiBin(HcalSubdetector bc, int etaring, double phi) const { + return theTopology.phiBin(bc, etaring, phi); } -CaloSubdetectorGeometry::DetIdSet -HcalGeometry::getCells( const GlobalPoint& r, - double dR ) const -{ - CaloSubdetectorGeometry::DetIdSet dis; // this is the return object - - if( 0.000001 < dR ) - { - if( dR > M_PI/2. ) // this version needs "small" dR - { - dis = CaloSubdetectorGeometry::getCells( r, dR ) ; // base class version - } - else - { - const double dR2 ( dR*dR ) ; - const double reta ( r.eta() ) ; - const double rphi ( r.phi() ) ; - const double lowEta ( reta - dR ) ; - const double highEta ( reta + dR ) ; - const double lowPhi ( rphi - dR ) ; - const double highPhi ( rphi + dR ) ; - - const double hfEtaHi ( theHFEtaBounds[ theTopology.lastHFRing() - - theTopology.firstHFRing() + 1 ] ) ; +CaloSubdetectorGeometry::DetIdSet HcalGeometry::getCells(const GlobalPoint& r, + double dR ) const { + CaloSubdetectorGeometry::DetIdSet dis; // this is the return object + + if (0.000001 < dR) { + if (dR > M_PI/2.) {// this version needs "small" dR + dis = CaloSubdetectorGeometry::getCells(r, dR); // base class version + } else { + const double dR2 ( dR*dR ) ; + const double reta ( r.eta() ) ; + const double rphi ( r.phi() ) ; + const double lowEta ( reta - dR ) ; + const double highEta ( reta + dR ) ; + const double lowPhi ( rphi - dR ) ; + const double highPhi ( rphi + dR ) ; + + const double hfEtaHi (theTopology.etaMax(HcalForward)); - if( highEta > -hfEtaHi && - lowEta < hfEtaHi ) // in hcal - { - const HcalSubdetector hs[] = { HcalBarrel, HcalOuter, HcalEndcap, HcalForward } ; - - for( unsigned int is ( 0 ) ; is != 4 ; ++is ) - { - const int sign ( reta>0 ? 1 : -1 ) ; - const int ieta_center ( sign*etaRing( hs[is], fabs( reta ) ) ) ; - const int ieta_lo ( ( 0 < lowEta*sign ? sign : -sign )*etaRing( hs[is], fabs( lowEta ) ) ) ; - const int ieta_hi ( ( 0 < highEta*sign ? sign : -sign )*etaRing( hs[is], fabs( highEta ) ) ) ; - const int iphi_lo ( phiBin( lowPhi , ieta_center ) ) ; - const int iphi_hi ( phiBin( highPhi, ieta_center ) ) ; - const int jphi_lo ( iphi_lo>iphi_hi ? iphi_lo - 72 : iphi_lo ) ; - const int jphi_hi ( iphi_hi ) ; - - const int idep_lo ( 1 == is ? 4 : 1 ) ; - const int idep_hi ( 1 == is ? 4 : - ( 2 == is ? 3 : 2 ) ) ; - for( int ieta ( ieta_lo ) ; ieta <= ieta_hi ; ++ieta ) // over eta limits - { - if( ieta != 0 ) - { - for( int jphi ( jphi_lo ) ; jphi <= jphi_hi ; ++jphi ) // over phi limits - { - const int iphi ( 1 > jphi ? jphi+72 : jphi ) ; - - for( int idep ( idep_lo ) ; idep <= idep_hi ; ++idep ) - { - const HcalDetId did ( hs[is], ieta, iphi, idep ) ; - if( theTopology.valid(did) ) - - { - const CaloCellGeometry* cell ( getGeometry( did ) ); - if( 0 != cell ) - { - const GlobalPoint& p ( cell->getPosition() ) ; - const double eta ( p.eta() ) ; - const double phi ( p.phi() ) ; - if( reco::deltaR2( eta, phi, reta, rphi ) < dR2 ) dis.insert( did ) ; - } - } - } + if (highEta > -hfEtaHi && + lowEta < hfEtaHi ) { // in hcal + const HcalSubdetector hs[] = {HcalBarrel, HcalOuter, HcalEndcap, HcalForward } ; + + for (unsigned int is ( 0 ) ; is != 4 ; ++is ) { + const int sign ( reta>0 ? 1 : -1 ) ; + const int ieta_center ( sign*etaRing( hs[is], fabs( reta ) ) ) ; + const int ieta_lo ( ( 0 < lowEta*sign ? sign : -sign )*etaRing( hs[is], fabs( lowEta ) ) ) ; + const int ieta_hi ( ( 0 < highEta*sign ? sign : -sign )*etaRing( hs[is], fabs( highEta ) ) ) ; + const int iphi_lo ( phiBin( hs[is], ieta_center, lowPhi ) ) ; + const int iphi_hi ( phiBin( hs[is], ieta_center, highPhi ) ) ; + const int jphi_lo ( iphi_lo>iphi_hi ? iphi_lo - 72 : iphi_lo ) ; + const int jphi_hi ( iphi_hi ) ; + + const int idep_lo ( 1 == is ? 4 : 1 ) ; + const int idep_hi ( theTopology.maxDepth(hs[is]) ); + for (int ieta ( ieta_lo ) ; ieta <= ieta_hi ; ++ieta) {// over eta limits + if (ieta != 0) { + for (int jphi ( jphi_lo ) ; jphi <= jphi_hi ; ++jphi) { // over phi limits + const int iphi ( 1 > jphi ? jphi+72 : jphi ) ; + for (int idep ( idep_lo ) ; idep <= idep_hi ; ++idep ) { + const HcalDetId did ( hs[is], ieta, iphi, idep ) ; + if (theTopology.valid(did)) { + const CaloCellGeometry* cell ( getGeometry( did ) ); + if (0 != cell ) { + const GlobalPoint& p ( cell->getPosition() ) ; + const double eta ( p.eta() ) ; + const double phi ( p.phi() ) ; + if (reco::deltaR2(eta, phi, reta, rphi ) < dR2) dis.insert( did ) ; } - } + } + } } - } + } + } } - } + } + } } return dis; } -DetId -HcalGeometry::detIdFromBarrelAlignmentIndex( unsigned int i ) -{ +DetId HcalGeometry::detIdFromBarrelAlignmentIndex(unsigned int i) { assert( i < numberOfBarrelAlignments() ) ; const int ieta ( i < numberOfBarrelAlignments()/2 ? -1 : 1 ) ; const int iphi ( 1 + (4*i)%72 ) ; return HcalDetId( HcalBarrel, ieta, iphi, 1 ) ; } -DetId -HcalGeometry::detIdFromEndcapAlignmentIndex( unsigned int i ) -{ +DetId HcalGeometry::detIdFromEndcapAlignmentIndex(unsigned int i) { assert( i < numberOfEndcapAlignments() ) ; const int ieta ( i < numberOfEndcapAlignments()/2 ? -16 : 16 ) ; const int iphi ( 1 + (4*i)%72 ) ; return HcalDetId( HcalEndcap, ieta, iphi, 1 ) ; } -DetId -HcalGeometry::detIdFromForwardAlignmentIndex( unsigned int i ) -{ +DetId HcalGeometry::detIdFromForwardAlignmentIndex(unsigned int i) { assert( i < numberOfForwardAlignments() ) ; const int ieta ( i < numberOfForwardAlignments()/2 ? -29 : 29 ) ; const int iphi ( 1 + (4*i)%72 ) ; return HcalDetId( HcalForward, ieta, iphi, 1 ) ; } -DetId -HcalGeometry::detIdFromOuterAlignmentIndex( unsigned int i ) -{ +DetId HcalGeometry::detIdFromOuterAlignmentIndex(unsigned int i) { assert( i < numberOfOuterAlignments() ) ; const int ring ( i/12 ) ; const int ieta ( 0 == ring ? -11 : @@ -348,9 +244,7 @@ HcalGeometry::detIdFromOuterAlignmentIndex( unsigned int i ) return HcalDetId( HcalOuter, ieta, iphi, 4 ) ; } -DetId -HcalGeometry::detIdFromLocalAlignmentIndex( unsigned int i ) -{ +DetId HcalGeometry::detIdFromLocalAlignmentIndex(unsigned int i) { assert( i < numberOfAlignments() ) ; const unsigned int nB ( numberOfBarrelAlignments() ) ; @@ -364,10 +258,8 @@ HcalGeometry::detIdFromLocalAlignmentIndex( unsigned int i ) detIdFromOuterAlignmentIndex( i - nB - nE - nF ) ) ; } -unsigned int -HcalGeometry::alignmentBarEndForIndexLocal( const DetId& id , - unsigned int nD ) -{ +unsigned int HcalGeometry::alignmentBarEndForIndexLocal(const DetId& id , + unsigned int nD) { const HcalDetId hid ( id ) ; const unsigned int iphi ( hid.iphi() ) ; const int ieta ( hid.ieta() ) ; @@ -376,26 +268,19 @@ HcalGeometry::alignmentBarEndForIndexLocal( const DetId& id , return index ; } -unsigned int -HcalGeometry::alignmentBarrelIndexLocal( const DetId& id ) -{ +unsigned int HcalGeometry::alignmentBarrelIndexLocal(const DetId& id) { return alignmentBarEndForIndexLocal( id, numberOfBarrelAlignments() ) ; } -unsigned int -HcalGeometry::alignmentEndcapIndexLocal( const DetId& id ) -{ - return alignmentBarEndForIndexLocal( id, numberOfEndcapAlignments() ) ; + +unsigned int HcalGeometry::alignmentEndcapIndexLocal(const DetId& id) { + return alignmentBarEndForIndexLocal( id, numberOfEndcapAlignments() ) ; } -unsigned int -HcalGeometry::alignmentForwardIndexLocal( const DetId& id ) -{ +unsigned int HcalGeometry::alignmentForwardIndexLocal(const DetId& id) { return alignmentBarEndForIndexLocal( id, numberOfForwardAlignments() ) ; } -unsigned int -HcalGeometry::alignmentOuterIndexLocal( const DetId& id ) -{ +unsigned int HcalGeometry::alignmentOuterIndexLocal(const DetId& id) { const HcalDetId hid ( id ) ; const int ieta ( hid.ieta() ) ; const int iphi ( hid.iphi() ) ; @@ -409,9 +294,7 @@ HcalGeometry::alignmentOuterIndexLocal( const DetId& id ) return index ; } -unsigned int -HcalGeometry::alignmentTransformIndexLocal( const DetId& id ) -{ +unsigned int HcalGeometry::alignmentTransformIndexLocal(const DetId& id) { assert(id.det() == DetId::Hcal) ; const HcalDetId hid ( id ) ; @@ -425,47 +308,38 @@ HcalGeometry::alignmentTransformIndexLocal( const DetId& id ) const unsigned int nF ( numberOfForwardAlignments() ) ; // const unsigned int nO ( numberOfOuterAlignments() ) ; - const unsigned int index ( - isHB ? alignmentBarrelIndexLocal(id) : - isHE ? alignmentEndcapIndexLocal(id) + nB : - isHF ? alignmentForwardIndexLocal( id ) + nB + nE : - alignmentOuterIndexLocal(id) + nB + nE + nF - ); + const unsigned int index (isHB ? alignmentBarrelIndexLocal(id) : + isHE ? alignmentEndcapIndexLocal(id) + nB : + isHF ? alignmentForwardIndexLocal( id ) + nB + nE : + alignmentOuterIndexLocal(id) + nB + nE + nF + ); assert( index < numberOfAlignments() ) ; return index ; } -unsigned int -HcalGeometry::alignmentTransformIndexGlobal( const DetId& id ) -{ - return (unsigned int)DetId::Hcal - 1 ; +unsigned int HcalGeometry::alignmentTransformIndexGlobal( const DetId& id ) { + return (unsigned int)DetId::Hcal - 1 ; } -void -HcalGeometry::localCorners( Pt3DVec& lc , - const CCGFloat* pv , - unsigned int i , - Pt3D& ref ) -{ +void HcalGeometry::localCorners(Pt3DVec& lc, + const CCGFloat* pv, + unsigned int i, + Pt3D& ref) { HcalDetId hid=HcalDetId(theTopology.denseId2detId(i)); - if( hid.subdet() == HcalForward ) - { + if (hid.subdet() == HcalForward ) { IdealZPrism::localCorners( lc, pv, ref ) ; - } - else - { - IdealObliquePrism::localCorners( lc, pv, ref ) ; + } else { + IdealObliquePrism::localCorners( lc, pv, ref ) ; } } -void -HcalGeometry::newCell( const GlobalPoint& f1 , - const GlobalPoint& f2 , - const GlobalPoint& f3 , - const CCGFloat* parm , - const DetId& detId ) { +void HcalGeometry::newCell(const GlobalPoint& f1 , + const GlobalPoint& f2 , + const GlobalPoint& f3 , + const CCGFloat* parm , + const DetId& detId) { assert (detId.det()==DetId::Hcal); @@ -477,12 +351,12 @@ HcalGeometry::newCell( const GlobalPoint& f1 , << detId.rawId() << ", hid " << hid << ", din " << din << ", index "; - if( hid.subdet()==HcalBarrel) { + if (hid.subdet()==HcalBarrel) { m_hbCellVec[ din ] = IdealObliquePrism( f1, cornersMgr(), parm ) ; - } else if( hid.subdet()==HcalEndcap ) { + } else if (hid.subdet()==HcalEndcap) { const unsigned int index ( din - m_hbCellVec.size() ) ; m_heCellVec[ index ] = IdealObliquePrism( f1, cornersMgr(), parm ) ; - } else if( hid.subdet()==HcalOuter ) { + } else if (hid.subdet()==HcalOuter) { const unsigned int index ( din - m_hbCellVec.size() - m_heCellVec.size() ) ; @@ -499,129 +373,93 @@ HcalGeometry::newCell( const GlobalPoint& f1 , m_dins.push_back( din ); } -const CaloCellGeometry* -HcalGeometry::cellGeomPtr( unsigned int din ) const -{ - const CaloCellGeometry* cell ( 0 ) ; - if( m_hbCellVec.size() > din ) - { - cell = &m_hbCellVec[ din ] ; - } - else - { - if( m_hbCellVec.size() + - m_heCellVec.size() > din ) - { - const unsigned int index ( din - m_hbCellVec.size() ) ; - cell = &m_heCellVec[ index ] ; - } - else - { - if( m_hbCellVec.size() + - m_heCellVec.size() + - m_hoCellVec.size() > din ) - { - const unsigned int index ( din - - m_hbCellVec.size() - - m_heCellVec.size() ) ; - cell = &m_hoCellVec[ index ] ; - } - else - { - if( m_hbCellVec.size() + - m_heCellVec.size() + - m_hoCellVec.size() + - m_hfCellVec.size() > din ) - { - const unsigned int index ( din - - m_hbCellVec.size() - - m_heCellVec.size() - - m_hoCellVec.size() ) ; - cell = &m_hfCellVec[ index ] ; - } - } - } - } +const CaloCellGeometry* HcalGeometry::cellGeomPtr( unsigned int din ) const { + const CaloCellGeometry* cell ( 0 ) ; + if( m_hbCellVec.size() > din ) { + cell = &m_hbCellVec[ din ] ; + } else { + if (m_hbCellVec.size() + m_heCellVec.size() > din) { + const unsigned int index (din - m_hbCellVec.size() ) ; + cell = &m_heCellVec[ index ] ; + } else if (m_hbCellVec.size()+m_heCellVec.size()+m_hoCellVec.size() > din) { + const unsigned int index (din - m_hbCellVec.size() - m_heCellVec.size()); + cell = &m_hoCellVec[ index ] ; + } else if (m_hbCellVec.size() + m_heCellVec.size() + m_hoCellVec.size() + + m_hfCellVec.size() > din) { + const unsigned int index (din - m_hbCellVec.size() - m_heCellVec.size() - + m_hoCellVec.size() ) ; + cell = &m_hfCellVec[ index ] ; + } + } - return (( 0 == cell || 0 == cell->param()) ? 0 : cell ) ; + return (( 0 == cell || 0 == cell->param()) ? 0 : cell ) ; } -void -HcalGeometry::getSummary( CaloSubdetectorGeometry::TrVec& tVec, - CaloSubdetectorGeometry::IVec& iVec, - CaloSubdetectorGeometry::DimVec& dVec, - CaloSubdetectorGeometry::IVec& dinsVec ) const -{ - tVec.reserve( m_dins.size()*numberOfTransformParms() ) ; - iVec.reserve( numberOfShapes()==1 ? 1 : m_dins.size() ) ; - dVec.reserve( numberOfShapes()*numberOfParametersPerShape() ) ; - dinsVec.reserve( m_dins.size() ); +void HcalGeometry::getSummary(CaloSubdetectorGeometry::TrVec& tVec, + CaloSubdetectorGeometry::IVec& iVec, + CaloSubdetectorGeometry::DimVec& dVec, + CaloSubdetectorGeometry::IVec& dinsVec ) const { + tVec.reserve(theTopology.ncells()*numberOfTransformParms() ) ; + iVec.reserve( numberOfShapes()==1 ? 1 : theTopology.ncells() ) ; + dVec.reserve( numberOfShapes()*numberOfParametersPerShape() ) ; + dinsVec.reserve(theTopology.ncells()); - for( ParVecVec::const_iterator ivv ( parVecVec().begin() ) ; ivv != parVecVec().end() ; ++ivv ) - { - const ParVec& pv ( *ivv ) ; - for( ParVec::const_iterator iv ( pv.begin() ) ; iv != pv.end() ; ++iv ) - { - dVec.push_back( *iv ) ; - } - } + for (ParVecVec::const_iterator ivv (parVecVec().begin()) ; + ivv != parVecVec().end() ; ++ivv) { + const ParVec& pv ( *ivv ) ; + for (ParVec::const_iterator iv ( pv.begin() ) ; iv != pv.end() ; ++iv) { + dVec.push_back( *iv ) ; + } + } - for( unsigned int i ( 0 ) ; i < theTopology.ncells() ; ++i ) - { - Tr3D tr ; - const CaloCellGeometry* ptr ( cellGeomPtr( i ) ) ; + for (unsigned int i ( 0 ) ; i < theTopology.ncells() ; ++i) { + Tr3D tr ; + const CaloCellGeometry* ptr ( cellGeomPtr( i ) ) ; - if( 0 != ptr ) - { - dinsVec.push_back( i ); + if (0 != ptr) { + dinsVec.push_back( i ); - ptr->getTransform( tr, ( Pt3DVec* ) 0 ) ; + ptr->getTransform( tr, ( Pt3DVec* ) 0 ) ; - if( Tr3D() == tr ) // for preshower there is no rotation - { - const GlobalPoint& gp ( ptr->getPosition() ) ; - tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ; - } + if( Tr3D() == tr ) { // for preshower there is no rotation + const GlobalPoint& gp ( ptr->getPosition() ) ; + tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ; + } - const CLHEP::Hep3Vector tt ( tr.getTranslation() ) ; - tVec.push_back( tt.x() ) ; - tVec.push_back( tt.y() ) ; - tVec.push_back( tt.z() ) ; - if( 6 == numberOfTransformParms() ) - { - const CLHEP::HepRotation rr ( tr.getRotation() ) ; - const ROOT::Math::Transform3D rtr ( rr.xx(), rr.xy(), rr.xz(), tt.x(), - rr.yx(), rr.yy(), rr.yz(), tt.y(), - rr.zx(), rr.zy(), rr.zz(), tt.z() ) ; - ROOT::Math::EulerAngles ea ; - rtr.GetRotation( ea ) ; - tVec.push_back( ea.Phi() ) ; - tVec.push_back( ea.Theta() ) ; - tVec.push_back( ea.Psi() ) ; - } + const CLHEP::Hep3Vector tt ( tr.getTranslation() ) ; + tVec.push_back( tt.x() ) ; + tVec.push_back( tt.y() ) ; + tVec.push_back( tt.z() ) ; + if (6 == numberOfTransformParms()) { + const CLHEP::HepRotation rr ( tr.getRotation() ) ; + const ROOT::Math::Transform3D rtr (rr.xx(), rr.xy(), rr.xz(), tt.x(), + rr.yx(), rr.yy(), rr.yz(), tt.y(), + rr.zx(), rr.zy(), rr.zz(), tt.z()); + ROOT::Math::EulerAngles ea ; + rtr.GetRotation( ea ) ; + tVec.push_back( ea.Phi() ) ; + tVec.push_back( ea.Theta() ) ; + tVec.push_back( ea.Psi() ) ; + } - const CCGFloat* par ( ptr->param() ) ; + const CCGFloat* par ( ptr->param() ) ; - unsigned int ishape ( 9999 ) ; - for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv ) - { - bool ok ( true ) ; - const CCGFloat* pv ( &(*parVecVec()[ivv].begin() ) ) ; - for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k ) - { - ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ; - } - if( ok ) - { - ishape = ivv ; - break ; - } - } - assert( 9999 != ishape ) ; - + unsigned int ishape ( 9999 ) ; + for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv ) { + bool ok ( true ) ; + const CCGFloat* pv ( &(*parVecVec()[ivv].begin() ) ) ; + for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k ) { + ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ; + } + if( ok ) { + ishape = ivv ; + break ; + } + } + assert( 9999 != ishape ) ; - const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : m_dins.size() ) ; - if( iVec.size() < nn ) iVec.push_back( ishape ) ; - } - } + const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : m_dins.size() ) ; + if( iVec.size() < nn ) iVec.push_back( ishape ) ; + } + } } diff --git a/Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryLoader.cc b/Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryLoader.cc index b82eb674f3fa4..7062baacf0505 100644 --- a/Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryLoader.cc +++ b/Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryLoader.cc @@ -3,273 +3,461 @@ #include "Geometry/CaloGeometry/interface/IdealObliquePrism.h" #include "Geometry/CaloGeometry/interface/IdealZPrism.h" #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" -#include "HcalHardcodeGeometryData.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include + +#include typedef CaloCellGeometry::CCGFloat CCGFloat ; +//#define DebugLog +// ==============> Loader Itself <========================== -HcalHardcodeGeometryLoader::HcalHardcodeGeometryLoader(const HcalTopology& ht) : - theTopology ( 0 ) , - extTopology ( &ht ) -{ - init(); -} +HcalHardcodeGeometryLoader::HcalHardcodeGeometryLoader(const edm::ParameterSet& ) { -void -HcalHardcodeGeometryLoader::init() -{ - theBarrelRadius = 190.; - theHBThickness = 93.6; // just from drawings. All thicknesses needs to be done right + MAX_HCAL_PHI = 72; + DEGREE2RAD = M_PI / 180.; +#ifdef DebugLog + std::cout << "Instantiate HcalHardCodeGeometryLoader" << std::endl; +#endif +} - theHB15aThickness = theHBThickness * 12.0/17.0; // relative weight from layer count! - theHB15bThickness = theHBThickness * 4.0/17.0; // relative weight from layer count! - theHB16aThickness = theHBThickness * 1.0/17.0; // relative weight from layer count! - theHB16bThickness = theHBThickness * 7.0/17.0; // relative weight from layer count! +CaloSubdetectorGeometry* HcalHardcodeGeometryLoader::load(const HcalTopology& fTopology) { - theOuterRadius = 406; - theHOThickness = 1.; + int maxEta = fTopology.lastHERing(); + m_segmentation.resize(maxEta); + for (int i = 0; i < maxEta; i++) { + fTopology.getDepthSegmentation(i+1,m_segmentation[i]); +#ifdef DebugLog + std::cout << "Eta" << i+1; + for (unsigned int k=0; kcornersMgr() ) hcalGeometry->allocateCorners ( fTopology.ncells() ); + if( 0 == hcalGeometry->parMgr() ) hcalGeometry->allocatePar (hcalGeometry->numberOfShapes(), + HcalGeometry::k_NumberOfParametersPerShape ) ; + if (fTopology.mode() == HcalTopologyMode::H2) { // TB geometry + fillHBHO (hcalGeometry, makeHBCells(fTopology), true); + fillHBHO (hcalGeometry, makeHOCells(), false); + fillHE (hcalGeometry, makeHECells_H2()); + } else { // regular geometry + fillHBHO (hcalGeometry, makeHBCells(fTopology), true); + fillHBHO (hcalGeometry, makeHOCells(), false); + fillHF (hcalGeometry, makeHFCells()); + fillHE (hcalGeometry, makeHECells(fTopology)); + } + return hcalGeometry; +} - theHEZPos[0] = 388.0; - theHEZPos[1] = 397.0; - theHEZPos[2] = 450.0; - theHEZPos[3] = 568.0; - theHFZPos[0] = 1100.0; - theHFZPos[1] = 1120.0; - theHFThickness = 165; +// ----------> HB <----------- +std::vector HcalHardcodeGeometryLoader::makeHBCells (const HcalTopology & topology) { + const float HBRMIN = 181.1; + const float HBRMAX = 288.8; + + float normalDepths[2] = {HBRMIN, HBRMAX}; + float ring15Depths[3] = {HBRMIN, 258.4, HBRMAX}; + float ring16Depths[3] = {HBRMIN, 190.4, 232.6}; + float layerDepths[18] = {HBRMIN, 188.7, 194.7, 200.7, 206.7, 212.7, 218.7, + 224.7, 230.7, 236.7, 242.7, 249.3, 255.9, 262.5, + 269.1, 275.7, 282.3, HBRMAX}; + float slhcDepths[4] = {HBRMIN, 214., 239., HBRMAX}; +#ifdef DebugLog + std::cout <<"FlexiGeometryLoader called for "<< topology.mode() << ":" << HcalTopologyMode::SLHC << std::endl; +#endif + std::vector result; + for(int iring = 1; iring <= 16; ++iring) { + std::vector depths; + if (topology.mode() != HcalTopologyMode::SLHC) { + if (iring == 15) { + for (int i=0; i<3; ++i) depths.push_back(ring15Depths[i]); + } else if (iring == 16) { + for (int i=0; i<3; ++i) depths.push_back(ring16Depths[i]); + } else { + for (int i=0; i<2; ++i) depths.push_back(normalDepths[i]); + } + } else { + if (m_segmentation.size() >= (unsigned int)(iring)) { + int depth = m_segmentation[iring-1][0]; + depths.push_back(layerDepths[depth]); + int layer = 1; + for (unsigned int i=1; i= 17) break; + } + if (layer <= 17) depths.push_back(HBRMAX); + } else { + for (int i=0; i<4; ++i) { + if (iring != 16 || i < 3) { + depths.push_back(slhcDepths[i]); + } + } + } + } + unsigned int ndepth=depths.size()-1; + unsigned int startingDepth=1; + float etaMin=(iring-1)*0.087; + float etaMax=iring*0.087; + // topology.depthBinInformation(HcalBarrel, iring, ndepth, startingDepth); +#ifdef DebugLog + std::cout << "HBRing " << iring << " eta " << etaMin << ":" << etaMax << " depths " << ndepth << ":" << startingDepth; + for (unsigned int i=0; i( subdet ); - ReturnType hg( new HcalGeometry( *extTopology) ); - if( hg->cornersMgr() == 0 ) hg->allocateCorners( extTopology->ncells() ); - if( hg->parMgr() == 0 ) hg->allocatePar( - HcalGeometry::k_NumberOfParametersPerShape*hg->numberOfShapes(), - HcalGeometry::k_NumberOfParametersPerShape ) ; - - switch (hsub) - { - case (HcalBarrel) : fill(hsub, extTopology->firstHBRing(), extTopology->lastHBRing(), hg ); break; - case (HcalEndcap) : fill(hsub, extTopology->firstHERing(), extTopology->lastHERing(), hg ); break; - case (HcalForward) : fill(hsub, extTopology->firstHFRing(), extTopology->lastHFRing(), hg ); break; - case (HcalOuter) : fill(hsub, extTopology->firstHORing(), extTopology->lastHORing(), hg ); break; - default: break; - } - return hg; +// ----------> HO <----------- +std::vector HcalHardcodeGeometryLoader::makeHOCells () { + const float HORMIN0 = 390.0; + const float HORMIN1 = 412.6; + const float HORMAX = 413.6; + + HcalHardcodeGeometryLoader::HBHOCellParameters cells [] = { + // eta, depth, firstPhi, stepPhi, deltaPhi, rMin, rMax, etaMin, etaMax + HcalHardcodeGeometryLoader::HBHOCellParameters ( 1, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*0, 0.087*1), + HcalHardcodeGeometryLoader::HBHOCellParameters ( 2, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*1, 0.087*2), + HcalHardcodeGeometryLoader::HBHOCellParameters ( 3, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*2, 0.087*3), + HcalHardcodeGeometryLoader::HBHOCellParameters ( 4, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*3, 0.3075), + HcalHardcodeGeometryLoader::HBHOCellParameters ( 5, 4, 1, 1, 5, HORMIN1, HORMAX, 0.3395, 0.087*5), + HcalHardcodeGeometryLoader::HBHOCellParameters ( 6, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*5, 0.087*6), + HcalHardcodeGeometryLoader::HBHOCellParameters ( 7, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*6, 0.087*7), + HcalHardcodeGeometryLoader::HBHOCellParameters ( 8, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*7, 0.087*8), + HcalHardcodeGeometryLoader::HBHOCellParameters ( 9, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*8, 0.087*9), + HcalHardcodeGeometryLoader::HBHOCellParameters (10, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*9, 0.8494), + HcalHardcodeGeometryLoader::HBHOCellParameters (11, 4, 1, 1, 5, HORMIN1, HORMAX, 0.873, 0.087*11), + HcalHardcodeGeometryLoader::HBHOCellParameters (12, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*11, 0.087*12), + HcalHardcodeGeometryLoader::HBHOCellParameters (13, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*12, 0.087*13), + HcalHardcodeGeometryLoader::HBHOCellParameters (14, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*13, 0.087*14), + HcalHardcodeGeometryLoader::HBHOCellParameters (15, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*14, 0.087*15) + }; + int nCells = sizeof(cells)/sizeof(HcalHardcodeGeometryLoader::HBHOCellParameters); + std::vector result; + result.reserve (nCells); + for (int i = 0; i < nCells; ++i) result.push_back (cells[i]); + return result; } -HcalHardcodeGeometryLoader::ReturnType -HcalHardcodeGeometryLoader::load() -{ - ReturnType hg( new HcalGeometry( *extTopology ) ) ; - if( hg->cornersMgr() == 0 ) hg->allocateCorners( extTopology->ncells() ); - if( hg->parMgr() == 0 ) hg->allocatePar( 500, 5 ) ; +// +// Convert constants to appropriate cells +// +void HcalHardcodeGeometryLoader::fillHBHO (CaloSubdetectorGeometry* fGeometry, const std::vector & fCells, bool fHB) { - fill(HcalBarrel, extTopology->firstHBRing(), extTopology->lastHBRing(), hg); - fill(HcalEndcap, extTopology->firstHERing(), extTopology->lastHERing(), hg); - fill(HcalForward, extTopology->firstHFRing(), extTopology->lastHFRing(), hg); - fill(HcalOuter, extTopology->firstHORing(), extTopology->lastHORing(), hg); - return hg; + for (size_t iCell = 0; iCell < fCells.size(); ++iCell) { + const HcalHardcodeGeometryLoader::HBHOCellParameters& param = fCells[iCell]; + for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) { + for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical + HcalDetId hid (fHB ? HcalBarrel : HcalOuter, param.eta*iside, iPhi, param.depth); + float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; // middle of the cell + float etaCenter = 0.5*(param.etaMin + param.etaMax); + float x = param.rMin* cos (phiCenter); + float y = param.rMin* sin (phiCenter); + float z = iside * param.rMin * sinh(etaCenter); + // make cell geometry + GlobalPoint refPoint (x,y,z); // center of the cell's face + std::vector cellParams; + cellParams.reserve (5); + cellParams.push_back (0.5 * (param.etaMax - param.etaMin)); // deta_half + cellParams.push_back (0.5 * param.dphi * DEGREE2RAD); // dphi_half + cellParams.push_back (0.5 * (param.rMax - param.rMin) * cosh (etaCenter)); // dr_half + cellParams.push_back ( fabs( refPoint.eta() ) ) ; + cellParams.push_back ( fabs( refPoint.z() ) ) ; +#ifdef DebugLog + std::cout << "HcalHardcodeGeometryLoader::fillHBHO-> " << hid << hid.ieta() << '/' << hid.iphi() << '/' << hid.depth() << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl; +#endif + fGeometry->newCell(refPoint, refPoint, refPoint, + CaloCellGeometry::getParmPtr(cellParams, + fGeometry->parMgr(), + fGeometry->parVecVec()), + hid ) ; + } + } + } } -void -HcalHardcodeGeometryLoader::fill( HcalSubdetector subdet, - int firstEtaRing, - int lastEtaRing, - ReturnType geom ) -{ - // start by making the new HcalDetIds - std::vector hcalIds; - int nDepthSegments, startingDepthSegment; - for(int etaRing = firstEtaRing; etaRing <= lastEtaRing; ++etaRing) { - extTopology->depthBinInformation(subdet, etaRing, nDepthSegments, startingDepthSegment); - unsigned int nPhiBins = extTopology->nPhiBins(etaRing); - unsigned int phiInc=72/std::max(36u,nPhiBins); - for(int idepth = 0; idepth < nDepthSegments; ++idepth) { - int depthBin = startingDepthSegment + idepth; - - for(unsigned iphi = 1; iphi <= 72; iphi+=phiInc) { - for(int zsign = -1; zsign <= 1; zsign += 2) { - HcalDetId id( subdet, zsign * etaRing, iphi, depthBin); - if (extTopology->valid(id)) hcalIds.push_back(id); + +// ----------> HE <----------- +std::vector HcalHardcodeGeometryLoader::makeHECells (const HcalTopology & topology) { + + std::vector result; + const float HEZMIN = 400.458; + const float HEZMID = 436.168; + const float HEZMAX = 549.268; + float normalDepths[3] = {HEZMIN, HEZMID, HEZMAX}; + float tripleDepths[4] = {HEZMIN, 418.768, HEZMID, HEZMAX}; + float slhcDepths[5] = {HEZMIN, 418.768, HEZMID, 493., HEZMAX}; + float ring16Depths[2] = {418.768,470.968}; + float ring16slhcDepths[3] = {418.768, 450., 470.968}; + float ring17Depths[2] = {409.698,514.468}; + float ring17slhcDepths[5] = {409.698, 435., 460., 495., 514.468}; + float ring18Depths[3] = {391.883,427.468,540.568}; + float ring18slhcDepths[5] = {391.883, 439., 467., 504. , 540.568}; + float etaBounds[] = {0.087*15, 0.087*16, 0.087*17, 0.087*18, 0.087*19, + 1.74, 1.83, 1.93, 2.043, 2.172, 2.322, 2.500, + 2.650, 2.868, 3.000}; + float layerDepths[19] = {HEZMIN, 408.718, 416.978, 425.248, 433.508, 441.768, + 450.038,458.298, 466.558, 474.828, 483.088, 491.348, + 499.618,507.878, 516.138, 524.398, 532.668, 540.928, + HEZMAX}; + + // count by ring - 16 + for(int iringm16=0; iringm16 <= 13; ++iringm16) { + int iring = iringm16 + 16; + std::vector depths; + unsigned int startingDepth = 1; + if (topology.mode() != HcalTopologyMode::SLHC) { + if (iring == 16) + {for (int i=0; i<2; ++i) depths.push_back(ring16Depths[i]); startingDepth = 3;} + else if (iring == 17) + for (int i=0; i<2; ++i) depths.push_back(ring17Depths[i]); + else if (iring == 18) + for (int i=0; i<3; ++i) depths.push_back(ring18Depths[i]); + else if (iring == topology.lastHERing()) + for (int i=0; i<3; ++i) depths.push_back(tripleDepths[i]); + else if (iring >= topology.firstHETripleDepthRing()) + for (int i=0; i<4; ++i) depths.push_back(tripleDepths[i]); + else + for (int i=0; i<3; ++i) depths.push_back(normalDepths[i]); + } else { + if (m_segmentation.size() >= (unsigned int)(iring)) { + int depth = m_segmentation[iring-1][0]; + if (iring == 16) depths.push_back(ring16Depths[0]); + else if (iring == 17) depths.push_back(ring17Depths[0]); + else if (iring == 18) depths.push_back(ring18Depths[0]); + else depths.push_back(layerDepths[depth]); + int layer = 1; + float lastDepth = depths[0]; + for (unsigned int i=1; i lastDepth && (iring != 16 || depth > 3)) { + depths.push_back(layerDepths[depth]); + lastDepth = layerDepths[depth]; } - } + } + } + if (layer <= 17) depths.push_back(HEZMAX); + if (iring == 16) startingDepth = 3; + } else { + if (iring == 16) {for (int i=0; i<3; ++i) depths.push_back(ring16slhcDepths[i]); startingDepth = 3;} + else if (iring == 17) for (int i=0; i<5; ++i) depths.push_back(ring17slhcDepths[i]); + else if (iring == 18) for (int i=0; i<5; ++i) depths.push_back(ring18slhcDepths[i]); + else for (int i=0; i<5; ++i) depths.push_back(slhcDepths[i]); } - } + } + float etamin = etaBounds[iringm16]; + float etamax = etaBounds[iringm16+1]; + unsigned int ndepth = depths.size()-1; + // topology.depthBinInformation(HcalEndcap, iring, ndepth, startingDepth); +#ifdef DebugLog + std::cout << "HERing " << iring << " eta " << etamin << ":" << etamax << " depths " << ndepth << ":" << startingDepth; + for (unsigned int i=0; i= topology.firstHEDoublePhiRing() ? 2 : 1); + int deltaPhi = (iring >= topology.firstHEDoublePhiRing() ? 10 : 5); + if (topology.mode() != HcalTopologyMode::SLHC && + iring == topology.lastHERing()-1 && idepth == ndepth-1) { +#ifdef DebugLog + std::cout << "HE iEta " << iring << " Depth " << depthIndex << " Eta " << etamin << ":" << etaBounds[iringm16+2] << std::endl; +#endif + result.push_back(HcalHardcodeGeometryLoader::HECellParameters(iring, depthIndex, 1, stepPhi, deltaPhi, zmin, zmax, etamin, etaBounds[iringm16+2])); + } else { +#ifdef DebugLog + std::cout << "HE iEta " << iring << " Depth " << depthIndex << " Eta " << etamin << ":" << etamax << std::endl; +#endif + result.push_back(HcalHardcodeGeometryLoader::HECellParameters(iring, depthIndex, 1, stepPhi, deltaPhi, zmin, zmax, etamin, etamax)); + } + } + } + } - edm::LogInfo("HcalHardcodeGeometry") << "Number of HCAL DetIds made: " - << subdet - << " " << hcalIds.size(); - // for each new HcalDetId, make a CaloCellGeometry - for(std::vector::const_iterator hcalIdItr = hcalIds.begin(); - hcalIdItr != hcalIds.end(); ++hcalIdItr) - { - makeCell(*hcalIdItr,geom) ; - } + return result; } - -inline double theta_from_eta(double eta){return (2.0*atan(exp(-eta)));} -void -HcalHardcodeGeometryLoader::makeCell( const HcalDetId& detId , - ReturnType geom ) const -{ - // the two eta boundaries of the cell - double eta1, eta2; - HcalSubdetector subdet = detId.subdet(); - int etaRing = detId.ietaAbs(); - if(subdet == HcalForward) - { - eta1 = theHFEtaBounds[etaRing-extTopology->firstHFRing()]; - eta2 = theHFEtaBounds[etaRing-extTopology->firstHFRing()+1]; - } - else if (etaRing==28 && detId.depth()==3) - { - // double-width in eta at depth 3 in ieta=28 - eta1 = theHBHEEtaBounds[etaRing-1]; - eta2 = theHBHEEtaBounds[etaRing+1]; - } - else - { - eta1 = theHBHEEtaBounds[etaRing-1]; - eta2 = theHBHEEtaBounds[etaRing]; - } - double eta = 0.5*(eta1+eta2) * detId.zside(); - double deta = 0.5*(eta2-eta1); - double theta = theta_from_eta(eta); +// ----------> HE @ H2 <----------- +std::vector HcalHardcodeGeometryLoader::makeHECells_H2 () { - int nDepthBins, startingBin; - extTopology->depthBinInformation(subdet,etaRing,nDepthBins,startingBin); + const float HEZMIN_H2 = 400.715; + const float HEZMID_H2 = 436.285; + const float HEZMAX_H2 = 541.885; + + HcalHardcodeGeometryLoader::HECellParameters cells [] = { + // eta, depth, firstPhi, stepPhi, deltaPhi, zMin, zMax, etaMin, etaMax + HcalHardcodeGeometryLoader::HECellParameters ( 16, 3, 1, 1, 5, 409.885, 462.685, 1.305, 1.373), + HcalHardcodeGeometryLoader::HECellParameters ( 17, 1, 1, 1, 5, HEZMIN_H2, 427.485, 1.373, 1.444), + HcalHardcodeGeometryLoader::HECellParameters ( 17, 2, 1, 1, 5, 427.485, 506.685, 1.373, 1.444), + HcalHardcodeGeometryLoader::HECellParameters ( 18, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.444, 1.521), + HcalHardcodeGeometryLoader::HECellParameters ( 18, 2, 1, 1, 5, HEZMID_H2, 524.285, 1.444, 1.521), + HcalHardcodeGeometryLoader::HECellParameters ( 19, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.521, 1.603), + HcalHardcodeGeometryLoader::HECellParameters ( 19, 2, 1, 1, 5, HEZMID_H2, HEZMAX_H2, 1.521, 1.603), + HcalHardcodeGeometryLoader::HECellParameters ( 20, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.603, 1.693), + HcalHardcodeGeometryLoader::HECellParameters ( 20, 2, 1, 1, 5, HEZMID_H2, HEZMAX_H2, 1.603, 1.693), + HcalHardcodeGeometryLoader::HECellParameters ( 21, 1, 1, 2, 5, HEZMIN_H2, HEZMID_H2, 1.693, 1.79), + HcalHardcodeGeometryLoader::HECellParameters ( 21, 2, 1, 2, 5, HEZMID_H2, HEZMAX_H2, 1.693, 1.79), + HcalHardcodeGeometryLoader::HECellParameters ( 22, 1, 1, 2,10, HEZMIN_H2, HEZMID_H2, 1.79, 1.88), + HcalHardcodeGeometryLoader::HECellParameters ( 22, 2, 1, 2,10, HEZMID_H2, HEZMAX_H2, 1.79, 1.88), + HcalHardcodeGeometryLoader::HECellParameters ( 23, 1, 1, 2,10, HEZMIN_H2, HEZMID_H2, 1.88, 1.98), + HcalHardcodeGeometryLoader::HECellParameters ( 23, 2, 1, 2,10, HEZMID_H2, HEZMAX_H2, 1.88, 1.98), + HcalHardcodeGeometryLoader::HECellParameters ( 24, 1, 1, 2,10, HEZMIN_H2, 418.685, 1.98, 2.09), + HcalHardcodeGeometryLoader::HECellParameters ( 24, 2, 1, 2,10, 418.685, HEZMID_H2, 1.98, 2.09), + HcalHardcodeGeometryLoader::HECellParameters ( 24, 3, 1, 2,10, HEZMID_H2, HEZMAX_H2, 1.98, 2.09), + HcalHardcodeGeometryLoader::HECellParameters ( 25, 1, 1, 2,10, HEZMIN_H2, 418.685, 2.09, 2.21), + HcalHardcodeGeometryLoader::HECellParameters ( 25, 2, 1, 2,10, 418.685, HEZMID_H2, 2.09, 2.21), + HcalHardcodeGeometryLoader::HECellParameters ( 25, 3, 1, 2,10, HEZMID_H2, HEZMAX_H2, 2.09, 2.21) + }; + int nCells = sizeof(cells)/sizeof(HcalHardcodeGeometryLoader::HECellParameters); + std::vector result; + result.reserve (nCells); + for (int i = 0; i < nCells; ++i) result.push_back (cells[i]); + return result; +} - // in radians - double dphi_nominal = 2.0*M_PI / extTopology->nPhiBins(1); // always the same - double dphi_half = M_PI / extTopology->nPhiBins(etaRing); // half-width - - double phi_low = dphi_nominal*(detId.iphi()-1); // low-edge boundaries are constant... - double phi = phi_low+dphi_half; +// ----------> HF <----------- +std::vector HcalHardcodeGeometryLoader::makeHFCells () { - bool isBarrel = (subdet == HcalBarrel || subdet == HcalOuter); + const float HFZMIN1 = 1115.; + const float HFZMIN2 = 1137.; + const float HFZMAX = 1280.1; + + HcalHardcodeGeometryLoader::HFCellParameters cells [] = { + // eta, depth, firstPhi, stepPhi, deltaPhi, zMin, zMax, rMin, rMax + HcalHardcodeGeometryLoader::HFCellParameters (29, 1, 1, 2, 10, HFZMIN1, HFZMAX,116.2,130.0), + HcalHardcodeGeometryLoader::HFCellParameters (29, 2, 1, 2, 10, HFZMIN2, HFZMAX,116.2,130.0), + HcalHardcodeGeometryLoader::HFCellParameters (30, 1, 1, 2, 10, HFZMIN1, HFZMAX, 97.5,116.2), + HcalHardcodeGeometryLoader::HFCellParameters (30, 2, 1, 2, 10, HFZMIN2, HFZMAX, 97.5,116.2), + HcalHardcodeGeometryLoader::HFCellParameters (31, 1, 1, 2, 10, HFZMIN1, HFZMAX, 81.8, 97.5), + HcalHardcodeGeometryLoader::HFCellParameters (31, 2, 1, 2, 10, HFZMIN2, HFZMAX, 81.8, 97.5), + HcalHardcodeGeometryLoader::HFCellParameters (32, 1, 1, 2, 10, HFZMIN1, HFZMAX, 68.6, 81.8), + HcalHardcodeGeometryLoader::HFCellParameters (32, 2, 1, 2, 10, HFZMIN2, HFZMAX, 68.6, 81.8), + HcalHardcodeGeometryLoader::HFCellParameters (33, 1, 1, 2, 10, HFZMIN1, HFZMAX, 57.6, 68.6), + HcalHardcodeGeometryLoader::HFCellParameters (33, 2, 1, 2, 10, HFZMIN2, HFZMAX, 57.6, 68.6), + HcalHardcodeGeometryLoader::HFCellParameters (34, 1, 1, 2, 10, HFZMIN1, HFZMAX, 48.3, 57.6), + HcalHardcodeGeometryLoader::HFCellParameters (34, 2, 1, 2, 10, HFZMIN2, HFZMAX, 48.3, 57.6), + HcalHardcodeGeometryLoader::HFCellParameters (35, 1, 1, 2, 10, HFZMIN1, HFZMAX, 40.6, 48.3), + HcalHardcodeGeometryLoader::HFCellParameters (35, 2, 1, 2, 10, HFZMIN2, HFZMAX, 40.6, 48.3), + HcalHardcodeGeometryLoader::HFCellParameters (36, 1, 1, 2, 10, HFZMIN1, HFZMAX, 34.0, 40.6), + HcalHardcodeGeometryLoader::HFCellParameters (36, 2, 1, 2, 10, HFZMIN2, HFZMAX, 34.0, 40.6), + HcalHardcodeGeometryLoader::HFCellParameters (37, 1, 1, 2, 10, HFZMIN1, HFZMAX, 28.6, 34.0), + HcalHardcodeGeometryLoader::HFCellParameters (37, 2, 1, 2, 10, HFZMIN2, HFZMAX, 28.6, 34.0), + HcalHardcodeGeometryLoader::HFCellParameters (38, 1, 1, 2, 10, HFZMIN1, HFZMAX, 24.0, 28.6), + HcalHardcodeGeometryLoader::HFCellParameters (38, 2, 1, 2, 10, HFZMIN2, HFZMAX, 24.0, 28.6), + HcalHardcodeGeometryLoader::HFCellParameters (39, 1, 1, 2, 10, HFZMIN1, HFZMAX, 20.1, 24.0), + HcalHardcodeGeometryLoader::HFCellParameters (39, 2, 1, 2, 10, HFZMIN2, HFZMAX, 20.1, 24.0), + HcalHardcodeGeometryLoader::HFCellParameters (40, 1, 3, 4, 20, HFZMIN1, HFZMAX, 16.9, 20.1), + HcalHardcodeGeometryLoader::HFCellParameters (40, 2, 3, 4, 20, HFZMIN2, HFZMAX, 16.9, 20.1), + HcalHardcodeGeometryLoader::HFCellParameters (41, 1, 3, 4, 20, HFZMIN1, HFZMAX, 12.5, 16.9), + HcalHardcodeGeometryLoader::HFCellParameters (41, 2, 3, 4, 20, HFZMIN2, HFZMAX, 12.5, 16.9) + }; + int nCells = sizeof(cells)/sizeof(HcalHardcodeGeometryLoader::HFCellParameters); + std::vector result; + result.reserve (nCells); + for (int i = 0; i < nCells; ++i) result.push_back (cells[i]); + return result; +} + +void HcalHardcodeGeometryLoader::fillHE (CaloSubdetectorGeometry* fGeometry, const std::vector & fCells) { - double x,y,z,r; - double thickness; + for (size_t iCell = 0; iCell < fCells.size(); ++iCell) { + const HcalHardcodeGeometryLoader::HECellParameters& param = fCells[iCell]; + for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) { + for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical + HcalDetId hid (HcalEndcap, param.eta*iside, iPhi, param.depth); + float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; // middle of the cell + float etaCenter = 0.5 * (param.etaMin + param.etaMax); - if(isBarrel) - { - if(subdet == HcalBarrel) - { - if (detId.ietaAbs()==15) - { - if (detId.depth()==1) - { - r = theBarrelRadius; - thickness = theHB15aThickness; - } - else - { - r = theBarrelRadius+theHB15aThickness; - thickness = theHB15bThickness; - } - } - else if (detId.ietaAbs()==16) - { - if (detId.depth()==1) - { - r = theBarrelRadius; - thickness = theHB16aThickness; - } - else - { - r = theBarrelRadius+theHB16aThickness; - thickness = theHB16bThickness; - } - } - else - { - r = theBarrelRadius; - thickness = theHBThickness; - } - } - else - { // HO - r = theOuterRadius; - thickness = theHOThickness; - } - z = r * sinh(eta); // sinh(eta) == 1/tan(theta) - thickness *= cosh(eta); // cosh(eta) == 1/sin(theta) - } - else - { - int depth = detId.depth(); - if(subdet == HcalEndcap) - { // Sadly, Z must be made a function of ieta. - if (nDepthBins==1) - { - z = theHEZPos[depth - 1]; - thickness = theHEZPos[3] - z; - } - else if (nDepthBins==2 && depth==2) - { - z = theHEZPos[depth - 1]; - if (etaRing==29) // special case for tower 29 - thickness = theHEZPos[depth] - z; - else - thickness = theHEZPos[3] - z; - } - else - { - z = theHEZPos[depth - 1]; - thickness = theHEZPos[depth] - z; - } - thickness /= fabs(tanh(eta)); - } - else - { - z = theHFZPos[depth - 1]; - thickness = theHFThickness-(theHFZPos[depth-1]-theHFZPos[0]); + float perp = param.zMin / sinh (etaCenter); + float x = perp * cos (phiCenter); + float y = perp * sin (phiCenter); + float z = iside * param.zMin; + // make cell geometry + GlobalPoint refPoint (x,y,z); // center of the cell's face + std::vector cellParams; + cellParams.reserve (5); + cellParams.push_back (0.5 * (param.etaMax - param.etaMin)); //deta_half + cellParams.push_back (0.5 * param.dphi * DEGREE2RAD); // dphi_half + cellParams.push_back (-0.5 * (param.zMax - param.zMin) / tanh (etaCenter)); // dz_half, "-" means edges in Z + cellParams.push_back ( fabs( refPoint.eta() ) ) ; + cellParams.push_back ( fabs( refPoint.z() ) ) ; +#ifdef DebugLog + std::cout << "HcalHardcodeGeometryLoader::fillHE-> " << hid << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl; +#endif + fGeometry->newCell(refPoint, refPoint, refPoint, + CaloCellGeometry::getParmPtr(cellParams, + fGeometry->parMgr(), + fGeometry->parVecVec()), + hid ) ; } - z*=detId.zside(); // get the sign right. - r = z * tan(theta); - assert(r>0.); - } - - x = r * cos(phi); - y = r * sin(phi); - GlobalPoint point(x,y,z); - - std::vector hp ; - hp.reserve(5) ; - - if (subdet==HcalForward) - { - hp.push_back( deta ) ; - hp.push_back( dphi_half ) ; - hp.push_back( thickness/2 ) ; - hp.push_back( fabs( point.eta() ) ) ; - hp.push_back( fabs( point.z() ) ) ; - } - else - { - const double mysign ( isBarrel ? 1 : -1 ) ; - hp.push_back( deta ) ; - hp.push_back( dphi_half ) ; - hp.push_back( mysign*thickness/2. ) ; - hp.push_back( fabs( point.eta() ) ) ; - hp.push_back( fabs( point.z() ) ) ; - } - geom->newCell( point, point, point, - CaloCellGeometry::getParmPtr( hp, - geom->parMgr(), - geom->parVecVec() ), - detId ); + } + } } +void HcalHardcodeGeometryLoader::fillHF (CaloSubdetectorGeometry* fGeometry, const std::vector & fCells) { + for (size_t iCell = 0; iCell < fCells.size(); ++iCell) { + const HcalHardcodeGeometryLoader::HFCellParameters& param = fCells[iCell]; + for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) { + for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical + HcalDetId hid (HcalForward, param.eta*iside, iPhi, param.depth); + float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; // middle of the cell + GlobalPoint inner (param.rMin, 0, param.zMin); + GlobalPoint outer (param.rMax, 0, param.zMin); + float iEta = inner.eta(); + float oEta = outer.eta(); + float etaCenter = 0.5 * ( iEta + oEta ); + + float perp = param.zMin / sinh (etaCenter); + float x = perp * cos (phiCenter); + float y = perp * sin (phiCenter); + float z = iside * param.zMin; + // make cell geometry + GlobalPoint refPoint (x,y,z); // center of the cell's face + std::vector cellParams; + cellParams.reserve (5); + cellParams.push_back (0.5 * ( iEta - oEta )); // deta_half + cellParams.push_back (0.5 * param.dphi * DEGREE2RAD); // dphi_half + cellParams.push_back (0.5 * (param.zMax - param.zMin)); // dz_half + cellParams.push_back ( fabs( refPoint.eta())); + cellParams.push_back ( fabs( refPoint.z() ) ) ; +#ifdef DebugLog + std::cout << "HcalHardcodeGeometryLoader::fillHF-> " << hid << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl; +#endif + fGeometry->newCell(refPoint, refPoint, refPoint, + CaloCellGeometry::getParmPtr(cellParams, + fGeometry->parMgr(), + fGeometry->parVecVec()), + hid ) ; + } + } + } +} diff --git a/Geometry/HcalTowerAlgo/src/HcalTrigTowerGeometry.cc b/Geometry/HcalTowerAlgo/src/HcalTrigTowerGeometry.cc index eabbd34227564..41c018e48e8dd 100644 --- a/Geometry/HcalTowerAlgo/src/HcalTrigTowerGeometry.cc +++ b/Geometry/HcalTowerAlgo/src/HcalTrigTowerGeometry.cc @@ -1,14 +1,12 @@ #include "Geometry/HcalTowerAlgo/interface/HcalTrigTowerGeometry.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h" -#include "Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryData.h" #include #include HcalTrigTowerGeometry::HcalTrigTowerGeometry( const HcalTopology* topology ) - : theTopology( topology ) -{ + : theTopology( topology ) { useShortFibers_=true; useHFQuadPhiRings_=true; useUpgradeConfigurationHFTowers_=!true; @@ -215,20 +213,12 @@ int HcalTrigTowerGeometry::firstHFRingInTower(int ietaTower) const { void HcalTrigTowerGeometry::towerEtaBounds(int ieta, double & eta1, double & eta2) const { int ietaAbs = abs(ieta); - if(ietaAbs < firstHFTower()) { - eta1 = theHBHEEtaBounds[ietaAbs-1]; - eta2 = theHBHEEtaBounds[ietaAbs]; - // the last tower is split, so get tower 29, too - if(ietaAbs == theTopology->lastHERing()-1) { - eta2 = theHBHEEtaBounds[ietaAbs+1]; - } - } else { - // count from 0 - int hfIndex = firstHFRingInTower(ietaAbs) - theTopology->firstHFRing(); - eta1 = theHFEtaBounds[hfIndex]; - eta2 = theHFEtaBounds[hfIndex + hfTowerEtaSize(ieta)]; - } - + std::pair etas = + (ietaAbs < firstHFTower()) ? theTopology->etaRange(HcalBarrel,ietaAbs) : + theTopology->etaRange(HcalForward,ietaAbs); + eta1 = etas.first; + eta2 = etas.second; + // get the signs and order right if(ieta < 0) { double tmp = eta1; diff --git a/Geometry/HcalTowerAlgo/test/BuildFile.xml b/Geometry/HcalTowerAlgo/test/BuildFile.xml index 1315fa2f4aee4..c98a2624b43ac 100644 --- a/Geometry/HcalTowerAlgo/test/BuildFile.xml +++ b/Geometry/HcalTowerAlgo/test/BuildFile.xml @@ -1,17 +1,20 @@ + - - + + + + diff --git a/Geometry/HcalTowerAlgo/test/HcalGeometryAnalyzer.cc b/Geometry/HcalTowerAlgo/test/HcalGeometryAnalyzer.cc index b1d6819add4d9..414a813da9336 100644 --- a/Geometry/HcalTowerAlgo/test/HcalGeometryAnalyzer.cc +++ b/Geometry/HcalTowerAlgo/test/HcalGeometryAnalyzer.cc @@ -35,7 +35,7 @@ void HcalGeometryAnalyzer::analyze( const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup ) { edm::ESHandle topologyHandle; - iSetup.get().get( topologyHandle ); + iSetup.get().get( topologyHandle ); const HcalTopology* topology ( topologyHandle.product() ) ; edm::ESHandle pG; diff --git a/Geometry/HcalTowerAlgo/test/HcalGeometryDetIdAnalyzer.cc b/Geometry/HcalTowerAlgo/test/HcalGeometryDetIdAnalyzer.cc index ddc83b729cd4b..3fb41132b82c8 100644 --- a/Geometry/HcalTowerAlgo/test/HcalGeometryDetIdAnalyzer.cc +++ b/Geometry/HcalTowerAlgo/test/HcalGeometryDetIdAnalyzer.cc @@ -38,7 +38,7 @@ void HcalGeometryDetIdAnalyzer::analyze( const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup ) { edm::ESHandle topologyHandle; - iSetup.get().get( topologyHandle ); + iSetup.get().get( topologyHandle ); const HcalTopology* topology ( topologyHandle.product() ) ; edm::ESHandle pG; diff --git a/Geometry/HcalTowerAlgo/test/HcalGeometryTest.cpp b/Geometry/HcalTowerAlgo/test/HcalGeometryTest.cpp deleted file mode 100644 index 57adf958c14ee..0000000000000 --- a/Geometry/HcalTowerAlgo/test/HcalGeometryTest.cpp +++ /dev/null @@ -1,204 +0,0 @@ -#include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/HcalTowerAlgo/interface/HcalHardcodeGeometryLoader.h" -#include "Geometry/HcalTowerAlgo/interface/HcalFlexiHardcodeGeometryLoader.h" -#include "Geometry/HcalTowerAlgo/interface/HcalTrigTowerGeometry.h" -#include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ParameterSet/interface/FileInPath.h" -#include "FWCore/PythonParameterSet/interface/MakeParameterSets.h" -#include -#include -#include - -void testTriggerGeometry( HcalTopology& topology ) { - - HcalTrigTowerGeometry trigTowers( &topology ); - std::cout << "HCAL trigger tower eta bounds " << std::endl; - for(int ieta = 1; ieta <= 32; ++ieta) { - double eta1, eta2; - trigTowers.towerEtaBounds(ieta, eta1, eta2); - std::cout << ieta << " " << eta1 << " " << eta2 << std::endl; - } - - // now test some cell mappings - HcalDetId barrelDet(HcalBarrel, 1, 1, 1); - HcalDetId endcapDet(HcalEndcap, 29, 1, 1); - HcalDetId forwardDet1(HcalForward, 29, 71, 1); - HcalDetId forwardDet2(HcalForward, 29, 71, 2); - HcalDetId forwardDet3(HcalForward, 40, 71, 1); - - typedef std::vector TowerDets; - TowerDets barrelTowers = trigTowers.towerIds(barrelDet); - TowerDets endcapTowers = trigTowers.towerIds(endcapDet); - TowerDets forwardTowers1 = trigTowers.towerIds(forwardDet1); - TowerDets forwardTowers2 = trigTowers.towerIds(forwardDet2); - TowerDets forwardTowers3 = trigTowers.towerIds(forwardDet3); - - assert(barrelTowers.size() ==1); - assert(endcapTowers.size() ==2); - assert(forwardTowers1.size() ==1); - assert(forwardTowers2.size() ==1); - assert(forwardTowers3.size() ==1); - - std::cout << barrelTowers[0] << std::endl; - std::cout << endcapTowers[0] << std::endl; - std::cout << endcapTowers[1] << std::endl; - std::cout << forwardTowers1[0] << std::endl; - std::cout << forwardTowers3[0] << std::endl; - -} - -void -testClosestCell(const HcalDetId & detId, const CaloSubdetectorGeometry * geom) -{ - const CaloCellGeometry* cell = geom->getGeometry(detId); - std::cout << "i/p " << detId << " position " << cell->getPosition(); - HcalDetId closest = geom->getClosestCell( cell->getPosition() ); - std::cout << " closest " << closest << std::endl; - - if(closest != detId) { - std::cout << "ERROR mismatch. Original HCAL cell is " - << detId << " while nearest is " << closest << std::endl; - } -} - -void -testClosestCells( HcalTopology& topology ) -{ - edm::FileInPath fp("Geometry/HcalTowerAlgo/test/runHcalGeometryAnalyzer_cfg.py"); - std::string fname = fp.fullPath(); - std::shared_ptr pS = edm::readConfig(fname); - // std::cout << pS->dump() << std::endl; - - edm::ParameterSet const& pModule = - pS->getParameter("HcalHardcodeGeometryEP@"); - HcalFlexiHardcodeGeometryLoader loader(pModule); - - CaloSubdetectorGeometry* g = loader.load( topology ); - - // make sure each cel is its own closest cell - HcalDetId barrelDet(HcalBarrel, 1, 1, 1); - HcalDetId barrelDet2(HcalBarrel, 16, 50, 1); - HcalDetId endcapDet1(HcalEndcap, -17, 72, 1); - HcalDetId endcapDet2(HcalEndcap, 29, 35, 1); - HcalDetId forwardDet1(HcalForward, 30, 71, 1); - HcalDetId forwardDet3(HcalForward, -40, 71, 1); - - testClosestCell( barrelDet , g ); - testClosestCell( barrelDet2 , g ); - testClosestCell( endcapDet1 , g ); - testClosestCell( endcapDet2 , g ); - testClosestCell( forwardDet1, g ); - testClosestCell( forwardDet3, g ); - - const std::vector& ids=g->getValidDetIds(DetId::Hcal,HcalBarrel); - for (std::vector::const_iterator i=ids.begin(); i!=ids.end(); i++) { - testClosestCell( HcalDetId(*i), g ); - } -} - -void -testValidDetIds( HcalTopology& topology, DetId::Detector det, int subdet, char const* label ) -{ - HcalHardcodeGeometryLoader loader( topology ); - HcalHardcodeGeometryLoader::ReturnType caloGeom = loader.load( det, subdet ); - std::cout << std::endl << label << " : " << std::endl; - const std::vector& idshb = caloGeom->getValidDetIds( det, subdet ); - - int counter = 0; - for (std::vector::const_iterator i=idshb.begin(); i!=idshb.end(); i++, ++counter) { - HcalDetId hid=(*i); - std::cout << counter << ": din " << topology.detId2denseId(*i) << ":" << hid; - const CaloCellGeometry * cell = caloGeom->getGeometry(*i); - std::cout << *cell << std::endl; - } - - std::cout << "=== Total " << counter << " cells in " << label << std::endl; -} - -void -testFlexiValidDetIds( HcalTopology& topology, DetId::Detector det, int subdet, char const* label, std::vector &dins ) -{ - - edm::FileInPath fp("Geometry/HcalTowerAlgo/test/runHcalGeometryAnalyzer_cfg.py"); - std::string fname = fp.fullPath(); - std::shared_ptr pS = edm::readConfig(fname); - // std::cout << pS->dump() << std::endl; - - edm::ParameterSet const& pModule = - pS->getParameter("HcalHardcodeGeometryEP@"); - HcalFlexiHardcodeGeometryLoader loader(pModule); - - CaloSubdetectorGeometry* caloGeom = loader.load( topology ); - std::cout << std::endl << label << " : " << std::endl; - const std::vector& idshb = caloGeom->getValidDetIds( det, subdet ); - - //std::vector dins; - - int counter = 0; - for (std::vector::const_iterator i=idshb.begin(); i!=idshb.end(); i++, ++counter) { - HcalDetId hid=(*i); - std::cout << counter << ": din " << topology.detId2denseId(*i) << ":" << hid; - dins.push_back( topology.detId2denseId(*i)); - - const CaloCellGeometry * cell = caloGeom->getGeometry(*i); - std::cout << *cell << std::endl; - } - - std::sort( dins.begin(), dins.end()); - std::cout << "=== Total " << counter << " cells in " << label << std::endl; - - counter = 0; - for (std::vector::const_iterator i=dins.begin(); i != dins.end(); ++i, ++counter) { - HcalDetId hid = (topology.denseId2detId(*i)); - HcalDetId ihid = (topology.denseId2detId(dins[counter])); - std::cout << counter << ": din " << (*i) << " :" << hid << " == " << ihid << std::endl; - } -} - -int main() { - - std::cout << "Test current Hcal geometry" << std::endl; - - HcalTopologyMode::Mode mode = HcalTopologyMode::LHC; - int maxDepthHB = 2; - int maxDepthHE = 3; - HcalTopology topology( mode, maxDepthHB, maxDepthHE ); - - testValidDetIds( topology, DetId::Hcal, HcalBarrel, " BARREL " ); - testValidDetIds( topology, DetId::Hcal, HcalEndcap, " ENDCAP " ); - testValidDetIds( topology, DetId::Hcal, HcalOuter, " OUTER " ); - testValidDetIds( topology, DetId::Hcal, HcalForward, " FORWARD " ); - - testTriggerGeometry( topology ); - - testClosestCells( topology ); - - std::cout << "Test SLHC Hcal geometry" << std::endl; - - mode = HcalTopologyMode::SLHC; - maxDepthHB = 7; - maxDepthHE = 7; - HcalTopology stopology( mode, maxDepthHB, maxDepthHE ); - - testValidDetIds( stopology, DetId::Hcal, HcalBarrel, " SLHC BARREL " ); - testValidDetIds( stopology, DetId::Hcal, HcalEndcap, " SLHC ENDCAP " ); - testValidDetIds( stopology, DetId::Hcal, HcalOuter, " SLHC OUTER " ); - testValidDetIds( stopology, DetId::Hcal, HcalForward, " SLHC FORWARD " ); - - std::cout << "Test SLHC Hcal Flexi geometry" << std::endl; - std::vector dins; - - testFlexiValidDetIds( stopology, DetId::Hcal, HcalBarrel, " SLHC BARREL ", dins ); - testFlexiValidDetIds( stopology, DetId::Hcal, HcalEndcap, " SLHC ENDCAP ", dins ); - testFlexiValidDetIds( stopology, DetId::Hcal, HcalOuter, " SLHC OUTER ", dins ); - testFlexiValidDetIds( stopology, DetId::Hcal, HcalForward, " SLHC FORWARD ", dins ); - - testTriggerGeometry( stopology ); - - testClosestCells( stopology ); - - return 0; -} diff --git a/Geometry/HcalTowerAlgo/test/HcalGeometryTester.cc b/Geometry/HcalTowerAlgo/test/HcalGeometryTester.cc new file mode 100644 index 0000000000000..31224afd9d281 --- /dev/null +++ b/Geometry/HcalTowerAlgo/test/HcalGeometryTester.cc @@ -0,0 +1,248 @@ +#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" +#include "Geometry/HcalTowerAlgo/interface/HcalFlexiHardcodeGeometryLoader.h" +#include "Geometry/HcalTowerAlgo/interface/HcalHardcodeGeometryLoader.h" +#include "Geometry/HcalTowerAlgo/interface/HcalTrigTowerGeometry.h" +#include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h" +#include +#include + +class HcalGeometryTester : public edm::EDAnalyzer { + +public: + explicit HcalGeometryTester( const edm::ParameterSet& ); + ~HcalGeometryTester( void ); + + virtual void analyze( const edm::Event&, const edm::EventSetup& ); + +private: + void testValidDetIds(CaloSubdetectorGeometry* geom, const HcalTopology& topo, + DetId::Detector det, int subdet, std::string label); + void testClosestCells(CaloSubdetectorGeometry* geom, const HcalTopology& top); + void testClosestCell(const HcalDetId & detId, CaloSubdetectorGeometry * geom); + void testTriggerGeometry(const HcalTopology& topology); + void testFlexiValidDetIds(CaloSubdetectorGeometry* geom, + const HcalTopology& topology, DetId::Detector det, + int subdet, std::string label, + std::vector &dins); + void testFlexiGeomHF(CaloSubdetectorGeometry* geom); + + edm::ParameterSet ps0; + std::string m_label; + bool useOld_; +}; + +HcalGeometryTester::HcalGeometryTester( const edm::ParameterSet& iConfig ) : + ps0(iConfig), m_label("_master") { + m_label = iConfig.getParameter( "HCALGeometryLabel" ); + useOld_ = iConfig.getParameter( "UseOldLoader" ); +} + +HcalGeometryTester::~HcalGeometryTester() { } + +void HcalGeometryTester::analyze(const edm::Event& /*iEvent*/, + const edm::EventSetup& iSetup) { + + edm::ESHandle hDRCons; + iSetup.get().get(hDRCons); + const HcalDDDRecConstants hcons = (*hDRCons); + edm::ESHandle topologyHandle; + iSetup.get().get(topologyHandle); + const HcalTopology topology = (*topologyHandle); + CaloSubdetectorGeometry* geom(0); + if (useOld_) { + HcalHardcodeGeometryLoader m_loader(ps0); + geom = m_loader.load(topology); + } else { + HcalFlexiHardcodeGeometryLoader m_loader(ps0); + geom = m_loader.load(topology, hcons); + } + + testValidDetIds(geom, topology, DetId::Hcal, HcalBarrel, " BARREL "); + testValidDetIds(geom, topology, DetId::Hcal, HcalEndcap, " ENDCAP "); + testValidDetIds(geom, topology, DetId::Hcal, HcalOuter, " OUTER "); + testValidDetIds(geom, topology, DetId::Hcal, HcalForward, " FORWARD "); + + testTriggerGeometry(topology); + + testClosestCells(geom, topology); + std::cout << "Test SLHC Hcal Flexi geometry" << std::endl; + std::vector dins; + + testFlexiValidDetIds(geom, topology, DetId::Hcal, HcalBarrel, " BARREL ", dins ); + testFlexiValidDetIds(geom, topology, DetId::Hcal, HcalEndcap, " ENDCAP ", dins ); + testFlexiValidDetIds(geom, topology, DetId::Hcal, HcalOuter, " OUTER ", dins ); + testFlexiValidDetIds(geom, topology, DetId::Hcal, HcalForward," FORWARD ", dins ); + + testFlexiGeomHF(geom); +} + +void HcalGeometryTester::testValidDetIds(CaloSubdetectorGeometry* caloGeom, + const HcalTopology& topology, + DetId::Detector det, int subdet, + std::string label) { + + std::cout << std::endl << label << " : " << std::endl; + const std::vector& idshb = caloGeom->getValidDetIds(det, subdet); + + int counter = 0; + for (std::vector::const_iterator i=idshb.begin(); i!=idshb.end(); + i++, ++counter) { + HcalDetId hid=(*i); + std::cout << counter << ": din " << topology.detId2denseId(*i) << ":" + << hid; + const CaloCellGeometry * cell = caloGeom->getGeometry(*i); + std::cout << *cell << std::endl; + } + + std::cout << "=== Total " << counter << " cells in " << label << std::endl; +} + +void HcalGeometryTester::testClosestCells(CaloSubdetectorGeometry* g, + const HcalTopology& topology ) { + + // make sure each cel is its own closest cell + HcalDetId barrelDet1(HcalBarrel, 1, 1, 1); + HcalDetId barrelDet2(HcalBarrel, 16, 50, 1); + HcalDetId endcapDet1(HcalEndcap, -17, 72, 1); + HcalDetId endcapDet2(HcalEndcap, 29, 35, 1); + HcalDetId forwardDet1(HcalForward, 30, 71, 1); + HcalDetId forwardDet3(HcalForward, -40, 71, 1); + + if (topology.valid(barrelDet1)) testClosestCell(barrelDet1 , g); + if (topology.valid(barrelDet2)) testClosestCell(barrelDet2 , g); + if (topology.valid(endcapDet1)) testClosestCell(endcapDet1 , g); + if (topology.valid(endcapDet2)) testClosestCell(endcapDet2 , g); + if (topology.valid(forwardDet1)) testClosestCell(forwardDet1, g); + if (topology.valid(forwardDet3)) testClosestCell(forwardDet3, g); + + const std::vector& ids=g->getValidDetIds(DetId::Hcal,HcalBarrel); + for (std::vector::const_iterator i=ids.begin(); i!=ids.end(); i++) { + testClosestCell(HcalDetId(*i), g); + } +} + +void HcalGeometryTester::testClosestCell(const HcalDetId & detId, + CaloSubdetectorGeometry *geom) { + + const CaloCellGeometry* cell = geom->getGeometry(detId); + std::cout << "i/p " << detId << " position " << cell->getPosition(); + HcalDetId closest = geom->getClosestCell(cell->getPosition()); + std::cout << " closest " << closest << std::endl; + + if(closest != detId) { + std::cout << "ERROR mismatch. Original HCAL cell is " + << detId << " while nearest is " << closest << std::endl; + } +} + +void HcalGeometryTester::testTriggerGeometry(const HcalTopology& topology) { + + HcalTrigTowerGeometry trigTowers( &topology ); + std::cout << "HCAL trigger tower eta bounds " << std::endl; + for(int ieta = 1; ieta <= 32; ++ieta) { + double eta1, eta2; + trigTowers.towerEtaBounds(ieta, eta1, eta2); + std::cout << ieta << " " << eta1 << " " << eta2 << std::endl; + } + + // now test some cell mappings + HcalDetId barrelDet(HcalBarrel, 1, 1, 1); + HcalDetId endcapDet(HcalEndcap, 29, 1, 1); + HcalDetId forwardDet1(HcalForward, 29, 71, 1); + HcalDetId forwardDet2(HcalForward, 29, 71, 2); + HcalDetId forwardDet3(HcalForward, 40, 71, 1); + + typedef std::vector TowerDets; + if (topology.valid(barrelDet)) { + TowerDets barrelTowers = trigTowers.towerIds(barrelDet); + std::cout << "Trigger Tower Size: Barrel " << barrelTowers.size() << "\n"; + assert(barrelTowers.size() ==1); + std::cout << barrelTowers[0] << std::endl; + } + if (topology.valid(endcapDet)) { + TowerDets endcapTowers = trigTowers.towerIds(endcapDet); + std::cout << "Trigger Tower Size: Endcap " << endcapTowers.size() << "\n"; + assert(endcapTowers.size() >=1); + std::cout << endcapTowers[0] << std::endl; + if (endcapTowers.size() > 1) std::cout << endcapTowers[1] << std::endl; + } + if (topology.valid(forwardDet1)) { + TowerDets forwardTowers1 = trigTowers.towerIds(forwardDet1); + std::cout << "Trigger Tower Size: Forward1 " << forwardTowers1.size() << "\n"; + assert(forwardTowers1.size() ==1); + std::cout << forwardTowers1[0] << std::endl; + } + if (topology.valid(forwardDet1)) { + TowerDets forwardTowers2 = trigTowers.towerIds(forwardDet2); + std::cout << "Trigger Tower Size: Forward2 " << forwardTowers2.size() << "\n"; + assert(forwardTowers2.size() ==1); + std::cout << forwardTowers2[0] << std::endl; + } + if (topology.valid(forwardDet1)) { + TowerDets forwardTowers3 = trigTowers.towerIds(forwardDet3); + std::cout << "Trigger Tower Size: Forward3 " << forwardTowers3.size() << "\n"; + assert(forwardTowers3.size() ==1); + std::cout << forwardTowers3[0] << std::endl; + } +} + +void HcalGeometryTester::testFlexiValidDetIds(CaloSubdetectorGeometry* caloGeom, + const HcalTopology& topology, + DetId::Detector det, int subdet, + std::string label, + std::vector &dins) { + + std::cout << std::endl << label << " : " << std::endl; + const std::vector& idshb = caloGeom->getValidDetIds(det, subdet); + + int counter = 0; + for (std::vector::const_iterator i=idshb.begin(); i!=idshb.end(); + i++, ++counter) { + HcalDetId hid=(*i); + std::cout << counter << ": din " << topology.detId2denseId(*i) << ":" << hid; + dins.push_back( topology.detId2denseId(*i)); + + const CaloCellGeometry * cell = caloGeom->getGeometry(*i); + std::cout << *cell << std::endl; + } + + std::sort( dins.begin(), dins.end()); + std::cout << "=== Total " << counter << " cells in " << label << std::endl; + + counter = 0; + for (std::vector::const_iterator i=dins.begin(); i != dins.end(); + ++i, ++counter) { + HcalDetId hid = (topology.denseId2detId(*i)); + HcalDetId ihid = (topology.denseId2detId(dins[counter])); + std::cout << counter << ": din " << (*i) << " :" << hid << " == " << ihid << std::endl; + } +} + +void HcalGeometryTester::testFlexiGeomHF(CaloSubdetectorGeometry* caloGeom) { + + std::cout << std::endl << "Test HF Geometry : " << std::endl; + for (int ieta = 29; ieta <=41; ++ieta) { + HcalDetId cell3 (HcalForward, ieta, 3, 1); + const CaloCellGeometry* cellGeometry3 = caloGeom->getGeometry (cell3); + if (cellGeometry3) { + std::cout << "cell geometry iphi=3 -> ieta=" << ieta + << " eta " << cellGeometry3->getPosition().eta () << "+-" + << std::abs(cellGeometry3->getCorners()[0].eta() - + cellGeometry3->getCorners()[2].eta())/2 + << " phi " << cellGeometry3->getPosition().phi ()/3.1415*180 + << "+-" << std::abs(cellGeometry3->getCorners()[0].phi() - + cellGeometry3->getCorners()[2].phi())/3.1415*180/2. + << std::endl; + } + } +} + +DEFINE_FWK_MODULE(HcalGeometryTester); diff --git a/Geometry/HcalTowerAlgo/test/runHcalGeometryAnalyzer_cfg.py b/Geometry/HcalTowerAlgo/test/runHcalGeometryAnalyzer_cfg.py index 67cb42c007db1..32a7ced090425 100644 --- a/Geometry/HcalTowerAlgo/test/runHcalGeometryAnalyzer_cfg.py +++ b/Geometry/HcalTowerAlgo/test/runHcalGeometryAnalyzer_cfg.py @@ -3,19 +3,14 @@ process = cms.Process("HcalGeometryTest") -process.load("Configuration.Geometry.GeometryExtended_cff") -process.load("Geometry.HcalEventSetup.HcalTopology_cfi") - -process.HcalHardcodeGeometryEP = cms.ESProducer( "HcalHardcodeGeometryEP" , - appendToDataLabel = cms.string("_master"), - HcalReLabel = HcalReLabel - ) -## Comment it out to test std Hcal geometry -## -import Geometry.HcalEventSetup.hcalSLHCTopologyConstants_cfi as hcalTopologyConstants_cfi -process.hcalTopologyIdeal.hcalTopologyConstants = cms.PSet(hcalTopologyConstants_cfi.hcalTopologyConstants) -## +process.load("Geometry.HcalCommonData.testPhase0GeometryXML_cfi") +process.load("Geometry.HcalCommonData.hcalDDConstants_cff") +process.load("Geometry.HcalEventSetup.hcalTopologyIdeal_cfi") +process.HcalHardcodeGeometryEP = cms.ESProducer("HcalHardcodeGeometryEP" , + appendToDataLabel = cms.string("_master"), + HcalReLabel = HcalReLabel + ) process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) diff --git a/Geometry/HcalTowerAlgo/test/runHcalGeometryDBAnalyzer_cfg.py b/Geometry/HcalTowerAlgo/test/runHcalGeometryDBAnalyzer_cfg.py index b240c989fe62a..bb5524e6fc5da 100644 --- a/Geometry/HcalTowerAlgo/test/runHcalGeometryDBAnalyzer_cfg.py +++ b/Geometry/HcalTowerAlgo/test/runHcalGeometryDBAnalyzer_cfg.py @@ -26,11 +26,6 @@ ## appendToDataLabel = cms.string("_master"), ## HcalReLabel = HcalReLabel ## ) -## Comment it out to test std Hcal geometry -## -import Geometry.HcalEventSetup.hcalSLHCTopologyConstants_cfi as hcalTopologyConstants_cfi -process.hcalTopologyIdeal.hcalTopologyConstants = cms.PSet(hcalTopologyConstants_cfi.hcalTopologyConstants) -## process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet( diff --git a/Geometry/HcalTowerAlgo/test/runHcalGeometryDetIdAnalyzer_cfg.py b/Geometry/HcalTowerAlgo/test/runHcalGeometryDetIdAnalyzer_cfg.py index 356dce56ad34b..d733b3baccccf 100644 --- a/Geometry/HcalTowerAlgo/test/runHcalGeometryDetIdAnalyzer_cfg.py +++ b/Geometry/HcalTowerAlgo/test/runHcalGeometryDetIdAnalyzer_cfg.py @@ -3,19 +3,14 @@ process = cms.Process("HcalGeometryTest") -process.load("Configuration.Geometry.GeometryExtended_cff") -process.load("Geometry.HcalEventSetup.HcalTopology_cfi") - -process.HcalHardcodeGeometryEP = cms.ESProducer( "HcalHardcodeGeometryEP" , - appendToDataLabel = cms.string("_master"), - HcalReLabel = HcalReLabel - ) -## Comment it out to test std Hcal geometry -## -import Geometry.HcalEventSetup.hcalSLHCTopologyConstants_cfi as hcalTopologyConstants_cfi -process.hcalTopologyIdeal.hcalTopologyConstants = cms.PSet(hcalTopologyConstants_cfi.hcalTopologyConstants) -## +process.load("Geometry.HcalCommonData.testPhase0GeometryXML_cfi") +process.load("Geometry.HcalCommonData.hcalDDConstants_cff") +process.load("Geometry.HcalEventSetup.hcalTopologyIdeal_cfi") +process.HcalHardcodeGeometryEP = cms.ESProducer("HcalHardcodeGeometryEP" , + appendToDataLabel = cms.string("_master"), + HcalReLabel = HcalReLabel + ) process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) diff --git a/Geometry/HcalTowerAlgo/test/runHcalGeometryTester_cfg.py b/Geometry/HcalTowerAlgo/test/runHcalGeometryTester_cfg.py new file mode 100644 index 0000000000000..f452fc7b095fa --- /dev/null +++ b/Geometry/HcalTowerAlgo/test/runHcalGeometryTester_cfg.py @@ -0,0 +1,37 @@ +import FWCore.ParameterSet.Config as cms +from Geometry.HcalEventSetup.HcalRelabel_cfi import HcalReLabel + +process = cms.Process("HcalGeometryTest") + +process.load("Geometry.HcalCommonData.testPhase0GeometryXML_cfi") +process.load("Geometry.HcalCommonData.hcalDDConstants_cff") +process.load("Geometry.HcalEventSetup.hcalTopologyIdeal_cfi") + +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('cout'), + categories = cms.untracked.vstring('HCalGeom'), + debugModules = cms.untracked.vstring('*'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + HCalGeom = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ) +) + +process.source = cms.Source("EmptySource") +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.hga = cms.EDAnalyzer("HcalGeometryTester", + HCALGeometryLabel = cms.string("_master"), + UseOldLoader = cms.bool(False)) + +process.Timing = cms.Service("Timing") +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck") + +process.p1 = cms.Path(process.hga) diff --git a/Geometry/HcalTowerAlgo/test/runHcalTransGeometryAnalyzer_cfg.py b/Geometry/HcalTowerAlgo/test/runHcalTransGeometryAnalyzer_cfg.py index 8d3132a9ab403..6d30f675644fb 100644 --- a/Geometry/HcalTowerAlgo/test/runHcalTransGeometryAnalyzer_cfg.py +++ b/Geometry/HcalTowerAlgo/test/runHcalTransGeometryAnalyzer_cfg.py @@ -3,19 +3,13 @@ process = cms.Process("HcalGeometryTest") -process.load("Configuration.Geometry.GeometryExtended_cff") +process.load("Configuration.Geometry.GeometryExtendedPostLS2_cff") process.load("Geometry.HcalEventSetup.HcalTopology_cfi") process.HcalHardcodeGeometryEP = cms.ESProducer( "HcalHardcodeGeometryEP" , appendToDataLabel = cms.string("_master"), HcalReLabel = HcalReLabel ) -## Comment it out to test std Hcal geometry -## -import Geometry.HcalEventSetup.hcalSLHCTopologyConstants_cfi as hcalTopologyConstants_cfi -process.hcalTopologyIdeal.hcalTopologyConstants = cms.PSet(hcalTopologyConstants_cfi.hcalTopologyConstants) -## - process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) diff --git a/Geometry/Records/interface/CaloGeometryRecord.h b/Geometry/Records/interface/CaloGeometryRecord.h index 8382e786aa188..6bde17e882d70 100644 --- a/Geometry/Records/interface/CaloGeometryRecord.h +++ b/Geometry/Records/interface/CaloGeometryRecord.h @@ -16,6 +16,9 @@ #include "Geometry/Records/interface/EcalBarrelGeometryRecord.h" #include "Geometry/Records/interface/EcalEndcapGeometryRecord.h" #include "Geometry/Records/interface/EcalPreshowerGeometryRecord.h" +#include "Geometry/Records/interface/HcalParametersRcd.h" +#include "Geometry/Records/interface/HcalSimNumberingRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "Geometry/Records/interface/HcalGeometryRecord.h" #include "Geometry/Records/interface/CaloTowerGeometryRecord.h" #include "Geometry/Records/interface/ZDCGeometryRecord.h" @@ -31,6 +34,9 @@ class CaloGeometryRecord : EcalBarrelGeometryRecord, EcalEndcapGeometryRecord, EcalPreshowerGeometryRecord, + HcalParametersRcd, + HcalSimNumberingRecord, + HcalRecNumberingRecord, HcalGeometryRecord, CaloTowerGeometryRecord, CastorGeometryRecord, diff --git a/Geometry/Records/interface/CaloTowerGeometryRecord.h b/Geometry/Records/interface/CaloTowerGeometryRecord.h index 5ef211214e020..9d6458593ac89 100644 --- a/Geometry/Records/interface/CaloTowerGeometryRecord.h +++ b/Geometry/Records/interface/CaloTowerGeometryRecord.h @@ -13,6 +13,7 @@ #include "FWCore/Framework/interface/EventSetupRecordImplementation.h" #include "FWCore/Framework/interface/DependentRecordImplementation.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "CondFormats/AlignmentRecord/interface/CaloTowerAlignmentRcd.h" #include "CondFormats/AlignmentRecord/interface/CaloTowerAlignmentErrorRcd.h" #include "CondFormats/AlignmentRecord/interface/CaloTowerAlignmentErrorExtendedRcd.h" @@ -26,6 +27,7 @@ class CaloTowerGeometryRecord : CaloTowerGeometryRecord, boost::mpl::vector< IdealGeometryRecord, + HcalRecNumberingRecord, CaloTowerAlignmentRcd, CaloTowerAlignmentErrorRcd, CaloTowerAlignmentErrorExtendedRcd, diff --git a/Geometry/Records/interface/HcalGeometryRecord.h b/Geometry/Records/interface/HcalGeometryRecord.h index 2069ba6c5e158..827eafabd92c7 100644 --- a/Geometry/Records/interface/HcalGeometryRecord.h +++ b/Geometry/Records/interface/HcalGeometryRecord.h @@ -12,7 +12,7 @@ #include "FWCore/Framework/interface/EventSetupRecordImplementation.h" #include "FWCore/Framework/interface/DependentRecordImplementation.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "CondFormats/AlignmentRecord/interface/HcalAlignmentRcd.h" #include "CondFormats/AlignmentRecord/interface/HcalAlignmentErrorRcd.h" #include "CondFormats/AlignmentRecord/interface/HcalAlignmentErrorExtendedRcd.h" @@ -24,13 +24,16 @@ class HcalGeometryRecord : public edm::eventsetup::DependentRecordImplementation< HcalGeometryRecord, - boost::mpl::vector< - IdealGeometryRecord, - HcalAlignmentRcd, - HcalAlignmentErrorRcd, - HcalAlignmentErrorExtendedRcd, - GlobalPositionRcd, - PHcalRcd > > {}; + boost::mpl::vector< + IdealGeometryRecord, + HcalParametersRcd, + HcalSimNumberingRecord, + HcalRecNumberingRecord, + HcalAlignmentRcd, + HcalAlignmentErrorRcd, + HcalAlignmentErrorExtendedRcd, + GlobalPositionRcd, + PHcalRcd > > {}; #endif /* RECORDS_HCALGEOMETRYRECORD_H */ diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 19c65f56a1219..8b1344518fe1f 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -112,6 +112,14 @@ def customiseFor10234(process): delattr(process.hltCaloStage1Digis, 'FedId') return process +def customiseFor10353(process): + # Take care of geometry changes in HCAL + if not hasattr(process,'hcalDDDSimConstants'): + process.hcalDDDSimConstants = cms.ESProducer( 'HcalDDDSimConstantsESModule' ) + if not hasattr(process,'hcalDDDRecConstants'): + process.hcalDDDRecConstants = cms.ESProducer( 'HcalDDDRecConstantsESModule' ) + return process + # upgrade RecoTrackSelector to allow selection on originalAlgo (PR #10418) def customiseFor10418(process): if hasattr(process,'hltBSoftMuonMu5L3') : @@ -174,6 +182,7 @@ def customiseHLTforCMSSW(process, menuType="GRun", fastSim=False): if cmsswVersion >= "CMSSW_7_6": process = customiseFor10418(process) + process = customiseFor10353(process) process = customiseFor10911(process) process = customiseFor11183(process) if cmsswVersion >= "CMSSW_7_5": diff --git a/HLTriggerOffline/B2G/python/b2gSingleLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/B2G/python/b2gSingleLeptonHLTEventValidation_cfi.py index b67c11175d931..071cd5bd14e39 100644 --- a/HLTriggerOffline/B2G/python/b2gSingleLeptonHLTEventValidation_cfi.py +++ b/HLTriggerOffline/B2G/python/b2gSingleLeptonHLTEventValidation_cfi.py @@ -22,7 +22,8 @@ minJets = cms.untracked.uint32(2), # Trigger sTrigger = cms.untracked.string("TriggerResults"), - vsPaths = cms.untracked.vstring(['HLT_Mu40_eta2p1_PFJet200_PFJet50']), + vsPaths = cms.untracked.vstring(['HLT_Mu40_eta2p1_PFJet200_PFJet50', + 'HLT_Mu30_eta2p1_PFJet150_PFJet50']), ) # ttbar semi electronique @@ -47,5 +48,6 @@ minJets = cms.untracked.uint32(2), # Trigger sTrigger = cms.untracked.string("TriggerResults"), - vsPaths = cms.untracked.vstring(['HLT_Ele45_CaloIdVT_GsfTrkIdT_PFJet200_PFJet50']), + vsPaths = cms.untracked.vstring(['HLT_Ele45_CaloIdVT_GsfTrkIdT_PFJet200_PFJet50', + 'HLT_Ele35_CaloIdVT_GsfTrkIdT_PFJet150_PFJet50']), ) diff --git a/HLTriggerOffline/Higgs/python/hltHiggsValidator_cfi.py b/HLTriggerOffline/Higgs/python/hltHiggsValidator_cfi.py index 11f1dfa92d65d..dda34f4e4a95e 100644 --- a/HLTriggerOffline/Higgs/python/hltHiggsValidator_cfi.py +++ b/HLTriggerOffline/Higgs/python/hltHiggsValidator_cfi.py @@ -200,6 +200,8 @@ ), HiggsDalitz = cms.PSet( hltPathsToCheck = cms.vstring( + "HLT_Mu17_Photon22_CaloIdL_L1ISO_v", + "HLT_Mu17_Photon30_CaloIdL_L1ISO_v", "HLT_Mu12_Photon25_CaloIdL_v", "HLT_Mu12_Photon25_CaloIdL_L1ISO_v", "HLT_Mu12_Photon25_CaloIdL_L1OR_v" diff --git a/L1Trigger/L1TCalorimeter/src/PUSubtractionMethods.cc b/L1Trigger/L1TCalorimeter/src/PUSubtractionMethods.cc index c50218bd5e40a..4d2a9485602db 100644 --- a/L1Trigger/L1TCalorimeter/src/PUSubtractionMethods.cc +++ b/L1Trigger/L1TCalorimeter/src/PUSubtractionMethods.cc @@ -130,6 +130,8 @@ namespace l1t { //std::cout << "eta: " << regionEta << " pusub: " << puSub << std::endl; int regionEtCorr = std::max(0, regionET - puSub); + if(regionET == 1023) + regionEtCorr = 1023; // do not subtract overflow regions ROOT::Math::LorentzVector > lorentz(0,0,0,0); CaloRegion newSubRegion(*&lorentz, 0, 0, regionEtCorr, regionEta, regionPhi, notCorrectedRegion->hwQual(), notCorrectedRegion->hwEtEm(), notCorrectedRegion->hwEtHad()); diff --git a/L1Trigger/L1TCalorimeter/src/firmware/Stage1Layer2EtSumAlgorithmImpHW.cc b/L1Trigger/L1TCalorimeter/src/firmware/Stage1Layer2EtSumAlgorithmImpHW.cc index fda7fcf28fc6c..0e28a7f400e90 100644 --- a/L1Trigger/L1TCalorimeter/src/firmware/Stage1Layer2EtSumAlgorithmImpHW.cc +++ b/L1Trigger/L1TCalorimeter/src/firmware/Stage1Layer2EtSumAlgorithmImpHW.cc @@ -63,6 +63,26 @@ void l1t::Stage1Layer2EtSumAlgorithmImpHW::processEvent(const std::vector regionEtVect; std::vector regionHtVect; + // check the un-subtracted regions for overflow + bool regionOverflowEt(false); + bool regionOverflowHt(false); + for (auto& region : regions) { + if(region.hwEta() >= etSumEtaMinEt && region.hwEta() <= etSumEtaMaxEt) + { + if(region.hwPt() >= 1023) + { + regionOverflowEt = true; + } + } + if ( region.hwEta() >= etSumEtaMinHt && region.hwEta() <= etSumEtaMaxHt) + { + if(region.hwPt() >= 1023) + { + regionOverflowHt = true; + } + } + } + // hwPt() is the sum ET+HT in region, for stage 1 this will be // the region sum input to MET algorithm // In stage 2, we would move to hwEtEm() and hwEtHad() for separate MET/MHT @@ -103,13 +123,13 @@ void l1t::Stage1Layer2EtSumAlgorithmImpHW::processEvent(const std::vector= 0xfff) // MET 12 bits + if(MET >= 0xfff || regionOverflowEt) // MET 12 bits METqual = 1; - if(MHT >= 0x7f) // MHT 7 bits + if(MHT >= 0x7f || regionOverflowHt) // MHT 7 bits MHTqual = 1; - if(sumET >= 0xfff) + if(sumET >= 0xfff || regionOverflowEt) ETTqual = 1; - if(sumHT >= 0xfff) + if(sumHT >= 0xfff || regionOverflowHt) HTTqual = 1; MHT &= 127; // limit MHT to 7 bits as the firmware does, but only after checking for overflow. @@ -174,16 +194,12 @@ l1t::Stage1Layer2EtSumAlgorithmImpHW::doSumAndMET(const std::vector sumEtaPos{}; std::array sumEtaNeg{}; - bool inputOverflow(false); for (const auto& r : regionEt) { if ( r.ieta < 11 ) sumEtaNeg[r.iphi] += r.et; else sumEtaPos[r.iphi] += r.et; - - if ( r.et >= (1<<10) ) - inputOverflow = true; } std::array sumEta{}; @@ -194,8 +210,6 @@ l1t::Stage1Layer2EtSumAlgorithmImpHW::doSumAndMET(const std::vector= (1<<12) || inputOverflow) ? (1<<12):0); - assert(sumEt>=0 && sumEt < (1<<13)); // 0, 20, 40, 60, 80 degrees std::array sumsForCos{}; diff --git a/L1TriggerConfig/L1ScalesProducers/src/L1CaloHcalScaleConfigOnlineProd.cc b/L1TriggerConfig/L1ScalesProducers/src/L1CaloHcalScaleConfigOnlineProd.cc index 1d24f3cb14370..2c82842aad8cb 100644 --- a/L1TriggerConfig/L1ScalesProducers/src/L1CaloHcalScaleConfigOnlineProd.cc +++ b/L1TriggerConfig/L1ScalesProducers/src/L1CaloHcalScaleConfigOnlineProd.cc @@ -26,6 +26,7 @@ #include "Geometry/HcalTowerAlgo/interface/HcalTrigTowerGeometry.h" #include "CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h" #include "CondTools/L1Trigger/interface/OMDSReader.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include #include @@ -82,6 +83,8 @@ L1CaloHcalScaleConfigOnlineProd::L1CaloHcalScaleConfigOnlineProd( HcalTopologyMode::Mode mode = HcalTopologyMode::LHC; int maxDepthHB = 2; int maxDepthHE = 3; + edm::LogWarning("") << "Fix how to get HcalTopology correctly"; + /* if( iConfig.exists( "hcalTopologyConstants" )) { const edm::ParameterSet hcalTopoConsts = iConfig.getParameter( "hcalTopologyConstants" ); @@ -90,6 +93,7 @@ L1CaloHcalScaleConfigOnlineProd::L1CaloHcalScaleConfigOnlineProd( maxDepthHB = hcalTopoConsts.getParameter("maxDepthHB"); maxDepthHE = hcalTopoConsts.getParameter("maxDepthHE"); } + */ theTrigTowerGeometry = new HcalTrigTowerGeometry( new HcalTopology( mode, maxDepthHB, maxDepthHE )); } diff --git a/Mixing/Base/interface/PileUp.h b/Mixing/Base/interface/PileUp.h index d19bfe6b681dc..6c831e5339ea8 100644 --- a/Mixing/Base/interface/PileUp.h +++ b/Mixing/Base/interface/PileUp.h @@ -128,9 +128,6 @@ namespace edm { // sequential reading bool sequential_; - - // read the seed for the histo and probability function cases - int seed_; }; diff --git a/Mixing/Base/src/BMixingModule.cc b/Mixing/Base/src/BMixingModule.cc index 840778391d563..daf512a02ae4b 100644 --- a/Mixing/Base/src/BMixingModule.cc +++ b/Mixing/Base/src/BMixingModule.cc @@ -72,7 +72,7 @@ namespace } // Check if the histogram is normalized - if (((h->Integral() - 1) > 1.0e-02) && ((h->Integral() - 1) < -1.0e-02)) throw cms::Exception("BadHistoDistribution") << "The histogram should be normalized!" << std::endl; + if (std::abs(h->Integral() - 1) > 1.0e-02) throw cms::Exception("BadHistoDistribution") << "The histogram should be normalized!" << std::endl; // Get the averageNumber from the histo averageNumber = h->GetMean(); @@ -126,7 +126,7 @@ namespace } // Check if the histogram is normalized - if ( ((hprob->Integral() - 1) > 1.0e-02) && ((hprob->Integral() - 1) < -1.0e-02)){ + if (std::abs(hprob->Integral() - 1) > 1.0e-02){ throw cms::Exception("BadProbFunction") << "The probability function should be normalized!!! " << std::endl; } diff --git a/Mixing/Base/src/PileUp.cc b/Mixing/Base/src/PileUp.cc index 9ba28dd095c85..cd2d0e430463e 100644 --- a/Mixing/Base/src/PileUp.cc +++ b/Mixing/Base/src/PileUp.cc @@ -28,6 +28,37 @@ #include #include +#include "TMath.h" + +//////////////////////////////////////////////////////////////////////////////// +/// return a random number distributed according the histogram bin contents. +/// +/// This routine is derived from root/hist/hist/src/TH1.cxx +/************************************************************************* + * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +static Double_t GetRandom(TH1* th1, CLHEP::HepRandomEngine* rng) +{ + Int_t nbinsx = th1->GetNbinsX(); + Double_t* fIntegral = th1->GetIntegral(); + Double_t integral = fIntegral[nbinsx]; + + if (integral == 0) return 0; + + Double_t r1 = rng->flat(); + Int_t ibin = TMath::BinarySearch(nbinsx,fIntegral,r1); + Double_t x = th1->GetBinLowEdge(ibin+1); + if (r1 > fIntegral[ibin]) + x += th1->GetBinWidth(ibin+1)*(r1-fIntegral[ibin])/(fIntegral[ibin+1] - fIntegral[ibin]); + return x; +} +//////////////////////////////////////////////////////////////////////////////// + namespace edm { PileUp::PileUp(ParameterSet const& pset, std::string sourcename, double averageNumber, TH1F * const histo, const bool playback) : @@ -54,8 +85,7 @@ namespace edm { vPoissonDistr_OOT_(), randomEngines_(), playback_(playback), - sequential_(pset.getUntrackedParameter("sequential", false)), - seed_(0) { + sequential_(pset.getUntrackedParameter("sequential", false)) { // Use the empty parameter set for the parameter set ID of our "@MIXING" process. processConfiguration_->setParameterSetID(ParameterSet::emptyParameterSetID()); @@ -74,12 +104,14 @@ namespace edm { *processConfiguration_, nullptr)); + bool DB=type_=="readDB"; + if (pset.exists("nbPileupEvents")) { - seed_=pset.getParameter("nbPileupEvents").getUntrackedParameter("seed",0); + if (0 != pset.getParameter("nbPileupEvents").getUntrackedParameter("seed",0)) { + edm::LogWarning("MixingModule") << "Parameter nbPileupEvents.seed is not supported"; + } } - bool DB=type_=="readDB"; - edm::Service rng; if (!rng.isAvailable()) { throw cms::Exception("Configuration") @@ -88,24 +120,6 @@ namespace edm { "in the configuration file or remove the modules that require it."; } - // Get seed for the case when using user histogram or probability function - // RANDOM_NUMBER_ERROR - // Random number should be generated by the engines from the - // RandomNumberGeneratorService. This appears to use the global - // engine in ROOT. This is not thread safe unless the module using - // it is a one module and declares a shared resource and all - // other modules using it also declare the same shared resource. - // This also breaks replay. - if (histoDistribution_ || probFunctionDistribution_ || DB){ - if(seed_ !=0) { - gRandom->SetSeed(seed_); - LogInfo("MixingModule") << " Change seed for " << type_ << " mode. The seed is set to " << seed_; - } - else { - gRandom->SetSeed(rng->mySeed()); - } - } - if (!(histoDistribution_ || probFunctionDistribution_ || poisson_ || fixed_ || none_) && !DB) { throw cms::Exception("Illegal parameter value","PileUp::PileUp(ParameterSet const& pset)") << "'type' parameter (a string) has a value of '" << type_ << "'.\n" @@ -291,7 +305,7 @@ namespace edm { } // Check if the histogram is normalized - if ( ((histo_->Integral() - 1) > 1.0e-02) && ((histo_->Integral() - 1) < -1.0e-02)){ + if (std::abs(histo_->Integral() - 1) > 1.0e-02){ throw cms::Exception("BadProbFunction") << "The probability function should be normalized!!! " << std::endl; } averageNumber_=histo_->GetMean(); @@ -387,7 +401,7 @@ namespace edm { // it is a one module and declares a shared resource and all // other modules using it also declare the same shared resource. // This also breaks replay. - double d = histo_->GetRandom(); + double d = GetRandom(histo_, randomEngine(streamID)); //n = (int) floor(d + 0.5); // incorrect for bins with integer edges Fnzero_crossing = d; nzero_crossing = int(d); @@ -436,7 +450,7 @@ namespace edm { // it is a one module and declares a shared resource and all // other modules using it also declare the same shared resource. // This also breaks replay. - double d = histo_->GetRandom(); + double d = GetRandom(histo_, randomEngine(streamID)); PileupSelection.push_back(int(d)); TrueNumInteractions.push_back( d ); } diff --git a/PhysicsTools/PatAlgos/plugins/PATMHTProducer.cc b/PhysicsTools/PatAlgos/plugins/PATMHTProducer.cc index 9513e87735cb9..4e9be09ae0596 100755 --- a/PhysicsTools/PatAlgos/plugins/PATMHTProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATMHTProducer.cc @@ -223,7 +223,7 @@ pat::PATMHTProducer::getElectrons(edm::Event& iEvent, const edm::EventSetup & iS double number_of_electrons_ = 0.0; // edm::ESHandle cttopo; - // iSetup.get().get(cttopo); + // iSetup.get().get(cttopo); // const CaloTowerConstituentsMap* caloTowerMap = cttopo.product(); edm::Handle > electronHandle; diff --git a/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h b/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h index 28696128b5241..17496b26eed0d 100644 --- a/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h +++ b/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h @@ -198,6 +198,7 @@ void pat::PATMuonProducer::readIsolationLabels( const edm::ParameterSet & iConfi for ( ; it != ed; ++it, ++key) { labels.push_back(std::make_pair(pat::IsolationKeys(key), *it)); } + tokens = edm::vector_transform(labels, [this](IsolationLabel const & label){return consumes >(label.second);}); } } tokens = edm::vector_transform(labels, [this](pat::PATMuonProducer::IsolationLabel const & label){return consumes >(label.second);}); diff --git a/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.h b/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.h index 4a58b159cdf4c..2846d0b327284 100644 --- a/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.h +++ b/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.h @@ -177,6 +177,9 @@ void pat::PATPhotonProducer::readIsolationLabels( const edm::ParameterSet & iCon labels.push_back(std::make_pair(pat::IsolationKeys(key), *it)); } } + + tokens = edm::vector_transform(labels, [this](IsolationLabel const & label){return consumes >(label.second);}); + } tokens = edm::vector_transform(labels, [this](IsolationLabel const & label){return consumes >(label.second);}); } diff --git a/RecoBTag/SecondaryVertex/plugins/BVertexFilter.cc b/RecoBTag/SecondaryVertex/plugins/BVertexFilter.cc index 6dcbff2cca7d7..a792b544665f9 100644 --- a/RecoBTag/SecondaryVertex/plugins/BVertexFilter.cc +++ b/RecoBTag/SecondaryVertex/plugins/BVertexFilter.cc @@ -1,9 +1,9 @@ // -*- C++ -*- // -// Package: BVertexFilter -// Class: BVertexFilter +// Package: RecoBTag/SecondaryVertex +// Class: BVertexFilterT // -/**\class BVertexFilter BVertexFilter.cc DPGAnalysis/BVertexFilter/src/BVertexFilter.cc +/**\class BVertexFilterT BVertexFilter.cc RecoBTag/SecondaryVertex/plugins/BVertexFilter.cc Description: @@ -29,69 +29,73 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/InputTag.h" +#include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "RecoBTag/SecondaryVertex/interface/SecondaryVertex.h" +#include "RecoBTag/SecondaryVertex/interface/TemplatedSecondaryVertex.h" +#include "RecoBTag/SecondaryVertex/interface/VertexFilter.h" // // class declaration // -#include "RecoBTag/SecondaryVertex/interface/VertexFilter.h" -class BVertexFilter : public edm::stream::EDFilter<> { + +template +class BVertexFilterT : public edm::stream::EDFilter<> { public: - explicit BVertexFilter(const edm::ParameterSet&); - ~BVertexFilter(); + explicit BVertexFilterT(const edm::ParameterSet&); + ~BVertexFilterT(); private: virtual bool filter(edm::Event&, const edm::EventSetup&) override; edm::EDGetTokenT token_primaryVertex; - edm::EDGetTokenT token_secondaryVertex; + edm::EDGetTokenT > token_secondaryVertex; reco::VertexFilter svFilter; bool useVertexKinematicAsJetAxis; int minVertices; }; - -BVertexFilter::BVertexFilter(const edm::ParameterSet& params): +template +BVertexFilterT::BVertexFilterT(const edm::ParameterSet& params): svFilter(params.getParameter("vertexFilter")), useVertexKinematicAsJetAxis(params.getParameter("useVertexKinematicAsJetAxis")), minVertices(params.getParameter("minVertices")) { token_primaryVertex = consumes(params.getParameter("primaryVertices")); - token_secondaryVertex = consumes(params.getParameter("secondaryVertices")); - produces(); + token_secondaryVertex = consumes >(params.getParameter("secondaryVertices")); + produces >(); } - -BVertexFilter::~BVertexFilter() +template +BVertexFilterT::~BVertexFilterT() { } +template bool -BVertexFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) +BVertexFilterT::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { int count = 0; edm::Handle pvHandle; iEvent.getByToken(token_primaryVertex, pvHandle); - edm::Handle svHandle; + edm::Handle > svHandle; iEvent.getByToken(token_secondaryVertex, svHandle); - std::auto_ptr recoVertices(new reco::VertexCollection); + std::auto_ptr > recoVertices(new std::vector); if(pvHandle->size()!=0) { const reco::Vertex & primary = (*pvHandle.product())[0]; - const reco::VertexCollection & vertices = *svHandle.product(); + const edm::View & vertices = *svHandle.product(); if(! primary.isFake()) { - for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it) + for(typename edm::View::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it) { GlobalVector axis(0,0,0); if(useVertexKinematicAsJetAxis) axis = GlobalVector(it->p4().X(),it->p4().Y(),it->p4().Z()); - if(svFilter(primary,reco::TemplatedSecondaryVertex(primary,*it,axis,true),axis)) { + if(svFilter(primary,reco::TemplatedSecondaryVertex(primary,*it,axis,true),axis)) { count++; recoVertices->push_back(*it); } @@ -104,5 +108,10 @@ BVertexFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) } -//define this as a plug-in +// define specific instances of the templated BVertexFilterT class +typedef BVertexFilterT BVertexFilter; +typedef BVertexFilterT CandidateBVertexFilter; + +// define plugins DEFINE_FWK_MODULE(BVertexFilter); +DEFINE_FWK_MODULE(CandidateBVertexFilter); diff --git a/RecoBTag/SecondaryVertex/plugins/BtoCharmDecayVertexMerger.cc b/RecoBTag/SecondaryVertex/plugins/BtoCharmDecayVertexMerger.cc index a31660f159b34..f36f28518bf2b 100644 --- a/RecoBTag/SecondaryVertex/plugins/BtoCharmDecayVertexMerger.cc +++ b/RecoBTag/SecondaryVertex/plugins/BtoCharmDecayVertexMerger.cc @@ -8,6 +8,8 @@ #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DataFormats/BTauReco/interface/ParticleMasses.h" +#include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" @@ -20,55 +22,78 @@ #include -class BtoCharmDecayVertexMerger : public edm::stream::EDProducer<> { +reco::Candidate::LorentzVector vtxP4(const reco::VertexCompositePtrCandidate & vtx) { + reco::Candidate::LorentzVector sum; + const std::vector & tracks = vtx.daughterPtrVector(); + + for(std::vector::const_iterator track = tracks.begin(); track != tracks.end(); ++track) { + ROOT::Math::LorentzVector > vec; + vec.SetPx((*track)->px()); + vec.SetPy((*track)->py()); + vec.SetPz((*track)->pz()); + vec.SetM(reco::ParticleMasses::piPlus); + sum += vec; + } + return sum; +} + +template +class BtoCharmDecayVertexMergerT : public edm::stream::EDProducer<> { public: - BtoCharmDecayVertexMerger(const edm::ParameterSet ¶ms); + BtoCharmDecayVertexMergerT(const edm::ParameterSet ¶ms); virtual void produce(edm::Event &event, const edm::EventSetup &es); + typedef reco::TemplatedSecondaryVertex SecondaryVertex; + private: edm::EDGetTokenT token_primaryVertex; - edm::EDGetTokenT token_secondaryVertex; + edm::EDGetTokenT > token_secondaryVertex; reco::Vertex pv; // double maxFraction; // double minSignificance; - double minDRForUnique, vecSumIMCUTForUnique, minCosPAtomerge, maxPtreltomerge; + double maxDRForUnique, maxvecSumIMCUTForUnique, minCosPAtomerge, maxPtreltomerge; // a vertex proxy for sorting using stl - struct vertexProxy{ - reco::Vertex vert; + struct VertexProxy{ + VTX vert; double invm; size_t ntracks; }; - // comparison operator for vertexProxy, used in sorting - friend bool operator<(vertexProxy v1, vertexProxy v2){ + // comparison operator for VertexProxy, used in sorting + friend bool operator<(VertexProxy v1, VertexProxy v2){ if(v1.ntracks>2 && v2.ntracks<3) return true; if(v1.ntracks<3 && v2.ntracks>2) return false; return (v1.invm>v2.invm); } - void resolveBtoDchain(std::vector& coll, unsigned int i, unsigned int k); - GlobalVector flightDirection(reco::Vertex &pv, reco::Vertex &sv); -}; + VertexProxy buildVertexProxy(const VTX & vtx); + void resolveBtoDchain(std::vector& coll, unsigned int i, unsigned int k); + GlobalVector flightDirection(const reco::Vertex &v1, const reco::Vertex &v2); + GlobalVector flightDirection(const reco::Vertex &v1, const reco::VertexCompositePtrCandidate &v2); + GlobalVector flightDirection(const reco::VertexCompositePtrCandidate &v1, const reco::VertexCompositePtrCandidate &v2); +}; -BtoCharmDecayVertexMerger::BtoCharmDecayVertexMerger(const edm::ParameterSet ¶ms) : +template +BtoCharmDecayVertexMergerT::BtoCharmDecayVertexMergerT(const edm::ParameterSet ¶ms) : token_primaryVertex(consumes(params.getParameter("primaryVertices"))), - token_secondaryVertex(consumes(params.getParameter("secondaryVertices"))), - minDRForUnique(params.getUntrackedParameter("minDRUnique",0.4)), - vecSumIMCUTForUnique(params.getUntrackedParameter("minvecSumIMifsmallDRUnique",5.5)), - minCosPAtomerge(params.getUntrackedParameter("minCosPAtomerge",0.99)), - maxPtreltomerge(params.getUntrackedParameter("maxPtreltomerge",7777.0)) + token_secondaryVertex(consumes >(params.getParameter("secondaryVertices"))), + maxDRForUnique(params.getParameter("maxDRUnique")), + maxvecSumIMCUTForUnique(params.getParameter("maxvecSumIMifsmallDRUnique")), + minCosPAtomerge(params.getParameter("minCosPAtomerge")), + maxPtreltomerge(params.getParameter("maxPtreltomerge")) // maxFraction(params.getParameter("maxFraction")), // minSignificance(params.getParameter("minSignificance")) { - produces(); + produces >(); } -//----------------------- -void BtoCharmDecayVertexMerger::produce(edm::Event &iEvent, const edm::EventSetup &iSetup){ +//------------------------------------ +template +void BtoCharmDecayVertexMergerT::produce(edm::Event &iEvent, const edm::EventSetup &iSetup){ using namespace reco; // PV @@ -81,17 +106,16 @@ void BtoCharmDecayVertexMerger::produce(edm::Event &iEvent, const edm::EventSetu pv = pvc[0]; // get the IVF collection - edm::Handle secondaryVertices; + edm::Handle > secondaryVertices; iEvent.getByToken(token_secondaryVertex, secondaryVertices); //loop over vertices, fill into own collection for sorting - std::vector vertexProxyColl; - for(std::vector::const_iterator sv = secondaryVertices->begin(); + std::vector vertexProxyColl; + for(typename edm::View::const_iterator sv = secondaryVertices->begin(); sv != secondaryVertices->end(); ++sv) { - vertexProxy vtx = {*sv,(*sv).p4().M(),(*sv).tracksSize()}; - vertexProxyColl.push_back( vtx ); + vertexProxyColl.push_back( buildVertexProxy(*sv) ); } // sort the vertices by mass and track multiplicity @@ -99,33 +123,72 @@ void BtoCharmDecayVertexMerger::produce(edm::Event &iEvent, const edm::EventSetu // loop forward over all vertices - for(unsigned int iVtx=0; iVtx < vertexProxyColl.size(); iVtx++){ + for(unsigned int iVtx=0; iVtx < vertexProxyColl.size(); ++iVtx){ // nested loop backwards (in order to start from light masses) // check all vertices against each other for B->D chain - for(unsigned int kVtx=vertexProxyColl.size()-1; kVtx>iVtx; kVtx--){ + for(unsigned int kVtx=vertexProxyColl.size()-1; kVtx>iVtx; --kVtx){ // remove D vertices from the collection and add the tracks to the original one resolveBtoDchain(vertexProxyColl, iVtx, kVtx); } } // now create new vertex collection and add to event - VertexCollection *bvertices = new VertexCollection(); - for(std::vector::iterator it=vertexProxyColl.begin(); it!=vertexProxyColl.end(); it++) bvertices->push_back((*it).vert); - std::auto_ptr bvertColl(bvertices); + std::auto_ptr > bvertColl(new std::vector); + for(typename std::vector::const_iterator it=vertexProxyColl.begin(); it!=vertexProxyColl.end(); ++it) bvertColl->push_back((*it).vert); iEvent.put(bvertColl); } else{ - std::auto_ptr bvertCollEmpty(new VertexCollection); + std::auto_ptr > bvertCollEmpty(new std::vector); iEvent.put(bvertCollEmpty); } } +//------------------------------------ +template +GlobalVector +BtoCharmDecayVertexMergerT::flightDirection(const reco::Vertex & v1, const reco::Vertex & v2) { + return GlobalVector(v2.x() - v1.x(), + v2.y() - v1.y(), + v2.z() - v1.z()); +} +template +GlobalVector +BtoCharmDecayVertexMergerT::flightDirection(const reco::Vertex & v1, const reco::VertexCompositePtrCandidate & v2) { + return GlobalVector(v2.vertex().x() - v1.x(), + v2.vertex().y() - v1.y(), + v2.vertex().z() - v1.z()); +} -//------------------------------------ -void BtoCharmDecayVertexMerger::resolveBtoDchain(std::vector& coll, unsigned int i, unsigned int k){ +template +GlobalVector +BtoCharmDecayVertexMergerT::flightDirection(const reco::VertexCompositePtrCandidate & v1, const reco::VertexCompositePtrCandidate & v2) { + return GlobalVector(v2.vertex().x() - v1.vertex().x(), + v2.vertex().y() - v1.vertex().y(), + v2.vertex().z() - v1.vertex().z()); +} +//-------------- template specializations -------------------- + +// -------------- buildVertexProxy ---------------- +template<> +BtoCharmDecayVertexMergerT::VertexProxy +BtoCharmDecayVertexMergerT::buildVertexProxy(const reco::Vertex & vtx) { + VertexProxy vtxProxy = {vtx,vtx.p4().M(),vtx.tracksSize()}; + return vtxProxy; +} + +template<> +BtoCharmDecayVertexMergerT::VertexProxy +BtoCharmDecayVertexMergerT::buildVertexProxy(const reco::VertexCompositePtrCandidate & vtx) { + VertexProxy vtxProxy = {vtx,vtxP4(vtx).M(),vtx.numberOfSourceCandidatePtrs()}; + return vtxProxy; +} + +// -------------- resolveBtoDchain ---------------- +template<> +void BtoCharmDecayVertexMergerT::resolveBtoDchain(std::vector& coll, unsigned int i, unsigned int k){ using namespace reco; - typedef reco::TemplatedSecondaryVertex SecondaryVertex; + GlobalVector momentum1 = GlobalVector(coll[i].vert.p4().X(), coll[i].vert.p4().Y(), coll[i].vert.p4().Z()); GlobalVector momentum2 = GlobalVector(coll[k].vert.p4().X(), coll[k].vert.p4().Y(), coll[k].vert.p4().Z()); @@ -148,24 +211,25 @@ void BtoCharmDecayVertexMerger::resolveBtoDchain(std::vector& coll, } GlobalVector nearToFar = flightDirection( svNear, svFar); GlobalVector pvToNear = flightDirection( pv, svNear); + GlobalVector pvToFar = flightDirection( pv, svFar); double cosPA = nearToFar.dot(momentumFar) / momentumFar.mag()/ nearToFar.mag(); double cosa = pvToNear. dot(momentumFar) / pvToNear.mag() / momentumFar.mag(); double ptrel = sqrt(1.0 - cosa*cosa)* momentumFar.mag(); - double vertexDeltaR = Geom::deltaR(flightDirection(pv, sv1), flightDirection(pv, sv2) ); + double vertexDeltaR = Geom::deltaR(pvToNear, pvToFar); // create a set of all tracks from both vertices, avoid double counting by using a std::set<> std::set trackrefs; // first vertex - for(reco::Vertex::trackRef_iterator ti = sv1.tracks_begin(); ti!=sv1.tracks_end(); ti++){ + for(reco::Vertex::trackRef_iterator ti = sv1.tracks_begin(); ti!=sv1.tracks_end(); ++ti){ if(sv1.trackWeight(*ti)>0.5){ reco::TrackRef t = ti->castTo(); trackrefs.insert(t); } } // second vertex - for(reco::Vertex::trackRef_iterator ti = sv2.tracks_begin(); ti!=sv2.tracks_end(); ti++){ + for(reco::Vertex::trackRef_iterator ti = sv2.tracks_begin(); ti!=sv2.tracks_end(); ++ti){ if(sv2.trackWeight(*ti)>0.5){ reco::TrackRef t = ti->castTo(); trackrefs.insert(t); @@ -174,20 +238,20 @@ void BtoCharmDecayVertexMerger::resolveBtoDchain(std::vector& coll, // now calculate one LorentzVector from the track momenta ROOT::Math::LorentzVector > mother; - for(std::set::const_iterator it = trackrefs.begin(); it!= trackrefs.end(); it++){ - ROOT::Math::LorentzVector > temp ( (*it)->px(),(*it)->py(),(*it)->pz(), 0.13957 ); + for(std::set::const_iterator it = trackrefs.begin(); it!= trackrefs.end(); ++it){ + ROOT::Math::LorentzVector > temp ( (*it)->px(),(*it)->py(),(*it)->pz(), ParticleMasses::piPlus ); mother += temp; } // check if criteria for merging are fulfilled - if(vertexDeltaRminCosPAtomerge && fabs(ptrel)minCosPAtomerge && std::abs(ptrel)& coll, std::vector tracks_; std::vector refittedTracks_; std::vector weights_; - for(reco::Vertex::trackRef_iterator it = coll[i].vert.tracks_begin(); it!=coll[i].vert.tracks_end(); it++) { + for(reco::Vertex::trackRef_iterator it = coll[i].vert.tracks_begin(); it!=coll[i].vert.tracks_end(); ++it) { tracks_.push_back( *it); refittedTracks_.push_back( coll[i].vert.refittedTrack(*it)); weights_.push_back( coll[i].vert.trackWeight(*it) ); @@ -209,7 +273,7 @@ void BtoCharmDecayVertexMerger::resolveBtoDchain(std::vector& coll, coll[i].vert.removeTracks(); std::vector::iterator it2 = refittedTracks_.begin(); std::vector::iterator it3 = weights_.begin(); - for(reco::Vertex::trackRef_iterator it = tracks_.begin(); it!=tracks_.end(); it++, it2++, it3++){ + for(reco::Vertex::trackRef_iterator it = tracks_.begin(); it!=tracks_.end(); ++it, ++it2, ++it3){ float weight = *it3; float weight2= sv2.trackWeight(*it); Track refittedTrackWithLargerWeight = *it2; @@ -226,17 +290,84 @@ void BtoCharmDecayVertexMerger::resolveBtoDchain(std::vector& coll, } } -//------------- +template<> +void BtoCharmDecayVertexMergerT::resolveBtoDchain(std::vector& coll, unsigned int i, unsigned int k){ + using namespace reco; + + Candidate::LorentzVector vtx1P4 = vtxP4(coll[i].vert); + Candidate::LorentzVector vtx2P4 = vtxP4(coll[k].vert); + GlobalVector momentum1 = GlobalVector(vtx1P4.X(), vtx1P4.Y(), vtx1P4.Z()); + GlobalVector momentum2 = GlobalVector(vtx2P4.X(), vtx2P4.Y(), vtx2P4.Z()); -GlobalVector -BtoCharmDecayVertexMerger::flightDirection(reco::Vertex &pv, reco::Vertex &sv){ - GlobalVector res(sv.position().X() - pv.position().X(), - sv.position().Y() - pv.position().Y(), - sv.position().Z() - pv.position().Z()); - return res; + SecondaryVertex sv1(pv, coll[i].vert, momentum1 , true); + SecondaryVertex sv2(pv, coll[k].vert, momentum2 , true); + + + // find out which one is near and far + SecondaryVertex svNear = sv1; + SecondaryVertex svFar = sv2; + GlobalVector momentumNear = momentum1; + GlobalVector momentumFar = momentum2; + + // swap if it is the other way around + if(sv1.dist3d().value() >= sv2.dist3d().value()){ + svNear = sv2; + svFar = sv1; + momentumNear = momentum2; + momentumFar = momentum1; + } + GlobalVector nearToFar = flightDirection( svNear, svFar); + GlobalVector pvToNear = flightDirection( pv, svNear); + GlobalVector pvToFar = flightDirection( pv, svFar); + + double cosPA = nearToFar.dot(momentumFar) / momentumFar.mag()/ nearToFar.mag(); + double cosa = pvToNear. dot(momentumFar) / pvToNear.mag() / momentumFar.mag(); + double ptrel = sqrt(1.0 - cosa*cosa)* momentumFar.mag(); + + double vertexDeltaR = Geom::deltaR(pvToNear, pvToFar); + + // create a set of all tracks from both vertices, avoid double counting by using a std::set<> + std::set trackrefs; + // first vertex + for(size_t i=0; i < sv1.numberOfSourceCandidatePtrs(); ++i) + trackrefs.insert(sv1.daughterPtr(i)); + // second vertex + for(size_t i=0; i < sv2.numberOfSourceCandidatePtrs(); ++i) + trackrefs.insert(sv2.daughterPtr(i)); + + // now calculate one LorentzVector from the track momenta + Candidate::LorentzVector mother; + for(std::set::const_iterator it = trackrefs.begin(); it!= trackrefs.end(); ++it){ + Candidate::LorentzVector temp ( (*it)->px(),(*it)->py(),(*it)->pz(), ParticleMasses::piPlus ); + mother += temp; + } + + // check if criteria for merging are fulfilled + if(vertexDeltaRminCosPAtomerge && std::abs(ptrel) & tracks1 = sv1.daughterPtrVector(); + const std::vector & tracks2 = sv2.daughterPtrVector(); + for(std::vector::const_iterator ti = tracks2.begin(); ti!=tracks2.end(); ++ti){ + std::vector::const_iterator it = find(tracks1.begin(), tracks1.end(), *ti); + if (it==tracks1.end()) { + coll[i].vert.addDaughter( *ti ); + coll[i].vert.setP4( (*ti)->p4() + coll[i].vert.p4() ); + } + } + + // remove the second vertex from the collection + coll.erase( coll.begin() + k ); + } } +// define specific instances of the templated BtoCharmDecayVertexMergerT class +typedef BtoCharmDecayVertexMergerT BtoCharmDecayVertexMerger; +typedef BtoCharmDecayVertexMergerT CandidateBtoCharmDecayVertexMerger; +// define plugins DEFINE_FWK_MODULE(BtoCharmDecayVertexMerger); +DEFINE_FWK_MODULE(CandidateBtoCharmDecayVertexMerger); diff --git a/RecoBTag/SecondaryVertex/python/bToCharmDecayVertexMerger_cfi.py b/RecoBTag/SecondaryVertex/python/bToCharmDecayVertexMerger_cfi.py index e399fb6431ca7..81448f7a67c7c 100644 --- a/RecoBTag/SecondaryVertex/python/bToCharmDecayVertexMerger_cfi.py +++ b/RecoBTag/SecondaryVertex/python/bToCharmDecayVertexMerger_cfi.py @@ -3,8 +3,8 @@ bToCharmDecayVertexMerged = cms.EDProducer("BtoCharmDecayVertexMerger", primaryVertices = cms.InputTag("offlinePrimaryVertices"), secondaryVertices = cms.InputTag("inclusiveSecondaryVerticesFiltered"), - minDRUnique = cms.untracked.double(0.4), - minvecSumIMifsmallDRUnique = cms.untracked.double(5.5), - minCosPAtomerge = cms.untracked.double(0.99), - maxPtreltomerge = cms.untracked.double(7777.0) + maxDRUnique = cms.double(0.4), + maxvecSumIMifsmallDRUnique = cms.double(5.5), + minCosPAtomerge = cms.double(0.99), + maxPtreltomerge = cms.double(7777.0) ) diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoHcalDetIdCollectionProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoHcalDetIdCollectionProducer.cc index 81b5a766c5b49..a8cd23621b662 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoHcalDetIdCollectionProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoHcalDetIdCollectionProducer.cc @@ -7,7 +7,7 @@ #include "DataFormats/DetId/interface/DetIdCollection.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" EgammaIsoHcalDetIdCollectionProducer::EgammaIsoHcalDetIdCollectionProducer(const edm::ParameterSet& iConfig) @@ -45,7 +45,7 @@ EgammaIsoHcalDetIdCollectionProducer::EgammaIsoHcalDetIdCollectionProducer(const void EgammaIsoHcalDetIdCollectionProducer::beginRun (edm::Run const& run, const edm::EventSetup & iSetup) { - iSetup.get().get(towerMap_); + iSetup.get().get(towerMap_); // std::cout <<" got geom "< ctmaph; - es.get().get(ctmaph); + es.get().get(ctmaph); towerMap_ = &(*ctmaph); NMaxClusters_ = 4; } diff --git a/RecoJets/JetProducers/src/JetSpecific.cc b/RecoJets/JetProducers/src/JetSpecific.cc index 289e3145be746..d4a19521a5558 100644 --- a/RecoJets/JetProducers/src/JetSpecific.cc +++ b/RecoJets/JetProducers/src/JetSpecific.cc @@ -51,7 +51,7 @@ void reco::writeSpecific(reco::CaloJet & jet, geometry->getSubdetectorGeometry(DetId::Calo, CaloTowerDetId::SubdetId); edm::ESHandle topology; - c.get().get(topology); + c.get().get(topology); // Make the specific reco::CaloJet::Specific specific; diff --git a/RecoLocalCalo/CaloTowersCreator/src/CaloTowersCreator.cc b/RecoLocalCalo/CaloTowersCreator/src/CaloTowersCreator.cc index 16a51dbe8546d..8af833e791474 100644 --- a/RecoLocalCalo/CaloTowersCreator/src/CaloTowersCreator.cc +++ b/RecoLocalCalo/CaloTowersCreator/src/CaloTowersCreator.cc @@ -134,8 +134,8 @@ void CaloTowersCreator::produce(edm::Event& e, const edm::EventSetup& c) { edm::ESHandle htopo; edm::ESHandle cttopo; c.get().get(pG); - c.get().get(htopo); - c.get().get(cttopo); + c.get().get(htopo); + c.get().get(cttopo); // ECAL channel status map **************************************** edm::ESHandle ecalChStatus; diff --git a/RecoLocalCalo/CaloTowersCreator/src/CaloTowersReCreator.cc b/RecoLocalCalo/CaloTowersCreator/src/CaloTowersReCreator.cc index a2cc40bc36397..8aa92fe10912d 100644 --- a/RecoLocalCalo/CaloTowersCreator/src/CaloTowersReCreator.cc +++ b/RecoLocalCalo/CaloTowersCreator/src/CaloTowersReCreator.cc @@ -62,8 +62,8 @@ void CaloTowersReCreator::produce(edm::Event& e, const edm::EventSetup& c) { edm::ESHandle htopo; edm::ESHandle cttopo; c.get().get(pG); - c.get().get(htopo); - c.get().get(cttopo); + c.get().get(htopo); + c.get().get(cttopo); algo_.setEBEScale(EBEScale); algo_.setEEEScale(EEEScale); diff --git a/RecoLocalCalo/HcalRecAlgos/interface/rawEnergy.h b/RecoLocalCalo/HcalRecAlgos/interface/rawEnergy.h index 7b123efbe220c..c633a38aeccf2 100644 --- a/RecoLocalCalo/HcalRecAlgos/interface/rawEnergy.h +++ b/RecoLocalCalo/HcalRecAlgos/interface/rawEnergy.h @@ -92,6 +92,82 @@ namespace HcalRecAlgosPrivate { inline static float getRawEnergy(const T& h, float) {return h.eraw();} }; + template + class HasAuxEnergySetterHelper + { + private: + template struct tester; + typedef char One; + typedef struct {char a[2];} Two; + template static One test(tester<&C::setAuxEnergy>*); + template static Two test(...); + + public: + enum {value = sizeof(HasAuxEnergySetterHelper::template test(0)) == 1}; + }; + + template::value> + struct HasAuxEnergySetter + { + enum {value = false}; + }; + + template + struct HasAuxEnergySetter + { + enum {value = HasAuxEnergySetterHelper::value}; + }; + + template + struct AuxEnergySetter + { + inline static void setAuxEnergy(T&, float) {} + }; + + template + struct AuxEnergySetter + { + inline static void setAuxEnergy(T& h, float e) {h.setAuxEnergy(e);} + }; + + template + class HasAuxEnergyGetterHelper + { + private: + template struct tester; + typedef char One; + typedef struct {char a[2];} Two; + template static One test(tester<&C::eaux>*); + template static Two test(...); + + public: + enum {value = sizeof(HasAuxEnergyGetterHelper::template test(0)) == 1}; + }; + + template::value> + struct HasAuxEnergyGetter + { + enum {value = false}; + }; + + template + struct HasAuxEnergyGetter + { + enum {value = HasAuxEnergyGetterHelper::value}; + }; + + template + struct AuxEnergyGetter + { + inline static float getAuxEnergy(const T&, float v) {return v;} + }; + + template + struct AuxEnergyGetter + { + inline static float getAuxEnergy(const T& h, float) {return h.eaux();} + }; + template class HasAuxRecHitGetterHelper { @@ -151,6 +227,19 @@ inline float getRawEnergy(const HcalRecHit& h, float valueIfNoSuchMember=-1.0e20 return HcalRecAlgosPrivate::RawEnergyGetter::value>::getRawEnergy(h, valueIfNoSuchMember); } +// Similar functions for aux energy +template +inline void setAuxEnergy(HcalRecHit& h, float e) +{ + HcalRecAlgosPrivate::AuxEnergySetter::value>::setAuxEnergy(h, e); +} + +template +inline float getAuxEnergy(const HcalRecHit& h, float valueIfNoSuchMember=-1.0e20) +{ + return HcalRecAlgosPrivate::AuxEnergyGetter::value>::getAuxEnergy(h, valueIfNoSuchMember); +} + // Function for getting the auxiliary word in a code templated // upon the rechit type. This function will return "valueIfNoSuchMember" // in case the HcalRecHit type does not have a member function diff --git a/RecoLocalCalo/HcalRecAlgos/src/HcalHFStatusBitFromRecHits.cc b/RecoLocalCalo/HcalRecAlgos/src/HcalHFStatusBitFromRecHits.cc index 934fd4dae6cf7..55daecf19704e 100644 --- a/RecoLocalCalo/HcalRecAlgos/src/HcalHFStatusBitFromRecHits.cc +++ b/RecoLocalCalo/HcalRecAlgos/src/HcalHFStatusBitFromRecHits.cc @@ -1,6 +1,6 @@ #include "RecoLocalCalo/HcalRecAlgos/interface/HcalHFStatusBitFromRecHits.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryData.h" // for eta bounds +#include "Geometry/CaloTopology/interface/HcalTopology.h" #include // for "max" #include @@ -49,7 +49,10 @@ void HcalHFStatusBitFromRecHits::hfSetFlagFromRecHits(HFRecHitCollection& rec, ieta =iHF->id().ieta(); // int between 29-41 // eta = average value between cell eta bounds - coshEta=fabs(cosh(0.5*(theHFEtaBounds[abs(ieta)-29]+theHFEtaBounds[abs(ieta)-28]))); + std::pair etas = myqual->topo()->etaRange(HcalForward,abs(ieta)); + double eta1 = etas.first; + double eta2 = etas.second; + coshEta=fabs(cosh(0.5*(eta1+eta2))); status=0; // status bit for rechit diff --git a/RecoLocalCalo/HcalRecAlgos/src/HcalHF_PETalgorithm.cc b/RecoLocalCalo/HcalRecAlgos/src/HcalHF_PETalgorithm.cc index b7ae54958c7f2..565482545669d 100644 --- a/RecoLocalCalo/HcalRecAlgos/src/HcalHF_PETalgorithm.cc +++ b/RecoLocalCalo/HcalRecAlgos/src/HcalHF_PETalgorithm.cc @@ -1,10 +1,10 @@ #include "RecoLocalCalo/HcalRecAlgos/interface/HcalHF_PETalgorithm.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryData.h" // for eta bounds #include "DataFormats/METReco/interface/HcalCaloFlagLabels.h" #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h" +#include "Geometry/CaloTopology/interface/HcalTopology.h" #include // for "max" #include @@ -78,7 +78,10 @@ void HcalHF_PETalgorithm::HFSetFlagFromPET(HFRecHit& hf, int ieta=hf.id().ieta(); // get coordinates of rechit being checked int depth=hf.id().depth(); int iphi=hf.id().iphi(); - double fEta = 0.5*(theHFEtaBounds[abs(ieta)-29] + theHFEtaBounds[abs(ieta)-28]); // calculate eta as average of eta values at ieta boundaries + std::pair etas = myqual->topo()->etaRange(HcalForward,abs(ieta)); + double eta1 = etas.first; + double eta2 = etas.second; + double fEta = 0.5*(eta1 + eta2); // calculate eta as average of eta values at ieta boundaries double energy=hf.energy(); double ET = energy/fabs(cosh(fEta)); diff --git a/RecoLocalCalo/HcalRecAlgos/src/HcalHF_S9S1algorithm.cc b/RecoLocalCalo/HcalRecAlgos/src/HcalHF_S9S1algorithm.cc index 2a466056c3f08..7aacc486ffd3d 100644 --- a/RecoLocalCalo/HcalRecAlgos/src/HcalHF_S9S1algorithm.cc +++ b/RecoLocalCalo/HcalRecAlgos/src/HcalHF_S9S1algorithm.cc @@ -1,10 +1,10 @@ #include "RecoLocalCalo/HcalRecAlgos/interface/HcalHF_S9S1algorithm.h" #include "DataFormats/METReco/interface/HcalCaloFlagLabels.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryData.h" // for eta bounds #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h" #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" +#include "Geometry/CaloTopology/interface/HcalTopology.h" #include // for "max" #include @@ -92,7 +92,10 @@ void HcalHF_S9S1algorithm::HFSetFlagFromS9S1(HFRecHit& hf, int ieta=hf.id().ieta(); // get coordinates of rechit being checked int depth=hf.id().depth(); int iphi=hf.id().iphi(); - double fEta = 0.5*(theHFEtaBounds[abs(ieta)-29] + theHFEtaBounds[abs(ieta)-28]); // calculate eta as average of eta values at ieta boundaries + std::pair etas = myqual->topo()->etaRange(HcalForward,abs(ieta)); + double eta1 = etas.first; + double eta2 = etas.second; + double fEta = 0.5*(eta1 + eta2); // calculate eta as average of eta values at ieta boundaries double energy=hf.energy(); double ET = energy/fabs(cosh(fEta)); diff --git a/RecoLocalCalo/HcalRecAlgos/test/HcalRecHitReflagger.cc b/RecoLocalCalo/HcalRecAlgos/test/HcalRecHitReflagger.cc index d46cded22cddb..755b88509a873 100644 --- a/RecoLocalCalo/HcalRecAlgos/test/HcalRecHitReflagger.cc +++ b/RecoLocalCalo/HcalRecAlgos/test/HcalRecHitReflagger.cc @@ -30,7 +30,8 @@ #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" #include "DataFormats/METReco/interface/HcalCaloFlagLabels.h" -#include "Geometry/HcalTowerAlgo/src/HcalHardcodeGeometryData.h" // for eta bounds +#include "Geometry/CaloTopology/interface/HcalTopology.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "CondFormats/HcalObjects/interface/HcalChannelStatus.h" #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" @@ -73,6 +74,7 @@ class HcalRecHitReflagger : public edm::EDProducer { double GetSlope(const int ieta, const std::vector& params); // ----------member data --------------------------- + const HcalTopology* topo; edm::InputTag hfInputLabel_; edm::EDGetTokenT tok_hf_; int hfFlagBit_; @@ -194,6 +196,11 @@ HcalRecHitReflagger::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) return; } + //get the hcal topology + edm::ESHandle topo_; + iSetup.get().get(topo_); + topo = &*topo_; + // prepare the output HF RecHit collection std::auto_ptr pOut(new HFRecHitCollection()); @@ -281,7 +288,8 @@ bool HcalRecHitReflagger::CheckPET(const HFRecHit& hf) int ieta = id.ieta(); double energy=hf.energy(); int depth = id.depth(); - double fEta=fabs(0.5*(theHFEtaBounds[abs(ieta)-29]+theHFEtaBounds[abs(ieta)-28])); + std::pair etas = topo->etaRange(HcalForward,abs(ieta)); + double fEta = 0.5*(etas.first + etas.second); // calculate eta as average of eta values at ieta boundaries double ET = energy/cosh(fEta); double threshold=0; @@ -348,7 +356,8 @@ bool HcalRecHitReflagger::CheckS9S1(const HFRecHit& hf) int ieta = id.ieta(); double energy=hf.energy(); int depth = id.depth(); - double fEta=fabs(0.5*(theHFEtaBounds[abs(ieta)-29]+theHFEtaBounds[abs(ieta)-28])); + std::pair etas = topo->etaRange(HcalForward,ieta); + double fEta = 0.5*(etas.first + etas.second); // calculate eta as average of eta values at ieta boundaries double ET = energy/cosh(fEta); double threshold=0; diff --git a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc index 97e02d91a104a..5653a7f70ff3e 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc @@ -9,7 +9,7 @@ Original Author: John Paul Chou (Brown University) #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "DataFormats/JetReco/interface/TrackExtrapolation.h" #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h" @@ -95,7 +95,7 @@ HBHEIsolatedNoiseReflagger::produce(edm::Event& iEvent, const edm::EventSetup& e // get the calotower mappings edm::ESHandle ctcm; - evSetup.get().get(ctcm); + evSetup.get().get(ctcm); // get the HB/HE hits edm::Handle hbhehits_h; diff --git a/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc b/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc index f2da09cf6b41b..6183b8425f888 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc @@ -10,7 +10,7 @@ #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" #include "Geometry/CaloTopology/interface/HcalTopology.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "CondFormats/DataRecord/interface/HcalOOTPileupCorrectionRcd.h" #include "CondFormats/DataRecord/interface/HcalOOTPileupCompatibilityRcd.h" #include "CondFormats/DataRecord/interface/HBHENegativeEFilterRcd.h" @@ -313,7 +313,7 @@ HcalHitReconstructor::~HcalHitReconstructor() { void HcalHitReconstructor::beginRun(edm::Run const&r, edm::EventSetup const & es){ edm::ESHandle htopo; - es.get().get(htopo); + es.get().get(htopo); if ( tsFromDB_== true || recoParamsFromDB_ == true ) { @@ -337,7 +337,7 @@ void HcalHitReconstructor::beginRun(edm::Run const&r, edm::EventSetup const & es HFDigiTimeParams.reset( new HcalFlagHFDigiTimeParams( *p ) ); edm::ESHandle htopo; - es.get().get(htopo); + es.get().get(htopo); HFDigiTimeParams->setTopo(htopo.product()); } @@ -362,7 +362,7 @@ void HcalHitReconstructor::produce(edm::Event& e, const edm::EventSetup& eventSe // get conditions edm::ESHandle topo; - eventSetup.get().get(topo); + eventSetup.get().get(topo); edm::ESHandle conditions; eventSetup.get().get(conditions); diff --git a/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc b/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc index 6c87e26af6b4b..a3156b7b9ab36 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc @@ -78,7 +78,7 @@ void HcalSimpleReconstructor::beginRun(edm::Run const&r, edm::EventSetup const & paramTS = new HcalRecoParams(*p.product()); edm::ESHandle htopo; - es.get().get(htopo); + es.get().get(htopo); theTopology=new HcalTopology(*htopo); paramTS->setTopo(theTopology); diff --git a/RecoLocalCalo/HcalRecProducers/src/ZdcHitReconstructor.cc b/RecoLocalCalo/HcalRecProducers/src/ZdcHitReconstructor.cc index ac8281011d114..799f44ae1f321 100644 --- a/RecoLocalCalo/HcalRecProducers/src/ZdcHitReconstructor.cc +++ b/RecoLocalCalo/HcalRecProducers/src/ZdcHitReconstructor.cc @@ -67,7 +67,7 @@ void ZdcHitReconstructor::beginRun(edm::Run const&r, edm::EventSetup const & es) myobject = new HcalLongRecoParams(*p.product()); edm::ESHandle htopo; - es.get().get(htopo); + es.get().get(htopo); theTopology=new HcalTopology(*htopo); myobject->setTopo(theTopology); diff --git a/RecoMET/METPUSubtraction/python/mvaPFMET_cff.py b/RecoMET/METPUSubtraction/python/mvaPFMET_cff.py index 3ddbadd0741ed..80aa9b382de80 100644 --- a/RecoMET/METPUSubtraction/python/mvaPFMET_cff.py +++ b/RecoMET/METPUSubtraction/python/mvaPFMET_cff.py @@ -38,6 +38,7 @@ "frac04", "frac05" ), + etaBinnedWeights = cms.bool(False), tmvaWeights = cms.string("RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_MET_53X_Dec2012.weights.xml.gz"), tmvaMethod = cms.string("JetID"), tmvaSpectators = cms.vstring(), diff --git a/RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h b/RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h index aeff97a37e849..9146d745555bc 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h +++ b/RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h @@ -3,6 +3,7 @@ #include #include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTestBase.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" @@ -110,7 +111,7 @@ class PFRecHitQTestHCALChannel : public PFRecHitQTestBase { void beginEvent(const edm::Event& event,const edm::EventSetup& iSetup) { edm::ESHandle topo; - iSetup.get().get(topo); + iSetup.get().get(topo); edm::ESHandle hcalChStatus; iSetup.get().get( "withTopo", hcalChStatus ); theHcalChStatus_ = hcalChStatus.product(); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFCTRecHitProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFCTRecHitProducer.cc index bce661493e13a..4ba5714ffbe4a 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFCTRecHitProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFCTRecHitProducer.cc @@ -9,7 +9,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "DataFormats/ParticleFlowReco/interface/PFRecHit.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" @@ -838,7 +838,7 @@ PFCTRecHitProducer::beginLuminosityBlock(const edm::LuminosityBlock& lumi, theEcalChStatus = ecalChStatus.product(); edm::ESHandle cttopo; - es.get().get(cttopo); + es.get().get(cttopo); theTowerConstituentsMap = cttopo.product(); } diff --git a/RecoParticleFlow/PFClusterProducer/src/ECAL2DPositionCalcWithDepthCorr.cc b/RecoParticleFlow/PFClusterProducer/src/ECAL2DPositionCalcWithDepthCorr.cc index 180746ebc3e4f..979913f488515 100644 --- a/RecoParticleFlow/PFClusterProducer/src/ECAL2DPositionCalcWithDepthCorr.cc +++ b/RecoParticleFlow/PFClusterProducer/src/ECAL2DPositionCalcWithDepthCorr.cc @@ -17,12 +17,10 @@ void ECAL2DPositionCalcWithDepthCorr:: update(const edm::EventSetup& es) { - const CaloGeometryRecord& temp = es.get(); - if( _caloGeom == NULL || - ( _caloGeom->cacheIdentifier() != temp.cacheIdentifier() ) ) { - _caloGeom = &temp; + + const CaloGeometryRecord& caloGeom = es.get(); edm::ESHandle geohandle; - _caloGeom->get(geohandle); + caloGeom.get(geohandle); _ebGeom = geohandle->getSubdetectorGeometry(DetId::Ecal,EcalBarrel); _eeGeom = geohandle->getSubdetectorGeometry(DetId::Ecal,EcalEndcap); _esGeom = geohandle->getSubdetectorGeometry(DetId::Ecal,EcalPreshower); @@ -34,7 +32,7 @@ update(const edm::EventSetup& es) { _esPlus = _esPlus || ( 0 < z ) ; _esMinus = _esMinus || ( 0 > z ) ; } - } + } void ECAL2DPositionCalcWithDepthCorr:: diff --git a/RecoParticleFlow/PFClusterProducer/src/ECAL2DPositionCalcWithDepthCorr.h b/RecoParticleFlow/PFClusterProducer/src/ECAL2DPositionCalcWithDepthCorr.h index c34ef0f634892..75de317bdb1b3 100644 --- a/RecoParticleFlow/PFClusterProducer/src/ECAL2DPositionCalcWithDepthCorr.h +++ b/RecoParticleFlow/PFClusterProducer/src/ECAL2DPositionCalcWithDepthCorr.h @@ -24,7 +24,6 @@ class ECAL2DPositionCalcWithDepthCorr : public PFCPositionCalculatorBase { _param_W0(conf.getParameter("W0")), _param_X0(conf.getParameter("X0")), _minAllowedNorm(conf.getParameter("minAllowedNormalization")), - _caloGeom(NULL), _ebGeom(NULL), _eeGeom(NULL), _esGeom(NULL), @@ -54,7 +53,7 @@ class ECAL2DPositionCalcWithDepthCorr : public PFCPositionCalculatorBase { const double _minAllowedNorm; - const CaloGeometryRecord* _caloGeom; + //const CaloGeometryRecord _caloGeom; const CaloSubdetectorGeometry* _ebGeom; const CaloSubdetectorGeometry* _eeGeom; const CaloSubdetectorGeometry* _esGeom; diff --git a/RecoParticleFlow/PFClusterProducer/src/Navigators.cc b/RecoParticleFlow/PFClusterProducer/src/Navigators.cc index fb3f7de0398d2..c8b40ccdf79a5 100644 --- a/RecoParticleFlow/PFClusterProducer/src/Navigators.cc +++ b/RecoParticleFlow/PFClusterProducer/src/Navigators.cc @@ -87,7 +87,7 @@ class PFRecHitHCALNavigator : public PFRecHitCaloNavigator hcalTopology; - iSetup.get().get( hcalTopology ); + iSetup.get().get( hcalTopology ); topology_.release(); topology_.reset(hcalTopology.product()); } @@ -103,7 +103,7 @@ class PFRecHitHCALNavigatorWithTime : public PFRecHitCaloNavigatorWithTime hcalTopology; - iSetup.get().get( hcalTopology ); + iSetup.get().get( hcalTopology ); topology_.release(); topology_.reset(hcalTopology.product()); } diff --git a/SimCalorimetry/CaloSimAlgos/src/CaloHitResponse.cc b/SimCalorimetry/CaloSimAlgos/src/CaloHitResponse.cc index 8a40e4c5baa3a..51006fc0abb34 100644 --- a/SimCalorimetry/CaloSimAlgos/src/CaloHitResponse.cc +++ b/SimCalorimetry/CaloSimAlgos/src/CaloHitResponse.cc @@ -108,7 +108,6 @@ void CaloHitResponse::add( const PCaloHit& hit, CLHEP::HepRandomEngine* engine ) if(theHitFilter == 0 || theHitFilter->accepts(hit)) { LogDebug("CaloHitResponse") << hit; CaloSamples signal( makeAnalogSignal( hit, engine ) ) ; - bool keep ( keepBlank() ) ; // here we check for blank signal if not keeping them if( !keep ) { @@ -151,7 +150,6 @@ CaloSamples CaloHitResponse::makeAnalogSignal(const PCaloHit & hit, CLHEP::HepRa DetId detId(hit.id()); const CaloSimParameters & parameters = theParameterMap->simParameters(detId); - double signal = analogSignalAmplitude(detId, hit.energy(), parameters, engine); double time = hit.time(); diff --git a/SimCalorimetry/HcalSimAlgos/src/HcalShapes.cc b/SimCalorimetry/HcalSimAlgos/src/HcalShapes.cc index 0773ea3fd7aaa..15fa7fb9c8d7c 100644 --- a/SimCalorimetry/HcalSimAlgos/src/HcalShapes.cc +++ b/SimCalorimetry/HcalSimAlgos/src/HcalShapes.cc @@ -109,7 +109,7 @@ void HcalShapes::beginRun(edm::EventSetup const & es) // here we are making a _copy_ so we need to add a copy of the topology... edm::ESHandle htopo; - es.get().get(htopo); + es.get().get(htopo); theTopology=new HcalTopology(*htopo); theMCParams->setTopo(theTopology); } diff --git a/SimCalorimetry/HcalSimProducers/interface/HcalDigitizer.h b/SimCalorimetry/HcalSimProducers/interface/HcalDigitizer.h index add3e3ee1c78b..7ffbe8a6d2d90 100644 --- a/SimCalorimetry/HcalSimProducers/interface/HcalDigitizer.h +++ b/SimCalorimetry/HcalSimProducers/interface/HcalDigitizer.h @@ -10,6 +10,7 @@ #include "SimCalorimetry/HcalSimAlgos/interface/HcalHitFilter.h" #include "SimCalorimetry/HcalSimAlgos/interface/ZDCHitFilter.h" #include "SimCalorimetry/HcalSimProducers/interface/HcalHitRelabeller.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "DataFormats/DetId/interface/DetId.h" #include "FWCore/Framework/interface/Frameworkfwd.h" @@ -68,6 +69,7 @@ class HcalDigitizer /// exist in the geometry void checkGeometry(const edm::EventSetup& eventSetup); const CaloGeometry * theGeometry; + const HcalDDDRecConstants * theRecNumber; void updateGeometry(const edm::EventSetup& eventSetup); void buildHOSiPMCells(const std::vector& allCells, const edm::EventSetup& eventSetup); diff --git a/SimCalorimetry/HcalSimProducers/interface/HcalHitRelabeller.h b/SimCalorimetry/HcalSimProducers/interface/HcalHitRelabeller.h index 813ebd968ff6e..9e6713f710f1e 100644 --- a/SimCalorimetry/HcalSimProducers/interface/HcalHitRelabeller.h +++ b/SimCalorimetry/HcalSimProducers/interface/HcalHitRelabeller.h @@ -5,20 +5,19 @@ #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "SimDataFormats/CaloHit/interface/PCaloHit.h" #include "DataFormats/DetId/interface/DetId.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" class HcalHitRelabeller { public: HcalHitRelabeller(const edm::ParameterSet& ps); void process(std::vector & hcalHits); - void setGeometry(const CaloGeometry *& theGeometry); + void setGeometry(const CaloGeometry *&, const HcalDDDRecConstants *&); + DetId relabel(const uint32_t testId) const; private: - DetId relabel(const uint32_t testId) const; const CaloGeometry* theGeometry; - - std::vector > m_segmentation; - bool m_CorrectPhi; + const HcalDDDRecConstants* theRecNumber; }; #endif diff --git a/SimCalorimetry/HcalSimProducers/src/HcalDigitizer.cc b/SimCalorimetry/HcalSimProducers/src/HcalDigitizer.cc index b33acf78a1723..331026d8bdb1e 100644 --- a/SimCalorimetry/HcalSimProducers/src/HcalDigitizer.cc +++ b/SimCalorimetry/HcalSimProducers/src/HcalDigitizer.cc @@ -83,6 +83,7 @@ namespace HcalDigitizerImpl { HcalDigitizer::HcalDigitizer(const edm::ParameterSet& ps, edm::ConsumesCollector& iC) : theGeometry(0), + theRecNumber(0), theParameterMap(new HcalSimParameterMap(ps)), theShapes(new HcalShapes()), theHBHEResponse(0), @@ -179,7 +180,7 @@ HcalDigitizer::HcalDigitizer(const edm::ParameterSet& ps, edm::ConsumesCollector theCoderFactory = new HcalCoderFactory(HcalCoderFactory::DB); theUpgradeCoderFactory = new HcalCoderFactory(HcalCoderFactory::UPGRADE); - // std::cout << "HcalDigitizer: theUpgradeCoderFactory created" << std::endl; +// std::cout << "HcalDigitizer: theUpgradeCoderFactory created" << std::endl; theHBHEElectronicsSim = new HcalElectronicsSim(theHBHEAmplifier, theCoderFactory, PreMix1); theHFElectronicsSim = new HcalElectronicsSim(theHFAmplifier, theCoderFactory, PreMix1); @@ -188,14 +189,14 @@ HcalDigitizer::HcalDigitizer(const edm::ParameterSet& ps, edm::ConsumesCollector theUpgradeHBHEElectronicsSim = new HcalElectronicsSim(theHBHEAmplifier, theUpgradeCoderFactory, PreMix1); theUpgradeHFElectronicsSim = new HcalElectronicsSim(theHFAmplifier, theUpgradeCoderFactory, PreMix1); - // std::cout << "HcalDigitizer: theUpgradeElectronicsSim created" << std::endl; +// std::cout << "HcalDigitizer: theUpgradeElectronicsSim created" << std::endl; // a code of 1 means make all cells SiPM std::vector hbSiPMCells(ps.getParameter("hb").getParameter >("siPMCells")); //std::vector hoSiPMCells(ps.getParameter("ho").getParameter >("siPMCells")); // 0 means none, 1 means all, and 2 means use hardcoded - // std::cout << std::endl << " hbSiPMCells = " << hbSiPMCells[0] << std::endl; +// std::cout << std::endl << " hbSiPMCells = " << hbSiPMCells.size() << std::endl; bool doHBHEHPD = hbSiPMCells.empty() || (hbSiPMCells[0] != 1); bool doHOHPD = (theHOSiPMCode != 1); @@ -228,7 +229,7 @@ HcalDigitizer::HcalDigitizer(const edm::ParameterSet& ps, edm::ConsumesCollector if (doHBHEUpgrade) { theHBHEUpgradeDigitizer = new UpgradeDigitizer(theHBHESiPMResponse, theUpgradeHBHEElectronicsSim, doEmpty); - // std::cout << "HcalDigitizer: theHBHEUpgradeDigitizer created" << std::endl; +// std::cout << "HcalDigitizer: theHBHEUpgradeDigitizer created" << std::endl; } else { theHBHESiPMDigitizer = new HBHEDigitizer(theHBHESiPMResponse, theHBHEElectronicsSim, doEmpty); @@ -243,7 +244,7 @@ HcalDigitizer::HcalDigitizer(const edm::ParameterSet& ps, edm::ConsumesCollector // if both are present, fill the SiPM cells now if(doHBHEHPD && doHBHESiPM) { - // std::cout << "HcalDigitizer: fill the SiPM cells now" << std::endl; +// std::cout << "HcalDigitizer: fill the SiPM cells now" << std::endl; HcalDigitizerImpl::fillSiPMCells(hbSiPMCells, theHBHESiPMDigitizer); } @@ -265,7 +266,7 @@ HcalDigitizer::HcalDigitizer(const edm::ParameterSet& ps, edm::ConsumesCollector if (doHFUpgrade) { theHFUpgradeDigitizer = new UpgradeDigitizer(theHFResponse, theUpgradeHFElectronicsSim, doEmpty); - // std::cout << "HcalDigitizer: theHFUpgradeDigitizer created" << std::endl; +// std::cout << "HcalDigitizer: theHFUpgradeDigitizer created" << std::endl; } else { theHFDigitizer = new HFDigitizer(theHFResponse, theHFElectronicsSim, doEmpty); @@ -303,15 +304,13 @@ HcalDigitizer::HcalDigitizer(const edm::ParameterSet& ps, edm::ConsumesCollector if(theHBHEUpgradeDigitizer) { theHBHEUpgradeDigitizer->setNoiseHitGenerator(theNoiseHitGenerator); - // std::cout << "HcalDigitizer: theHBHEUpgradeDigitizer setNoise" - // << std::endl; +// std::cout << "HcalDigitizer: theHBHEUpgradeDigitizer setNoise" << std::endl; } if(theHFDigitizer) theHFDigitizer->setNoiseHitGenerator(theNoiseHitGenerator); if(theHFUpgradeDigitizer) { theHFUpgradeDigitizer->setNoiseHitGenerator(theNoiseHitGenerator); - // std::cout << "HcalDigitizer: theHFUpgradeDigitizer setNoise" - // << std::endl; +// std::cout << "HcalDigitizer: theHFUpgradeDigitizer setNoise" << std::endl; } theZDCDigitizer->setNoiseHitGenerator(theNoiseHitGenerator); } @@ -433,6 +432,7 @@ void HcalDigitizer::initializeEvent(edm::Event const& e, edm::EventSetup const& } void HcalDigitizer::accumulateCaloHits(edm::Handle > const& hcalHandle, edm::Handle > const& zdcHandle, int bunchCrossing, CLHEP::HepRandomEngine* engine) { + // Step A: pass in inputs, and accumulate digirs if(isHCAL) { std::vector hcalHits = *hcalHandle.product(); @@ -452,7 +452,6 @@ void HcalDigitizer::accumulateCaloHits(edm::Handle > const if(theHBHEDigitizer) theHBHEDigitizer->add(hcalHits, bunchCrossing, engine); if(theHBHESiPMDigitizer) theHBHESiPMDigitizer->add(hcalHits, bunchCrossing, engine); if(theHBHEUpgradeDigitizer) { - // std::cout << "HcalDigitizer::accumulateCaloHits theHBHEUpgradeDigitizer->add" << std::endl; theHBHEUpgradeDigitizer->add(hcalHits, bunchCrossing, engine); } } @@ -526,7 +525,7 @@ void HcalDigitizer::finalizeEvent(edm::Event& e, const edm::EventSetup& eventSet if(theHBHEUpgradeDigitizer) { theHBHEUpgradeDigitizer->run(*hbheupgradeResult, engine); - // std::cout << "HcalDigitizer::finalizeEvent theHBHEUpgradeDigitizer->run" << std::endl; +// std::cout << "HcalDigitizer::finalizeEvent theHBHEUpgradeDigitizer->run" << std::endl; } } if(isHCAL&&hogeo) { @@ -568,8 +567,7 @@ void HcalDigitizer::finalizeEvent(edm::Event& e, const edm::EventSetup& eventSet e.put(hbheupgradeResult,"HBHEUpgradeDigiCollection"); e.put(hfupgradeResult, "HFUpgradeDigiCollection"); - // std::cout << std::endl << "========> HcalDigitizer e.put " - // << std::endl << std::endl; +// std::cout << std::endl << "========> HcalDigitizer e.put " << std::endl << std::endl; if(theHitCorrection) { theHitCorrection->clear(); @@ -592,10 +590,13 @@ void HcalDigitizer::checkGeometry(const edm::EventSetup & eventSetup) { // TODO find a way to avoid doing this every event edm::ESHandle geometry; eventSetup.get().get(geometry); + edm::ESHandle pHRNDC; + eventSetup.get().get(pHRNDC); + // See if it's been updated - if(&*geometry != theGeometry) - { + if (&*geometry != theGeometry) { theGeometry = &*geometry; + theRecNumber= &*pHRNDC; updateGeometry(eventSetup); } } @@ -608,7 +609,7 @@ void HcalDigitizer::updateGeometry(const edm::EventSetup & eventSetup) { if(theHOSiPMResponse) theHOSiPMResponse->setGeometry(theGeometry); theHFResponse->setGeometry(theGeometry); theZDCResponse->setGeometry(theGeometry); - if(theRelabeller) theRelabeller->setGeometry(theGeometry); + if(theRelabeller) theRelabeller->setGeometry(theGeometry,theRecNumber); const std::vector& hbCells = theGeometry->getValidDetIds(DetId::Hcal, HcalBarrel); const std::vector& heCells = theGeometry->getValidDetIds(DetId::Hcal, HcalEndcap); @@ -617,7 +618,7 @@ void HcalDigitizer::updateGeometry(const edm::EventSetup & eventSetup) { const std::vector& zdcCells = theGeometry->getValidDetIds(DetId::Calo, HcalZDCDetId::SubdetectorId); //const std::vector& hcalTrigCells = geometry->getValidDetIds(DetId::Hcal, HcalTriggerTower); //const std::vector& hcalCalib = geometry->getValidDetIds(DetId::Calo, HcalCastorDetId::SubdetectorId); - //std::cout<<"HcalDigitizer::CheckGeometry number of cells: "<setDetIds(theHBHEDetIds); - // std::cout << " HcalDigitizer::updateGeometry theHBHEUpgradeDigitizer->setDetIds(theHBHEDetIds)"<< std::endl; +// std::cout << " HcalDigitizer::updateGeometry theHBHEUpgradeDigitizer->setDetIds(theHBHEDetIds)"<< std::endl; } } @@ -655,7 +656,7 @@ void HcalDigitizer::buildHOSiPMCells(const std::vector& allCells, const e edm::ESHandle p; eventSetup.get().get(p); edm::ESHandle htopo; - eventSetup.get().get(htopo); + eventSetup.get().get(htopo); HcalMCParams mcParams(*p.product()); if (mcParams.topo()==0) { diff --git a/SimCalorimetry/HcalSimProducers/src/HcalHitRelabeller.cc b/SimCalorimetry/HcalSimProducers/src/HcalHitRelabeller.cc index 056305caf4db3..deda94344ecb2 100644 --- a/SimCalorimetry/HcalSimProducers/src/HcalHitRelabeller.cc +++ b/SimCalorimetry/HcalSimProducers/src/HcalHitRelabeller.cc @@ -4,123 +4,77 @@ #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" -//#define DEBUG +//#define DebugLog -HcalHitRelabeller::HcalHitRelabeller(const edm::ParameterSet& ps) { - // try to make sure the memory gets pinned in place - m_segmentation.resize(29); - m_CorrectPhi = ps.getUntrackedParameter("CorrectPhi",false); - for (int i=0; i<29; i++) { - char name[10]; - snprintf(name,10,"Eta%d",i+1); - if (i>0) { - m_segmentation[i]=ps.getUntrackedParameter >(name,m_segmentation[i-1]); - } else { - m_segmentation[i]=ps.getUntrackedParameter >(name); - } - } -#ifdef DEBUG - for (int i=0; i<29; i++) { - std::cout << "Segmentation[" << i << "] with " << m_segmentation[i].size() << " elements:"; - for (unsigned int k=0; k& hcalHits) { - for (unsigned int ii=0; iigetSubdetectorGeometry(newcell)->getGeometry(newcell); - GlobalPoint globalposition = (GlobalPoint)(cellGeometry->getPosition()); - - std::cout << "PCaloHit " << newcell << " position: " << globalposition << std::endl; - std::cout.flush(); + DetId newid = relabel(hcalHits[ii].id()); +#ifdef DebugLog + std::cout << "Hit " << ii << " out of " << hcalHits.size() << " " << std::hex << newid.rawId() << std::dec << '\n'; #endif - hcalHits[ii].setID(newid.rawId()); -#ifdef DEBUG - std::cout << "Modified Hit " << hcalHits[ii] << std::endl; + hcalHits[ii].setID(newid.rawId()); +#ifdef DebugLog + std::cout << "Modified Hit " << hcalHits[ii] << std::endl; #endif + } + } else { + edm::LogWarning("HcalSim") << "HcalHitRelabeller: no valid HcalDDDRecConstants"; } - //End Change by Wetzel } -void HcalHitRelabeller::setGeometry(const CaloGeometry*& geom) { - theGeometry = geom; +void HcalHitRelabeller::setGeometry(const CaloGeometry*& geom, + const HcalDDDRecConstants *& recNum) { + theGeometry = geom; + theRecNumber = recNum; } DetId HcalHitRelabeller::relabel(const uint32_t testId) const { -#ifdef DEBUG +#ifdef DebugLog std::cout << "Enter HcalHitRelabeller::relabel " << std::endl; #endif HcalDetId hid; - int det, z, depth, eta, phi, layer, sign; + int det, z, depth, eta, phi, layer, sign; HcalTestNumbering::unpackHcalIndex(testId,det,z,depth,eta,phi,layer); - - layer-=1; // one is added in the simulation, here used for indexing - - sign=(z==0)?(-1):(1); -#ifdef DEBUG +#ifdef DebugLog std::cout << "det: " << det << " " << "z: " << z << " " << "depth: " << depth << " " << "ieta: " << eta << " " << "iphi: " << phi << " " - << "layer: " << layer << " "; - std::cout.flush(); + << "layer: " << layer << std::endl; #endif - int newDepth = 0; // moved out of if's just for printing purposes... - int phi_skip = phi; - if (m_CorrectPhi) { - if (eta >= 40) phi_skip = (phi-1)*4 - 1; - else if (eta > 20) phi_skip = (phi-1)*2 + 1; - if (phi_skip < 0) phi_skip += 72; - } + HcalDDDRecConstants::HcalID id = theRecNumber->getHCID(det,eta,phi,layer,depth); + sign=(z==0)?(-1):(1); - if (det==int(HcalBarrel)) { - newDepth=m_segmentation[eta-1][layer]; - if(eta==16 && newDepth > 2) newDepth=2;// tower 16 HACK to be watched out.. - hid=HcalDetId(HcalBarrel,eta*sign,phi_skip,newDepth); - } - if (det==int(HcalEndcap)) { - newDepth=m_segmentation[eta-1][layer]; - if (eta==16 && newDepth<3) newDepth=3; // tower 16 HACK to be watched out.. - hid=HcalDetId(HcalEndcap,eta*sign,phi_skip,newDepth); - } - if (det==int(HcalOuter)) { - hid=HcalDetId(HcalOuter,eta*sign,phi_skip,4); - newDepth = 4; - } - if (det==int(HcalForward)) { - hid=HcalDetId(HcalForward,eta*sign,phi_skip,depth); - newDepth = depth; + if (id.subdet==int(HcalBarrel)) { + hid=HcalDetId(HcalBarrel,sign*id.eta,id.phi,id.depth); + } else if (id.subdet==int(HcalEndcap)) { + hid=HcalDetId(HcalEndcap,sign*id.eta,id.phi,id.depth); + } else if (id.subdet==int(HcalOuter)) { + hid=HcalDetId(HcalOuter,sign*id.eta,id.phi,id.depth); + } else if (id.subdet==int(HcalForward)) { + hid=HcalDetId(HcalForward,sign*id.eta,id.phi,id.depth); } -#ifdef DEBUG +#ifdef DebugLog std::cout << " new HcalDetId -> hex.RawID = " << std::hex << hid.rawId() << std::dec; std::cout.flush(); - std::cout << " det, z, depth, eta, phi = " - << det << " " - << z << " " - << newDepth << " " - << eta << " " - << phi << " " << phi_skip << " " - << " ---> " << hid << std::endl; + std::cout << " det, z, depth, eta, phi = " << det << " " + << z << " "<< id.depth << " " << id.eta << " " + << id.phi << " ---> " << hid << std::endl; #endif return hid; } diff --git a/SimG4CMS/Calo/interface/HCalSD.h b/SimG4CMS/Calo/interface/HCalSD.h index 44bfabadd1b27..5704e6a5f8eb9 100644 --- a/SimG4CMS/Calo/interface/HCalSD.h +++ b/SimG4CMS/Calo/interface/HCalSD.h @@ -17,7 +17,9 @@ #include "DataFormats/HcalCalibObjects/interface/HEDarkening.h" #include "SimG4CMS/Calo/interface/HFDarkening.h" #include "DetectorDescription/Core/interface/DDsvalues.h" +#include "SimG4Core/Notification/interface/BeginOfJob.h" #include "Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "G4String.hh" #include @@ -30,7 +32,7 @@ class G4LogicalVolume; class G4Material; class G4Step; -class HCalSD : public CaloSD { +class HCalSD : public CaloSD, public Observer { public: @@ -44,6 +46,7 @@ class HCalSD : public CaloSD { protected: + virtual void update(const BeginOfJob *); virtual void initRun(); virtual bool filterHit(CaloG4Hit*, double); @@ -73,7 +76,9 @@ class HCalSD : public CaloSD { void plotProfile(G4Step* step, const G4ThreeVector& pos, double edep, double time, int id); void plotHF(G4ThreeVector& pos, bool emType); + void modifyDepth(HcalNumberingFromDDD::HcalID& id); + HcalDDDSimConstants* hcalConstants; HcalNumberingFromDDD* numberingFromDDD; HcalNumberingScheme* numberingScheme; HFShowerLibrary * showerLibrary; @@ -88,7 +93,7 @@ class HCalSD : public CaloSD { bool useHF, useShowerLibrary, useParam, applyFidCut; double eminHitHB, eminHitHE, eminHitHO, eminHitHF; double deliveredLumi; - G4int mumPDG, mupPDG; + G4int mumPDG, mupPDG, maxDepthHF; std::vector layer0wt, gpar; std::vector hfLevels; std::vector hfNames, fibreNames, matNames; diff --git a/SimG4CMS/Calo/interface/HFFibre.h b/SimG4CMS/Calo/interface/HFFibre.h index 6cd22c9706a48..57cce264a425e 100644 --- a/SimG4CMS/Calo/interface/HFFibre.h +++ b/SimG4CMS/Calo/interface/HFFibre.h @@ -8,6 +8,7 @@ #include "DetectorDescription/Core/interface/DDsvalues.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "G4ThreeVector.hh" @@ -25,6 +26,7 @@ class HFFibre { edm::ParameterSet const & p); ~HFFibre(); + void initRun(HcalDDDSimConstants*); double attLength(double lambda); double tShift(const G4ThreeVector& point, int depth, int fromEndAbs=0); diff --git a/SimG4CMS/Calo/interface/HFShower.h b/SimG4CMS/Calo/interface/HFShower.h index b53a00bb9e162..d93d63bb5d4d0 100644 --- a/SimG4CMS/Calo/interface/HFShower.h +++ b/SimG4CMS/Calo/interface/HFShower.h @@ -7,6 +7,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "SimG4CMS/Calo/interface/HFCherenkov.h" #include "SimG4CMS/Calo/interface/HFFibre.h" @@ -23,7 +24,7 @@ class HFShower { public: HFShower(std::string & name, const DDCompactView & cpv, - edm::ParameterSet const & p, int chk=0); + edm::ParameterSet const & p, int chk=0); virtual ~HFShower(); public: @@ -37,7 +38,7 @@ class HFShower { G4ThreeVector position; }; - void initRun(G4ParticleTable *); + void initRun(G4ParticleTable *, HcalDDDSimConstants*); std::vector getHits(G4Step * aStep, double weight); std::vector getHits(G4Step * aStep, bool forLibrary); std::vector getHits(G4Step * aStep, bool forLibraryProducer, double zoffset); diff --git a/SimG4CMS/Calo/interface/HFShowerFibreBundle.h b/SimG4CMS/Calo/interface/HFShowerFibreBundle.h index c3b3f54b69f2b..0ab65bb6edfaf 100644 --- a/SimG4CMS/Calo/interface/HFShowerFibreBundle.h +++ b/SimG4CMS/Calo/interface/HFShowerFibreBundle.h @@ -7,6 +7,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "DetectorDescription/Core/interface/DDsvalues.h" #include "SimG4CMS/Calo/interface/HFCherenkov.h" @@ -25,6 +26,7 @@ class HFShowerFibreBundle { virtual ~HFShowerFibreBundle(); double getHits(G4Step * aStep, bool type); double getRadius(); + void initRun(G4ParticleTable *, HcalDDDSimConstants*); private: diff --git a/SimG4CMS/Calo/interface/HFShowerLibrary.h b/SimG4CMS/Calo/interface/HFShowerLibrary.h index 2cd4418fc0e0f..db985ff681c83 100644 --- a/SimG4CMS/Calo/interface/HFShowerLibrary.h +++ b/SimG4CMS/Calo/interface/HFShowerLibrary.h @@ -7,6 +7,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "SimG4CMS/Calo/interface/HFFibre.h" #include "SimDataFormats/CaloHit/interface/HFShowerPhoton.h" #include "DetectorDescription/Core/interface/DDsvalues.h" @@ -43,7 +44,7 @@ class HFShowerLibrary { double time; }; - void initRun(G4ParticleTable * theParticleTable); + void initRun(G4ParticleTable *, HcalDDDSimConstants*); std::vector getHits(G4Step * aStep, bool &ok, double weight, bool onlyLong=false); std::vector fillHits(G4ThreeVector & p, G4ThreeVector & v, diff --git a/SimG4CMS/Calo/interface/HFShowerPMT.h b/SimG4CMS/Calo/interface/HFShowerPMT.h index 7f4ae168e92ee..cbc21b4ef96f0 100644 --- a/SimG4CMS/Calo/interface/HFShowerPMT.h +++ b/SimG4CMS/Calo/interface/HFShowerPMT.h @@ -7,6 +7,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "DetectorDescription/Core/interface/DDsvalues.h" #include "SimG4CMS/Calo/interface/HFCherenkov.h" @@ -25,6 +26,7 @@ class HFShowerPMT { virtual ~HFShowerPMT(); double getHits(G4Step * aStep); double getRadius(); + void initRun(G4ParticleTable *, HcalDDDSimConstants*); private: diff --git a/SimG4CMS/Calo/interface/HFShowerParam.h b/SimG4CMS/Calo/interface/HFShowerParam.h index 09c7e389e0c98..45d58d7e5e526 100644 --- a/SimG4CMS/Calo/interface/HFShowerParam.h +++ b/SimG4CMS/Calo/interface/HFShowerParam.h @@ -7,6 +7,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "DetectorDescription/Core/interface/DDsvalues.h" #include "SimG4CMS/Calo/interface/HFShowerLibrary.h" #include "SimG4CMS/Calo/interface/HFFibre.h" @@ -41,7 +42,7 @@ class HFShowerParam { double edep; }; - void initRun(G4ParticleTable *); + void initRun(G4ParticleTable *, HcalDDDSimConstants*); std::vector getHits(G4Step * aStep, double weight); private: diff --git a/SimG4CMS/Calo/interface/HcalTestAnalysis.h b/SimG4CMS/Calo/interface/HcalTestAnalysis.h index a81cc05359155..7624d5a876be7 100644 --- a/SimG4CMS/Calo/interface/HcalTestAnalysis.h +++ b/SimG4CMS/Calo/interface/HcalTestAnalysis.h @@ -14,6 +14,7 @@ #include "SimG4CMS/Calo/interface/HcalTestHistoManager.h" #include "SimG4CMS/Calo/interface/HcalTestNumberingScheme.h" #include "Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include #include @@ -69,11 +70,12 @@ class HcalTestAnalysis : public SimWatcher, // Private Tuples std::auto_ptr tuplesManager; - HcalTestHistoClass * tuples; + HcalTestHistoClass *tuples; // Numbering scheme - HcalNumberingFromDDD * numberingFromDDD; - HcalTestNumberingScheme * org; + HcalNumberingFromDDD *numberingFromDDD; + HcalDDDSimConstants *hcons; + HcalTestNumberingScheme *org; // Hits for qie analysis std::vector caloHitCache; diff --git a/SimG4CMS/Calo/src/HCalSD.cc b/SimG4CMS/Calo/src/HCalSD.cc index 95a7317c44378..bcf37cfa18f43 100644 --- a/SimG4CMS/Calo/src/HCalSD.cc +++ b/SimG4CMS/Calo/src/HCalSD.cc @@ -13,8 +13,12 @@ #include "DetectorDescription/Core/interface/DDLogicalPart.h" #include "DetectorDescription/Core/interface/DDMaterial.h" #include "DetectorDescription/Core/interface/DDValue.h" -#include "FWCore/Utilities/interface/Exception.h" +#include "Geometry/Records/interface/HcalSimNumberingRecord.h" +#include "FWCore/Framework/interface/ESTransientHandle.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Utilities/interface/Exception.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" @@ -41,8 +45,8 @@ HCalSD::HCalSD(G4String name, const DDCompactView & cpv, CaloSD(name, cpv, clg, p, manager, p.getParameter("HCalSD").getParameter("TimeSliceUnit"), p.getParameter("HCalSD").getParameter("IgnoreTrackID")), - numberingFromDDD(0), numberingScheme(0), showerLibrary(0), hfshower(0), - showerParam(0), showerPMT(0), showerBundle(0), m_HEDarkening(0), + hcalConstants(0), numberingFromDDD(0), numberingScheme(0), showerLibrary(0), + hfshower(0), showerParam(0), showerPMT(0), showerBundle(0), m_HEDarkening(0), m_HFDarkening(0) { //static SimpleConfigurable on1(false, "HCalSD:UseBirkLaw"); @@ -107,7 +111,6 @@ HCalSD::HCalSD(G4String name, const DDCompactView & cpv, << " Flag (HF) " << ageingFlagHF << "\n" << "Application of Fiducial Cut " << applyFidCut; - numberingFromDDD = new HcalNumberingFromDDD(name, cpv); HcalNumberingScheme* scheme; if (testNumber || forTBH2) scheme = dynamic_cast(new HcalTestNumberingScheme(forTBH2)); @@ -256,48 +259,22 @@ HCalSD::HCalSD(G4String name, const DDCompactView & cpv, } if (fibre1LV.size() > 0 || fibre2LV.size() > 0) showerBundle = new HFShowerFibreBundle (name, cpv, p); - - attribute = "ReadOutName"; - value = name; - DDSpecificsFilter filter6; - DDValue ddv6(attribute,value,0); - filter6.setCriteria(ddv6,DDCompOp::equals); - DDFilteredView fv6(cpv); - fv6.addFilter(filter6); - if (fv6.firstChild()) { - DDsvalues_type sv(fv6.mergedSpecifics()); - //Special Geometry parameters - gpar = getDDDArray("gparHF",sv); - edm::LogInfo("HFShower") << "HFShowerParam: " << gpar.size() - << " gpar (cm)"; - for (unsigned int ig=0; ig::const_iterator matite; + attribute = "OnlyForHcalSimNumbering"; + value = "any"; DDSpecificsFilter filter2; - DDValue ddv2(attribute,name,0); - filter2.setCriteria(ddv2,DDCompOp::equals); + DDValue ddv2(attribute,value,0); + filter2.setCriteria(ddv2, DDCompOp::not_equals, + DDLogOp::AND, true, true); DDFilteredView fv2(cpv); fv2.addFilter(filter2); bool dodet = fv2.firstChild(); - DDsvalues_type sv(fv2.mergedSpecifics()); - //Layer0 Weight - layer0wt = getDDDArray("Layer0Wt",sv); - edm::LogInfo("HcalSim") << "HCalSD: " << layer0wt.size() << " Layer0Wt"; - for (unsigned int it=0; it::const_iterator matite; while (dodet) { const DDLogicalPart & log = fv2.logicalPart(); G4String namx = log.name().name(); @@ -332,6 +309,7 @@ HCalSD::HCalSD(G4String name, const DDCompactView & cpv, << " pointer " << materials[i]; mumPDG = mupPDG = 0; + maxDepthHF = 2; if (useLayerWt) readWeightFromFile(file); @@ -522,14 +500,14 @@ double HCalSD::getEnergyDeposit(G4Step* aStep) { } else ieta = HcalDetId(detid).ietaAbs(); #ifdef DebugLog - edm::LogInfo("HcalSimDark") << "HCalSD:HE_Darkening >>> ieta: "<< ieta //<< " vs. ietaAbs(): " << HcalDetId(detid).ietaAbs() - << " lay: " << lay-2; + edm::LogInfo("HcalSim") << "HCalSD:HE_Darkening >>> ieta: "<< ieta //<< " vs. ietaAbs(): " << HcalDetId(detid).ietaAbs() + << " lay: " << lay-2; #endif float dweight = m_HEDarkening->degradation(deliveredLumi,ieta,lay-2);//NB:diff. layer count weight *= dweight; #ifdef DebugLog - edm::LogInfo("HcalSimDark") << "HCalSD: >>> Lumi: " << deliveredLumi - << " coefficient = " << dweight; + edm::LogInfo("HcalSim") << "HCalSD: >>> Lumi: " << deliveredLumi + << " coefficient = " << dweight; #endif } @@ -563,17 +541,23 @@ double HCalSD::getEnergyDeposit(G4Step* aStep) { double wt1 = getResponseWt(theTrack); double wt2 = theTrack->GetWeight(); /* - if(wt2 != 1.0) { - std::cout << "HCalSD: Detector " << det+3 << " Depth " << depth - << " weight= " << weight << " wt1= " << wt1 - << " wt2= " << wt2 << std::endl; - std::cout << theTrack->GetDefinition()->GetParticleName() - << " " << theTrack->GetKineticEnergy() - << " Id=" << theTrack->GetTrackID() - << " IdP=" << theTrack->GetParentID(); + if (wt2 != 1.0) { + edm::LogInfo("HcalSim") << "HCalSD: Detector " << det+3 << " Depth " + << depth << " weight= " << weight << " wt1= " + << wt1 << " wt2= " << wt2; const G4VProcess* pr = theTrack->GetCreatorProcess(); - if(pr) std::cout << " from " << pr->GetProcessName(); - std::cout << std::endl; + if (pr) { + edm::LogInfo("HcalSim") << theTrack->GetDefinition()->GetParticleName() + << " " << theTrack->GetKineticEnergy() + << " Id=" << theTrack->GetTrackID() + << " IdP=" << theTrack->GetParentID() + << " from " << pr->GetProcessName(); + } else { + edm::LogInfo("HcalSim") << theTrack->GetDefinition()->GetParticleName() + << " " << theTrack->GetKineticEnergy() + << " Id=" << theTrack->GetTrackID() + << " IdP=" << theTrack->GetParentID(); + } } */ #ifdef DebugLog @@ -607,6 +591,38 @@ void HCalSD::setNumberingScheme(HcalNumberingScheme * scheme) { } } +void HCalSD::update(const BeginOfJob * job) { + + const edm::EventSetup* es = (*job)(); + edm::ESHandle hdc; + es->get().get(hdc); + if (hdc.isValid()) { + hcalConstants = (HcalDDDSimConstants*)(&(*hdc)); + } else { + edm::LogError("HcalSim") << "HCalSD : Cannot find HcalDDDSimConstant"; + throw cms::Exception("Unknown", "HCalSD") << "Cannot find HcalDDDSimConstant" << "\n"; + } + + numberingFromDDD = new HcalNumberingFromDDD(hcalConstants); + + maxDepthHF = hcalConstants->getMaxDepth(2); + edm::LogInfo("HcalSim") << "Maximum depth for HF " << maxDepthHF; + + //Special Geometry parameters + gpar = hcalConstants->getGparHF(); + edm::LogInfo("HcalSim") << "HCalSD: " << gpar.size()<< " gpar (cm)"; + for (unsigned int ig=0; iggetLayer0Wt(); + edm::LogInfo("HcalSim") << "HCalSD: " << layer0wt.size() << " Layer0Wt"; + for (unsigned int it=0; itFindParticle(particleName="mu+")->GetPDGEncoding(); #ifdef DebugLog LogDebug("HcalSim") << "HCalSD: Particle code for mu- = " << mumPDG - << " for mu+ = " << mupPDG; + << " for mu+ = " << mupPDG; #endif - if (showerLibrary) showerLibrary->initRun(theParticleTable); - if (showerParam) showerParam->initRun(theParticleTable); - if (hfshower) hfshower->initRun(theParticleTable); + if (showerLibrary) showerLibrary->initRun(theParticleTable,hcalConstants); + if (showerParam) showerParam->initRun(theParticleTable,hcalConstants); + if (hfshower) hfshower->initRun(theParticleTable,hcalConstants); + if (showerPMT) showerPMT->initRun(theParticleTable,hcalConstants); + if (showerBundle) showerBundle->initRun(theParticleTable,hcalConstants); } bool HCalSD::filterHit(CaloG4Hit* aHit, double time) { @@ -645,6 +663,7 @@ uint32_t HCalSD::setDetUnitId (int det, const G4ThreeVector& pos, int depth, int if (numberingFromDDD) { //get the ID's as eta, phi, depth, ... indices HcalNumberingFromDDD::HcalID tmp = numberingFromDDD->unitID(det, pos, depth, lay); + modifyDepth(tmp); //get the ID if (numberingScheme) id = numberingScheme->getUnitID(tmp); } @@ -850,10 +869,10 @@ void HCalSD::hitForFibre (G4Step* aStep, double weight) { // if not ParamShower #ifdef DebugLog edm::LogInfo("HcalSim") << "HCalSD::hitForFibre " << hits.size() - << " hits for " << GetName() << " of " << primaryID - << " with " << theTrack->GetDefinition()->GetParticleName() - << " of " << preStepPoint->GetKineticEnergy()/GeV - << " GeV in detector type " << det; + << " hits for " << GetName() << " of " << primaryID + << " with " << theTrack->GetDefinition()->GetParticleName() + << " of " << preStepPoint->GetKineticEnergy()/GeV + << " GeV in detector type " << det; #endif if (hits.size() > 0) { for (unsigned int i=0; iunitID(det,etaR,phi, depth,1); + modifyDepth(tmp); if (numberingScheme) unitID = numberingScheme->getUnitID(tmp); } currentID.setID(unitID, time, primaryID, 1); @@ -1026,6 +1046,7 @@ void HCalSD::getHitFibreBundle (G4Step* aStep, bool type) { uint32_t unitID = 0; if (numberingFromDDD) { HcalNumberingFromDDD::HcalID tmp = numberingFromDDD->unitID(det,etaR,phi,depth,1); + modifyDepth(tmp); if (numberingScheme) unitID = numberingScheme->getUnitID(tmp); } if (type) currentID.setID(unitID, time, primaryID, 3); @@ -1060,7 +1081,7 @@ int HCalSD::setTrackID (G4Step* aStep) { if (primaryID == 0) { #ifdef DebugLog edm::LogInfo("HcalSim") << "HCalSD: Problem with primaryID **** set by " - << "force to TkID **** " <GetTrackID(); + << "force to TkID **** " <GetTrackID(); #endif primaryID = theTrack->GetTrackID(); } @@ -1104,6 +1125,7 @@ double HCalSD::layerWeight(int det, const G4ThreeVector& pos, int depth, int lay //get the ID's as eta, phi, depth, ... indices HcalNumberingFromDDD::HcalID tmp = numberingFromDDD->unitID(det, pos, depth, lay); + modifyDepth(tmp); uint32_t id = HcalTestNumbering::packHcalIndex(tmp.subdet, tmp.zside, 1, tmp.etaR, tmp.phis,tmp.lay); std::map::const_iterator ite = layerWeights.find(id); @@ -1173,3 +1195,10 @@ void HCalSD::plotHF(G4ThreeVector& hitPoint, bool emType) { if (hzvhad != 0) hzvhad->Fill(zv); } } + +void HCalSD::modifyDepth(HcalNumberingFromDDD::HcalID& id) { + if (id.subdet == 4 && maxDepthHF > 2) { + if (id.depth <= 2) + if (G4UniformRand() > 0.5) id.depth += 2; + } +} diff --git a/SimG4CMS/Calo/src/HFFibre.cc b/SimG4CMS/Calo/src/HFFibre.cc index 43cc66ce69a89..e59655fced3ac 100644 --- a/SimG4CMS/Calo/src/HFFibre.cc +++ b/SimG4CMS/Calo/src/HFFibre.cc @@ -73,44 +73,27 @@ HFFibre::HFFibre(std::string & name, const DDCompactView & cpv, throw cms::Exception("Unknown", "HFFibre") << "cannot match " << attribute << " to " << name <<"\n"; } - - // Now geometry parameters - attribute = "ReadOutName"; - value = name; - DDSpecificsFilter filter2; - DDValue ddv2(attribute,value,0); - filter2.setCriteria(ddv2,DDCompOp::equals); - DDFilteredView fv2(cpv); - fv2.addFilter(filter2); - dodet = fv2.firstChild(); - if (dodet) { - DDsvalues_type sv(fv2.mergedSpecifics()); - - //Special Geometry parameters - int nb = -1; - gpar = getDDDArray("gparHF",sv,nb); - edm::LogInfo("HFShower") << "HFFibre: " << nb <<" gpar (cm)"; - for (int i=0; igetGparHF(); + edm::LogInfo("HFShower") << "HFFibre: " << gpar.size() <<" gpar (cm)"; + for (unsigned int i=0; igetRTableHF(); + nBinR = (int)(radius.size()); + edm::LogInfo("HFShower") << "HFFibre: " << radius.size() <<" rTable (cm)"; + for (unsigned int i=0; i HFShower::HFShower(std::string & name, const DDCompactView & cpv, - edm::ParameterSet const & p, int chk) : cherenkov(0), + edm::ParameterSet const & p, int chk) : cherenkov(0), fibre(0), chkFibre(chk) { @@ -35,30 +35,6 @@ HFShower::HFShower(std::string & name, const DDCompactView & cpv, edm::LogInfo("HFShower") << "HFShower:: Maximum probability cut off " << probMax << " Check flag " << chkFibre; - G4String attribute = "ReadOutName"; - G4String value = name; - DDSpecificsFilter filter; - DDValue ddv(attribute,value,0); - filter.setCriteria(ddv,DDCompOp::equals); - DDFilteredView fv(cpv); - fv.addFilter(filter); - bool dodet = fv.firstChild(); - if ( dodet ) { - DDsvalues_type sv(fv.mergedSpecifics()); - - //Special Geometry parameters - int ngpar = 7; - gpar = getDDDArray("gparHF", sv,ngpar); - edm::LogInfo("HFShower") << "HFShower: " << ngpar << " gpar (cm)"; - for (int ig=0; ig HFShower::getDDDArray(const std::string & str, } } -void HFShower::initRun(G4ParticleTable *) {// Define PDG codes +void HFShower::initRun(G4ParticleTable *, HcalDDDSimConstants* hcons) { + + //Special Geometry parameters + gpar = hcons->getGparHF(); + edm::LogInfo("HFShower") << "HFShower: " << gpar.size() << " gpar (cm)"; + for (unsigned int ig=0; iginitRun(hcons); } diff --git a/SimG4CMS/Calo/src/HFShowerFibreBundle.cc b/SimG4CMS/Calo/src/HFShowerFibreBundle.cc index 30d9695cb4727..593e7f52c4670 100644 --- a/SimG4CMS/Calo/src/HFShowerFibreBundle.cc +++ b/SimG4CMS/Calo/src/HFShowerFibreBundle.cc @@ -32,34 +32,10 @@ HFShowerFibreBundle::HFShowerFibreBundle(std::string & name, edm::LogInfo("HFShower") << "HFShowerFibreBundle intialized with factors: " << facTube << " for the straight portion and " << facCone << " for the curved portion"; - - G4String attribute = "ReadOutName"; - G4String value = name; - DDSpecificsFilter filter0; - DDValue ddv0(attribute,value,0); - filter0.setCriteria(ddv0,DDCompOp::equals); - DDFilteredView fv0(cpv); - fv0.addFilter(filter0); - if (fv0.firstChild()) { - DDsvalues_type sv0(fv0.mergedSpecifics()); - - //Special Geometry parameters - rTable = getDDDArray("rTable",sv0); - edm::LogInfo("HFShower") << "HFShowerFibreBundle: " << rTable.size() - << " rTable (cm)"; - for (unsigned int ig=0; iggetRTableHF(); + edm::LogInfo("HFShower") << "HFShowerFibreBundle: " << rTable.size() + << " rTable (cm)"; + for (unsigned int ig=0; ig rTable = getDDDArray("rTable",sv,nR); - rMin = rTable[0]; - rMax = rTable[nR-1]; - edm::LogInfo("HFShower") << "HFShowerLibrary: rMIN " << rMin/cm - << " cm and rMax " << rMax/cm; - - //Delta phi - int nEta = -1; - std::vector etaTable = getDDDArray("etaTable",sv,nEta); - int nPhi = nEta + nR - 2; - std::vector phibin = getDDDArray("phibin",sv,nPhi); - dphi = phibin[nEta-1]; - edm::LogInfo("HFShower") << "HFShowerLibrary: (Half) Phi Width of wedge " - << dphi/deg; - - //Special Geometry parameters - int ngpar = 7; - gpar = getDDDArray("gparHF",sv,ngpar); - edm::LogInfo("HFShower") << "HFShowerLibrary: " << ngpar << " gpar (cm)"; - for (int ig=0; iginitRun(hcons); G4String parName; emPDG = theParticleTable->FindParticle(parName="e-")->GetPDGEncoding(); @@ -191,6 +151,26 @@ void HFShowerLibrary::initRun(G4ParticleTable * theParticleTable) { << ", anti_nu_e = " << anuePDG << ", anti_nu_mu = " << anumuPDG << ", anti_nu_tau = " << anutauPDG; #endif + + //Radius (minimum and maximum) + std::vector rTable = hcons->getRTableHF(); + rMin = rTable[0]; + rMax = rTable[rTable.size()-1]; + edm::LogInfo("HFShower") << "HFShowerLibrary: rMIN " << rMin/cm + << " cm and rMax " << rMax/cm; + + //Delta phi + std::vector phibin = hcons->getPhiTableHF(); + dphi = phibin[0]; + edm::LogInfo("HFShower") << "HFShowerLibrary: (Half) Phi Width of wedge " + << dphi/deg; + + //Special Geometry parameters + gpar = hcons->getGparHF(); + edm::LogInfo("HFShower") << "HFShowerLibrary: " <("HFShowerPMT"); pePerGeV = m_HF.getParameter("PEPerGeVPMT"); - G4String attribute = "ReadOutName"; - G4String value = name; - DDSpecificsFilter filter0; - DDValue ddv0(attribute,value,0); - filter0.setCriteria(ddv0,DDCompOp::equals); - DDFilteredView fv0(cpv); - fv0.addFilter(filter0); - if (fv0.firstChild()) { - DDsvalues_type sv0(fv0.mergedSpecifics()); - - //Special Geometry parameters - rTable = getDDDArray("rTable",sv0); - edm::LogInfo("HFShower") << "HFShowerPMT: " << rTable.size() - << " rTable (cm)"; - for (unsigned int ig=0; iggetRTableHF(); + edm::LogInfo("HFShower") << "HFShowerPMT: " << rTable.size() + << " rTable (cm)"; + for (unsigned int ig=0; igattLength(lambdaMean); @@ -117,7 +94,8 @@ HFShowerParam::~HFShowerParam() { if (showerLibrary) delete showerLibrary; } -void HFShowerParam::initRun(G4ParticleTable * theParticleTable) { +void HFShowerParam::initRun(G4ParticleTable * theParticleTable, + HcalDDDSimConstants* hcons) { emPDG = theParticleTable->FindParticle("e-")->GetPDGEncoding(); epPDG = theParticleTable->FindParticle("e+")->GetPDGEncoding(); gammaPDG = theParticleTable->FindParticle("gamma")->GetPDGEncoding(); @@ -125,7 +103,15 @@ void HFShowerParam::initRun(G4ParticleTable * theParticleTable) { edm::LogInfo("HFShower") << "HFShowerParam: Particle code for e- = " << emPDG << " for e+ = " << epPDG << " for gamma = " << gammaPDG; #endif - if (showerLibrary) showerLibrary->initRun(theParticleTable); + if (showerLibrary) showerLibrary->initRun(theParticleTable, hcons); + if (fibre) fibre->initRun(hcons); + + //Special Geometry parameters + gpar = hcons->getGparHF(); + edm::LogInfo("HFShower") << "HFShowerParam: " << gpar.size() <<" gpar (cm)"; + for (unsigned int ig=0; ig HFShowerParam::getHits(G4Step * aStep, diff --git a/SimG4CMS/Calo/src/HcalTestAnalysis.cc b/SimG4CMS/Calo/src/HcalTestAnalysis.cc index ddd895c444c9d..2c4785cbafa51 100644 --- a/SimG4CMS/Calo/src/HcalTestAnalysis.cc +++ b/SimG4CMS/Calo/src/HcalTestAnalysis.cc @@ -12,8 +12,8 @@ #include "DataFormats/Math/interface/Point3D.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESTransientHandle.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "Geometry/Records/interface/HcalSimNumberingRecord.h" #include "DetectorDescription/Core/interface/DDCompactView.h" #include "G4SDManager.hh" @@ -151,11 +151,12 @@ std::vector HcalTestAnalysis::towersToAdd(int centre, int nadd) { void HcalTestAnalysis::update(const BeginOfJob * job) { // Numbering From DDD - edm::ESTransientHandle pDD; - (*job)()->get().get(pDD); + edm::ESHandle hdc; + (*job)()->get().get(hdc); + hcons = (HcalDDDSimConstants*)(&(*hdc)); edm::LogInfo("HcalSim") << "HcalTestAnalysis:: Initialise " << "HcalNumberingFromDDD for " << names[0]; - numberingFromDDD = new HcalNumberingFromDDD(names[0], (*pDD)); + numberingFromDDD = new HcalNumberingFromDDD(hcons); // Ntuples tuplesManager.reset(new HcalTestHistoManager(fileName)); @@ -184,7 +185,7 @@ void HcalTestAnalysis::update(const BeginOfRun * run) { } int idet = static_cast(HcalBarrel); while (loop) { - HcalCellType::HcalCell tmp = numberingFromDDD->cell(idet,1,1,etac,phic); + HcalCellType::HcalCell tmp = hcons->cell(idet,1,1,etac,phic); if (tmp.ok) { if (eta) eta0 = tmp.eta; if (phi) phi0 = tmp.phi; diff --git a/SimG4CMS/Calo/test/python/minbias_cfg.py b/SimG4CMS/Calo/test/python/minbias_cfg.py index ac18297d785fe..caf7c5efa9ac9 100644 --- a/SimG4CMS/Calo/test/python/minbias_cfg.py +++ b/SimG4CMS/Calo/test/python/minbias_cfg.py @@ -6,8 +6,11 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("SimG4Core.Application.g4SimHits_cfi") + process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi") process.source = cms.Source("EmptySource") @@ -76,6 +79,10 @@ ) ) +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck", diff --git a/SimG4CMS/Calo/test/python/monopoleStepppingAction_cfg.py b/SimG4CMS/Calo/test/python/monopoleStepppingAction_cfg.py index 7adfae9c45f8c..797a8128b3817 100644 --- a/SimG4CMS/Calo/test/python/monopoleStepppingAction_cfg.py +++ b/SimG4CMS/Calo/test/python/monopoleStepppingAction_cfg.py @@ -7,10 +7,16 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsSimIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.load("SimG4Core.Application.g4SimHits_cfi") process.MessageLogger = cms.Service("MessageLogger", @@ -98,11 +104,6 @@ process.Tracer = cms.Service("Tracer") -process.common_maximum_timex = cms.PSet( - MaxTrackTime = cms.double(1000.0), - MaxTimeNames = cms.vstring(), - MaxTrackTimes = cms.vdouble() -) process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits) process.outpath = cms.EndPath(process.o1) process.g4SimHits.Physics.type = 'SimG4Core/Physics/QGSP_BERT_EML' @@ -110,22 +111,50 @@ process.g4SimHits.Physics.MonopoleTransport = False process.g4SimHits.Physics.Verbosity = 2 process.g4SimHits.G4Commands = ['/tracking/verbose 1'] +process.common_maximum_timex = cms.PSet( + MaxTrackTime = cms.double(1000.0), + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) +) process.g4SimHits.StackingAction = cms.PSet( process.common_heavy_suppression, process.common_maximum_timex, - KillDeltaRay = cms.bool(False), TrackNeutrino = cms.bool(False), + KillDeltaRay = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(False), + GammaThreshold= cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), - SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True) + SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit= cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(False), - CriticalEnergyForVacuum = cms.double(0.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring(), EkinThresholds = cms.vdouble(), EkinParticles = cms.vstring(), diff --git a/SimG4CMS/Calo/test/python/monopole_cfg.py b/SimG4CMS/Calo/test/python/monopole_cfg.py index 37067da90e0b4..8d946ceacb162 100644 --- a/SimG4CMS/Calo/test/python/monopole_cfg.py +++ b/SimG4CMS/Calo/test/python/monopole_cfg.py @@ -7,10 +7,16 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsSimIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.load("SimG4Core.Application.g4SimHits_cfi") process.MessageLogger = cms.Service("MessageLogger", @@ -98,12 +104,6 @@ process.Tracer = cms.Service("Tracer") -process.common_maximum_timex = cms.PSet( - MaxTrackTime = cms.double(1000.0), - MaxTimeNames = cms.vstring(), - MaxTrackTimes = cms.vdouble() -) - process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits) process.outpath = cms.EndPath(process.o1) process.g4SimHits.Physics.type = 'SimG4Core/Physics/QGSP_BERT_EML' @@ -113,22 +113,50 @@ process.g4SimHits.TrackerSD.EnergyThresholdForPersistencyInGeV = 1.0 process.g4SimHits.TrackerSD.EnergyThresholdForHistoryInGeV = 0.5 process.g4SimHits.CaloSD.EminTrack = 5.0 +process.common_maximum_timex = cms.PSet( + MaxTrackTime = cms.double(1000.0), + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) +) process.g4SimHits.StackingAction = cms.PSet( process.common_heavy_suppression, process.common_maximum_timex, - KillDeltaRay = cms.bool(False), TrackNeutrino = cms.bool(False), + KillDeltaRay = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(False), + GammaThreshold= cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), - SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True) + SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit= cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(False), - CriticalEnergyForVacuum = cms.double(0.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring(), EkinThresholds = cms.vdouble(), EkinParticles = cms.vstring(), diff --git a/SimG4CMS/Calo/test/python/qcdpt3000_3500_cfg.py b/SimG4CMS/Calo/test/python/qcdpt3000_3500_cfg.py index 09cc4b4816d36..d8df8f4355980 100644 --- a/SimG4CMS/Calo/test/python/qcdpt3000_3500_cfg.py +++ b/SimG4CMS/Calo/test/python/qcdpt3000_3500_cfg.py @@ -6,10 +6,16 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet( diff --git a/SimG4CMS/Calo/test/python/runAPD_cfg.py b/SimG4CMS/Calo/test/python/runAPD_cfg.py index 989c19428fd5e..a0bf6ed2132d0 100644 --- a/SimG4CMS/Calo/test/python/runAPD_cfg.py +++ b/SimG4CMS/Calo/test/python/runAPD_cfg.py @@ -8,6 +8,10 @@ process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring('cout'), categories = cms.untracked.vstring('CaloSim', 'EcalGeom', 'EcalSim', @@ -86,11 +90,6 @@ fileName = cms.string('runWithAPD_Epoxy.root') ) -process.common_maximum_timex = cms.PSet( - MaxTrackTime = cms.double(1000.0), - MaxTimeNames = cms.vstring(), - MaxTrackTimes = cms.vdouble() -) process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits*process.caloSimHitStudy) process.VtxSmeared.MeanZ = -1.0 process.VtxSmeared.SigmaX = 0.0 @@ -108,22 +107,50 @@ process.g4SimHits.ECalSD.StoreSecondary = True process.g4SimHits.CaloTrkProcessing.PutHistory = True process.g4SimHits.G4Commands = ['/run/verbose 2'] +process.common_maximum_timex = cms.PSet( + MaxTrackTime = cms.double(1000.0), + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) +) process.g4SimHits.StackingAction = cms.PSet( process.common_heavy_suppression, process.common_maximum_timex, - KillDeltaRay = cms.bool(True), TrackNeutrino = cms.bool(False), + KillDeltaRay = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(False), + GammaThreshold= cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), - SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True) + SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit= cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(False), - CriticalEnergyForVacuum = cms.double(0.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring(), EkinThresholds = cms.vdouble(), EkinParticles = cms.vstring(), diff --git a/SimG4CMS/Calo/test/python/runEta13_cfg.py b/SimG4CMS/Calo/test/python/runEta13_cfg.py index 3509cea194674..c7e9f64e12bb8 100644 --- a/SimG4CMS/Calo/test/python/runEta13_cfg.py +++ b/SimG4CMS/Calo/test/python/runEta13_cfg.py @@ -5,7 +5,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsSimIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") @@ -34,6 +36,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(5000) ) diff --git a/SimG4CMS/Calo/test/python/runEta2_cfg.py b/SimG4CMS/Calo/test/python/runEta2_cfg.py index 860b530bed8f7..b7b1c0d66771e 100644 --- a/SimG4CMS/Calo/test/python/runEta2_cfg.py +++ b/SimG4CMS/Calo/test/python/runEta2_cfg.py @@ -5,7 +5,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsSimIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") @@ -38,6 +40,10 @@ input = cms.untracked.int32(5000) ) +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.source = cms.Source("EmptySource") process.generator = cms.EDProducer("FlatRandomEGunProducer", diff --git a/SimG4CMS/Calo/test/python/runEta7_cfg.py b/SimG4CMS/Calo/test/python/runEta7_cfg.py index fe9a685280205..12cfa6c800c81 100644 --- a/SimG4CMS/Calo/test/python/runEta7_cfg.py +++ b/SimG4CMS/Calo/test/python/runEta7_cfg.py @@ -5,7 +5,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsSimIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") @@ -34,6 +36,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(5000) ) diff --git a/SimG4CMS/Calo/test/python/runHF1_cfg.py b/SimG4CMS/Calo/test/python/runHF1_cfg.py index afc2f9348fca7..af5045ce66e0c 100644 --- a/SimG4CMS/Calo/test/python/runHF1_cfg.py +++ b/SimG4CMS/Calo/test/python/runHF1_cfg.py @@ -5,7 +5,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsExtendedGeometryHFParametrizeXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.HFPMTHitAnalyzer_cfi") @@ -50,6 +52,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.maxEvents = cms.untracked.PSet( diff --git a/SimG4CMS/Calo/test/python/runHF2_cfg.py b/SimG4CMS/Calo/test/python/runHF2_cfg.py index f72b568acabbc..41f7cff770720 100644 --- a/SimG4CMS/Calo/test/python/runHF2_cfg.py +++ b/SimG4CMS/Calo/test/python/runHF2_cfg.py @@ -5,7 +5,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsExtendedGeometryHFParametrizeXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.HFPMTHitAnalyzer_cfi") @@ -50,6 +52,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.maxEvents = cms.untracked.PSet( diff --git a/SimG4CMS/Calo/test/python/runHF3_cfg.py b/SimG4CMS/Calo/test/python/runHF3_cfg.py index 7ded8f5cbfffc..1c37fcacf8b1d 100644 --- a/SimG4CMS/Calo/test/python/runHF3_cfg.py +++ b/SimG4CMS/Calo/test/python/runHF3_cfg.py @@ -5,7 +5,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsExtendedGeometryHFLibraryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.HFPMTHitAnalyzer_cfi") @@ -50,6 +52,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.maxEvents = cms.untracked.PSet( diff --git a/SimG4CMS/Calo/test/python/runHF4_cfg.py b/SimG4CMS/Calo/test/python/runHF4_cfg.py index 14246cca89128..73992123e03f0 100644 --- a/SimG4CMS/Calo/test/python/runHF4_cfg.py +++ b/SimG4CMS/Calo/test/python/runHF4_cfg.py @@ -5,7 +5,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsExtendedGeometryHFLibraryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.HFPMTHitAnalyzer_cfi") @@ -50,6 +52,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.maxEvents = cms.untracked.PSet( diff --git a/SimG4CMS/Calo/test/python/runHF5_cfg.py b/SimG4CMS/Calo/test/python/runHF5_cfg.py index 50150d6770d00..d86ba05d26221 100644 --- a/SimG4CMS/Calo/test/python/runHF5_cfg.py +++ b/SimG4CMS/Calo/test/python/runHF5_cfg.py @@ -5,7 +5,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsExtendedGeometryHFLibraryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.HFPMTHitAnalyzer_cfi") @@ -50,6 +52,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.maxEvents = cms.untracked.PSet( diff --git a/SimG4CMS/Calo/test/python/runHFPMT0_cfg.py b/SimG4CMS/Calo/test/python/runHFPMT0_cfg.py index b5caeb7536b18..80f7b83ea06e8 100644 --- a/SimG4CMS/Calo/test/python/runHFPMT0_cfg.py +++ b/SimG4CMS/Calo/test/python/runHFPMT0_cfg.py @@ -7,7 +7,9 @@ process.load("Geometry.CMSCommonData.cmsHFPMTAverageXML_cfi") #process.load("SimG4CMS.Calo.cmsHFPMTXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.HFPMTHitAnalyzer_cfi") @@ -52,6 +54,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10000) ) diff --git a/SimG4CMS/Calo/test/python/runHFPMT_cfg.py b/SimG4CMS/Calo/test/python/runHFPMT_cfg.py index 0fed7a41d6750..e341d9f95eb75 100644 --- a/SimG4CMS/Calo/test/python/runHFPMT_cfg.py +++ b/SimG4CMS/Calo/test/python/runHFPMT_cfg.py @@ -8,13 +8,11 @@ #process.load("SimG4CMS.Calo.testGeometryPMTXML_cfi") process.load("Geometry.CMSCommonData.cmsHFPMTAverageXML_cfi") #process.load("SimG4CMS.Calo.cmsHFPMTXML_cfi") - process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") - -process.load("Configuration.StandardSequences.MagneticField_cff") - +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") - process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.HFPMTHitAnalyzer_cfi") @@ -59,6 +57,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.maxEvents = cms.untracked.PSet( @@ -93,12 +95,6 @@ fileName = cms.string('HFPMT2.root') ) -process.common_maximum_timex = cms.PSet( - MaxTrackTime = cms.double(500.0), - MaxTimeNames = cms.vstring(), - MaxTrackTimes = cms.vdouble() -) - process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits*process.hfPMTHitAnalyzer) process.outpath = cms.EndPath(process.o1) process.g4SimHits.Physics.type = 'SimG4Core/Physics/QGSP_BERT_EML' @@ -112,30 +108,50 @@ process.g4SimHits.HFShower.OnlyLong = True process.g4SimHits.HFShower.EminLibrary = 0.0 process.g4SimHits.HCalSD.HEDarkening = True +process.common_maximum_timex = cms.PSet( + MaxTrackTime = cms.double(1000.0), + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) +) process.g4SimHits.StackingAction = cms.PSet( process.common_heavy_suppression, process.common_maximum_timex, - KillDeltaRay = cms.bool(False), TrackNeutrino = cms.bool(False), + KillDeltaRay = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(False), + GammaThreshold= cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), - RusRoEcalNeutron = cms.double(1.0), - RusRoEcalNeutronLimit = cms.double(0.0), - RusRoHcalNeutron = cms.double(1.0), - RusRoHcalNeutronLimit = cms.double(0.0), - RusRoEcalProton = cms.double(1.0), - RusRoEcalProtonLimit = cms.double(0.0), - RusRoHcalProton = cms.double(1.0), - RusRoHcalProtonLimit = cms.double(0.0) + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit= cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(False), - CriticalEnergyForVacuum = cms.double(0.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring(), EkinThresholds = cms.vdouble(), EkinParticles = cms.vstring(), diff --git a/SimG4CMS/Calo/test/python/runHF_cfg.py b/SimG4CMS/Calo/test/python/runHF_cfg.py index 3211b065365d1..883f572e9907f 100644 --- a/SimG4CMS/Calo/test/python/runHF_cfg.py +++ b/SimG4CMS/Calo/test/python/runHF_cfg.py @@ -5,7 +5,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsHFPMTFibreXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.HFPMTHitAnalyzer_cfi") @@ -50,6 +52,10 @@ process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.maxEvents = cms.untracked.PSet( @@ -85,9 +91,12 @@ ) process.common_maximum_timex = cms.PSet( - MaxTrackTime = cms.double(500.0), - MaxTimeNames = cms.vstring(), - MaxTrackTimes = cms.vdouble() + MaxTrackTime = cms.double(500.0), + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) ) process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits*process.hfPMTHitAnalyzer) @@ -110,16 +119,36 @@ KillDeltaRay = cms.bool(False), TrackNeutrino = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(True), + GammaThreshold = cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), - SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True) + SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit = cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(False), - CriticalEnergyForVacuum = cms.double(0.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring(), EkinThresholds = cms.vdouble(), EkinParticles = cms.vstring(), diff --git a/SimG4CMS/Calo/test/python/runHOMuonStudy_cfg.py b/SimG4CMS/Calo/test/python/runHOMuonStudy_cfg.py index b5c00de5aada9..3b5dfaa8615d7 100644 --- a/SimG4CMS/Calo/test/python/runHOMuonStudy_cfg.py +++ b/SimG4CMS/Calo/test/python/runHOMuonStudy_cfg.py @@ -6,10 +6,16 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsSimIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.load("IOMC.RandomEngine.IOMC_cff") process.RandomNumberGeneratorService.generator.initialSeed = 456789 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 diff --git a/SimG4CMS/Calo/test/python/runMuon_cfg.py b/SimG4CMS/Calo/test/python/runMuon_cfg.py index 44ad6fffb54cd..fda7b70fae1b9 100644 --- a/SimG4CMS/Calo/test/python/runMuon_cfg.py +++ b/SimG4CMS/Calo/test/python/runMuon_cfg.py @@ -6,11 +6,17 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsSimIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run2_mc'] + process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring('cout'), categories = cms.untracked.vstring('CaloSim', @@ -104,11 +110,6 @@ fileName = cms.string('runMuon.root') ) -process.common_maximum_timex = cms.PSet( - MaxTrackTime = cms.double(1000.0), - MaxTimeNames = cms.vstring(), - MaxTrackTimes = cms.vdouble() -) process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits*process.caloSimHitStudy) process.outpath = cms.EndPath(process.o1) process.g4SimHits.Physics.type = 'SimG4Core/Physics/QGSP_BERT_EML' @@ -118,39 +119,67 @@ process.g4SimHits.CaloResponse.ResponseScale = 1.0 process.g4SimHits.CaloResponse.ResponseFile = 'SimG4CMS/Calo/data/responsTBpim50.dat' process.g4SimHits.G4Commands = ['/tracking/verbose 1'] +process.common_maximum_timex = cms.PSet( + MaxTrackTime = cms.double(1000.0), + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) +) process.g4SimHits.StackingAction = cms.PSet( process.common_heavy_suppression, process.common_maximum_timex, TrackNeutrino = cms.bool(False), KillDeltaRay = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(False), + GammaThreshold= cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), - SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True) + SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit= cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(False), - CriticalEnergyForVacuum = cms.double(0.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring(), EkinThresholds = cms.vdouble(), EkinParticles = cms.vstring(), Verbosity = cms.untracked.int32(2) ) -process.g4SimHits.Watchers = cms.VPSet(cms.PSet( - CheckForHighEtPhotons = cms.untracked.bool(False), - TrackMin = cms.untracked.int32(0), - TrackMax = cms.untracked.int32(0), - TrackStep = cms.untracked.int32(1), - EventMin = cms.untracked.int32(0), - EventMax = cms.untracked.int32(0), - EventStep = cms.untracked.int32(1), - PDGids = cms.untracked.vint32(), - VerboseLevel = cms.untracked.int32(0), - G4Verbose = cms.untracked.bool(True), - DEBUG = cms.untracked.bool(False), - type = cms.string('TrackingVerboseAction') -)) +#process.g4SimHits.Watchers = cms.VPSet(cms.PSet( +# CheckForHighEtPhotons = cms.untracked.bool(False), +# TrackMin = cms.untracked.int32(0), +# TrackMax = cms.untracked.int32(0), +# TrackStep = cms.untracked.int32(1), +# EventMin = cms.untracked.int32(0), +# EventMax = cms.untracked.int32(0), +# EventStep = cms.untracked.int32(1), +# PDGids = cms.untracked.vint32(), +# VerboseLevel = cms.untracked.int32(0), +# G4Verbose = cms.untracked.bool(True), +# DEBUG = cms.untracked.bool(False), +# type = cms.string('TrackingVerboseAction') +#)) diff --git a/SimG4CMS/Calo/test/python/runScale_cfg.py b/SimG4CMS/Calo/test/python/runScale_cfg.py index a029c398698dd..56abc95ee198e 100644 --- a/SimG4CMS/Calo/test/python/runScale_cfg.py +++ b/SimG4CMS/Calo/test/python/runScale_cfg.py @@ -6,11 +6,17 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring('cout'), categories = cms.untracked.vstring('HitStudy', 'G4cout', 'G4cerr'), diff --git a/SimG4CMS/Calo/test/python/runTestTime_cfg.py b/SimG4CMS/Calo/test/python/runTestTime_cfg.py index 3e5cb5ad6edc9..8000798c1648a 100644 --- a/SimG4CMS/Calo/test/python/runTestTime_cfg.py +++ b/SimG4CMS/Calo/test/python/runTestTime_cfg.py @@ -5,10 +5,16 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsSimIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring('cout'), categories = cms.untracked.vstring('Physics', 'SimG4CoreApplication', @@ -75,33 +81,56 @@ process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits) process.outpath = cms.EndPath(process.o1) +process.g4SimHits.Physics.type = 'SimG4Core/Physics/QGSP' +process.g4SimHits.G4Commands = ['/tracking/verbose 1'] process.common_maximum_timex = cms.PSet( MaxTrackTime = cms.double(1000.0), - MaxTimeNames = cms.vstring('TrackerDeadRegion', 'CaloRegions'), - MaxTrackTimes = cms.vdouble(250.0,500.0) + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) ) -process.g4SimHits.Physics.type = 'SimG4Core/Physics/QGSP' -process.g4SimHits.G4Commands = ['/tracking/verbose 1'] process.g4SimHits.StackingAction = cms.PSet( process.common_heavy_suppression, process.common_maximum_timex, TrackNeutrino = cms.bool(False), KillDeltaRay = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(False), + GammaThreshold= cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), - SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True) + SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit= cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(True), - CriticalEnergyForVacuum = cms.double(2.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring('FixedShield01','FixedShield02','FixedShield03','FixedShield04','FixedShield05','FixedShield06','FixedShield07','FixedShield08','FixedShield09','FixedShield10'), EkinThresholds = cms.vdouble(0.1,0.1,10.0,10.0), EkinParticles = cms.vstring('e+','e-','pi+','pi-'), - Verbosity = cms.untracked.int32(0) + Verbosity = cms.untracked.int32(2) ) process.g4SimHits.Watchers = cms.VPSet(cms.PSet( CheckForHighEtPhotons = cms.untracked.bool(False), diff --git a/SimG4CMS/Calo/test/python/runTestWithGun_cfg.py b/SimG4CMS/Calo/test/python/runTestWithGun_cfg.py index f1ff078552986..88ca998bd6a7c 100644 --- a/SimG4CMS/Calo/test/python/runTestWithGun_cfg.py +++ b/SimG4CMS/Calo/test/python/runTestWithGun_cfg.py @@ -4,10 +4,16 @@ process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.ecalhcalGeometryXML_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.MessageLogger = cms.Service("MessageLogger", debugModules = cms.untracked.vstring('*'), cout = cms.untracked.PSet( @@ -110,29 +116,52 @@ process.g4SimHits.G4Commands = ['/tracking/verbose 1'] process.common_maximum_timex = cms.PSet( MaxTrackTime = cms.double(1000.0), - MaxTimeNames = cms.vstring('TrackerDeadRegion', 'CaloRegions'), - MaxTrackTimes = cms.vdouble(250.0,500.0) + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) ) process.g4SimHits.StackingAction = cms.PSet( process.common_heavy_suppression, process.common_maximum_timex, - KillDeltaRay = cms.bool(False), TrackNeutrino = cms.bool(False), + KillDeltaRay = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(False), + GammaThreshold= cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), - SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True) + SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit= cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(True), - CriticalEnergyForVacuum = cms.double(2.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring(), EkinThresholds = cms.vdouble(), EkinParticles = cms.vstring(), - Verbosity = cms.untracked.int32(0) + Verbosity = cms.untracked.int32(2) ) process.g4SimHits.Watchers = cms.VPSet(cms.PSet( HcalQie = cms.PSet( diff --git a/SimG4CMS/Calo/test/python/runTest_cfg.py b/SimG4CMS/Calo/test/python/runTest_cfg.py index 523cb140bfc3b..6abf3e0990b88 100644 --- a/SimG4CMS/Calo/test/python/runTest_cfg.py +++ b/SimG4CMS/Calo/test/python/runTest_cfg.py @@ -5,10 +5,16 @@ process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.ecalhcalGeometryXML_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.MessageLogger = cms.Service("MessageLogger", debugModules = cms.untracked.vstring('*'), cout = cms.untracked.PSet( diff --git a/SimG4CMS/Calo/test/python/runWithAPDTest_cfg.py b/SimG4CMS/Calo/test/python/runWithAPDTest_cfg.py index 5129f157b6e57..d487280a638db 100644 --- a/SimG4CMS/Calo/test/python/runWithAPDTest_cfg.py +++ b/SimG4CMS/Calo/test/python/runWithAPDTest_cfg.py @@ -6,12 +6,18 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsIdealGeometryAPD2XML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi") process.load("SimG4CMS.Calo.HitParentTest_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring('cout'), categories = cms.untracked.vstring('CaloSim', 'EcalGeom', 'EcalSim', @@ -111,11 +117,6 @@ fileName = cms.string('runWithGun_QGSP_BERT_EML.root') ) -process.common_maximum_timex = cms.PSet( - MaxTrackTime = cms.double(1000.0), - MaxTimeNames = cms.vstring(), - MaxTrackTimes = cms.vdouble() -) process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits*process.caloSimHitStudy*process.hitParentTest) process.outpath = cms.EndPath(process.o1) process.caloSimHitStudy.MaxEnergy = 1000.0 @@ -123,22 +124,50 @@ process.g4SimHits.ECalSD.StoreSecondary = True process.g4SimHits.CaloTrkProcessing.PutHistory = True process.g4SimHits.G4Commands = ['/run/verbose 2'] +process.common_maximum_timex = cms.PSet( + MaxTrackTime = cms.double(1000.0), + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) +) process.g4SimHits.StackingAction = cms.PSet( process.common_heavy_suppression, process.common_maximum_timex, - KillDeltaRay = cms.bool(True), TrackNeutrino = cms.bool(False), + KillDeltaRay = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(False), + GammaThreshold= cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), - SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True) + SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit= cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(False), - CriticalEnergyForVacuum = cms.double(0.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring(), EkinThresholds = cms.vdouble(), EkinParticles = cms.vstring(), diff --git a/SimG4CMS/Calo/test/python/runWithGun_cfg.py b/SimG4CMS/Calo/test/python/runWithGun_cfg.py index bd29197ff9ce3..b0d2c7da80acd 100644 --- a/SimG4CMS/Calo/test/python/runWithGun_cfg.py +++ b/SimG4CMS/Calo/test/python/runWithGun_cfg.py @@ -6,11 +6,17 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsIdealGeometryAPD1XML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring('cout'), categories = cms.untracked.vstring('CaloSim', 'EcalGeom', 'EcalSim', @@ -110,11 +116,6 @@ fileName = cms.string('runWithGun_QGSP_FTFP_BERT_EML.root') ) -process.common_maximum_timex = cms.PSet( - MaxTrackTime = cms.double(1000.0), - MaxTimeNames = cms.vstring(), - MaxTrackTimes = cms.vdouble() -) process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits*process.caloSimHitStudy) process.outpath = cms.EndPath(process.o1) process.caloSimHitStudy.MaxEnergy = 1000.0 @@ -129,22 +130,50 @@ process.g4SimHits.CaloResponse.ResponseScale = 1.0 process.g4SimHits.CaloResponse.ResponseFile = 'SimG4CMS/Calo/data/responsTBpim50.dat' process.g4SimHits.G4Commands = ['/run/verbose 2'] +process.common_maximum_timex = cms.PSet( + MaxTrackTime = cms.double(1000.0), + MaxTimeNames = cms.vstring(), + MaxTrackTimes = cms.vdouble(), + DeadRegions = cms.vstring(), + CriticalEnergyForVacuum = cms.double(2.0), + CriticalDensity = cms.double(1e-15) +) process.g4SimHits.StackingAction = cms.PSet( process.common_heavy_suppression, process.common_maximum_timex, - KillDeltaRay = cms.bool(True), - TrackNeutrino = cms.bool(False), + TrackNeutrino = cms.bool(True), + KillDeltaRay = cms.bool(False), KillHeavy = cms.bool(False), + KillGamma = cms.bool(False), + GammaThreshold= cms.double(0.0001), ## (MeV) SaveFirstLevelSecondary = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInTracker = cms.untracked.bool(True), SavePrimaryDecayProductsAndConversionsInCalo = cms.untracked.bool(True), - SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True) + SavePrimaryDecayProductsAndConversionsInMuon = cms.untracked.bool(True), + RusRoGammaEnergyLimit = cms.double(5.0), ## (MeV) + RusRoEcalGamma = cms.double(0.3), + RusRoHcalGamma = cms.double(0.3), + RusRoMuonIronGamma = cms.double(0.3), + RusRoPreShowerGamma = cms.double(0.3), + RusRoCastorGamma = cms.double(0.3), + RusRoWorldGamma = cms.double(0.3), + RusRoNeutronEnergyLimit= cms.double(10.0), ## (MeV) + RusRoEcalNeutron = cms.double(0.1), + RusRoHcalNeutron = cms.double(0.1), + RusRoMuonIronNeutron = cms.double(0.1), + RusRoPreShowerNeutron = cms.double(0.1), + RusRoCastorNeutron = cms.double(0.1), + RusRoWorldNeutron = cms.double(0.1), + RusRoProtonEnergyLimit = cms.double(0.0), + RusRoEcalProton = cms.double(1.0), + RusRoHcalProton = cms.double(1.0), + RusRoMuonIronProton = cms.double(1.0), + RusRoPreShowerProton = cms.double(1.0), + RusRoCastorProton = cms.double(1.0), + RusRoWorldProton = cms.double(1.0) ) process.g4SimHits.SteppingAction = cms.PSet( process.common_maximum_timex, - KillBeamPipe = cms.bool(False), - CriticalEnergyForVacuum = cms.double(0.0), - CriticalDensity = cms.double(1e-15), EkinNames = cms.vstring(), EkinThresholds = cms.vdouble(), EkinParticles = cms.vstring(), diff --git a/SimG4CMS/Calo/test/python/runZee_cfg.py b/SimG4CMS/Calo/test/python/runZee_cfg.py index da12c94bbd613..8cc8a132dd9bb 100644 --- a/SimG4CMS/Calo/test/python/runZee_cfg.py +++ b/SimG4CMS/Calo/test/python/runZee_cfg.py @@ -5,12 +5,18 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Configuration.StandardSequences.Geometry_cff") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("Calibration.IsolatedParticles.electronStudy_cfi") process.load("FWCore.MessageService.MessageLogger_ReleaseValidation_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", moduleSeeds = cms.PSet( g4SimHits = cms.untracked.uint32(9876), diff --git a/SimG4CMS/Calo/test/python/run_cfg.py b/SimG4CMS/Calo/test/python/run_cfg.py index a0bccb1383208..98563287c506b 100644 --- a/SimG4CMS/Calo/test/python/run_cfg.py +++ b/SimG4CMS/Calo/test/python/run_cfg.py @@ -5,10 +5,16 @@ process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.ecalhcalGeometryXML_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.MessageLogger = cms.Service("MessageLogger", debugModules = cms.untracked.vstring('*'), cout = cms.untracked.PSet( diff --git a/SimG4CMS/Calo/test/python/runttbar_cfg.py b/SimG4CMS/Calo/test/python/runttbar_cfg.py index 82f0529a33d36..dd8e9bd678022 100644 --- a/SimG4CMS/Calo/test/python/runttbar_cfg.py +++ b/SimG4CMS/Calo/test/python/runttbar_cfg.py @@ -5,12 +5,18 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Configuration.StandardSequences.Geometry_cff") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("Calibration.IsolatedParticles.electronStudy_cfi") process.load("FWCore.MessageService.MessageLogger_ReleaseValidation_cfi") +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run1_mc'] + process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", moduleSeeds = cms.PSet( g4SimHits = cms.untracked.uint32(9876), diff --git a/SimG4CMS/Calo/test/python/ttbar_cfg.py b/SimG4CMS/Calo/test/python/ttbar_cfg.py index 9d44378b9ad37..b22e3eab787b1 100644 --- a/SimG4CMS/Calo/test/python/ttbar_cfg.py +++ b/SimG4CMS/Calo/test/python/ttbar_cfg.py @@ -6,7 +6,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi") @@ -76,6 +78,10 @@ ) ) +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck", diff --git a/SimG4CMS/Calo/test/python/zee_cfg.py b/SimG4CMS/Calo/test/python/zee_cfg.py index 2ea290beae1ab..4e339b5548c9c 100644 --- a/SimG4CMS/Calo/test/python/zee_cfg.py +++ b/SimG4CMS/Calo/test/python/zee_cfg.py @@ -6,7 +6,9 @@ process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") -process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") +process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi") @@ -76,6 +78,10 @@ ) ) +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_mc', '') + process.Timing = cms.Service("Timing") process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck", diff --git a/SimG4CMS/HcalTestBeam/test/python/run2003_cfg.py b/SimG4CMS/HcalTestBeam/test/python/run2003_cfg.py index d88f3ce28fd0e..f25abef4b89b4 100644 --- a/SimG4CMS/HcalTestBeam/test/python/run2003_cfg.py +++ b/SimG4CMS/HcalTestBeam/test/python/run2003_cfg.py @@ -4,9 +4,9 @@ process.load("SimGeneral.HepPDTESSource.pdt_cfi") process.load("SimG4CMS.HcalTestBeam.TB2003GeometryXML_cfi") - +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.EventContent.EventContent_cff") - process.load("SimG4Core.Application.g4SimHits_cfi") process.TFileService = cms.Service("TFileService", diff --git a/SimG4CMS/HcalTestBeam/test/python/run2004_cfg.py b/SimG4CMS/HcalTestBeam/test/python/run2004_cfg.py index 8e1d0f8275262..7cbe6b577b378 100644 --- a/SimG4CMS/HcalTestBeam/test/python/run2004_cfg.py +++ b/SimG4CMS/HcalTestBeam/test/python/run2004_cfg.py @@ -4,9 +4,9 @@ process.load("SimGeneral.HepPDTESSource.pdt_cfi") process.load("SimG4CMS.HcalTestBeam.TB2004GeometryXML_cfi") - +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.EventContent.EventContent_cff") - process.load("SimG4Core.Application.g4SimHits_cfi") process.TFileService = cms.Service("TFileService", diff --git a/SimG4CMS/HcalTestBeam/test/python/run2006_33_cfg.py b/SimG4CMS/HcalTestBeam/test/python/run2006_33_cfg.py index 860989987e73c..d185e9d493ebb 100644 --- a/SimG4CMS/HcalTestBeam/test/python/run2006_33_cfg.py +++ b/SimG4CMS/HcalTestBeam/test/python/run2006_33_cfg.py @@ -5,9 +5,9 @@ process.load("SimGeneral.HepPDTESSource.pdt_cfi") process.load("SimG4CMS.HcalTestBeam.TB2006Geometry33XML_cfi") - +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.EventContent.EventContent_cff") - process.load("SimG4Core.Application.g4SimHits_cfi") process.TFileService = cms.Service("TFileService", diff --git a/SimG4CMS/HcalTestBeam/test/python/run2006_37_cfg.py b/SimG4CMS/HcalTestBeam/test/python/run2006_37_cfg.py index 8482b88f1ae53..ccfbda17c903b 100644 --- a/SimG4CMS/HcalTestBeam/test/python/run2006_37_cfg.py +++ b/SimG4CMS/HcalTestBeam/test/python/run2006_37_cfg.py @@ -5,9 +5,9 @@ process.load("SimGeneral.HepPDTESSource.pdt_cfi") process.load("SimG4CMS.HcalTestBeam.TB2006Geometry37XML_cfi") - +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.EventContent.EventContent_cff") - process.load("SimG4Core.Application.g4SimHits_cfi") process.TFileService = cms.Service("TFileService", diff --git a/SimG4CMS/HcalTestBeam/test/python/run2006_77_cfg.py b/SimG4CMS/HcalTestBeam/test/python/run2006_77_cfg.py index 7f6a2c2499800..f30e3aceefecd 100644 --- a/SimG4CMS/HcalTestBeam/test/python/run2006_77_cfg.py +++ b/SimG4CMS/HcalTestBeam/test/python/run2006_77_cfg.py @@ -3,11 +3,10 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") - process.load("SimG4CMS.HcalTestBeam.TB2006Geometry77XML_cfi") - +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.EventContent.EventContent_cff") - process.load("SimG4Core.Application.g4SimHits_cfi") process.TFileService = cms.Service("TFileService", diff --git a/SimG4CMS/HcalTestBeam/test/python/run2006_cfg.py b/SimG4CMS/HcalTestBeam/test/python/run2006_cfg.py index 036e0e24f8f39..5778382e90c29 100644 --- a/SimG4CMS/HcalTestBeam/test/python/run2006_cfg.py +++ b/SimG4CMS/HcalTestBeam/test/python/run2006_cfg.py @@ -3,11 +3,10 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") - process.load("SimG4CMS.HcalTestBeam.TB2006GeometryXML_cfi") - +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.EventContent.EventContent_cff") - process.load("SimG4Core.Application.g4SimHits_cfi") process.TFileService = cms.Service("TFileService", diff --git a/SimG4CMS/HcalTestBeam/test/python/run2007_cfg.py b/SimG4CMS/HcalTestBeam/test/python/run2007_cfg.py index 2918377ff250a..58758a2b4f023 100644 --- a/SimG4CMS/HcalTestBeam/test/python/run2007_cfg.py +++ b/SimG4CMS/HcalTestBeam/test/python/run2007_cfg.py @@ -2,11 +2,10 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") - process.load("SimG4CMS.HcalTestBeam.TB2007GeometryNoESXML_cfi") - +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.EventContent.EventContent_cff") - process.load("SimG4Core.Application.g4SimHits_cfi") process.TFileService = cms.Service("TFileService", diff --git a/SimG4CMS/HcalTestBeam/test/python/run2010_cfg.py b/SimG4CMS/HcalTestBeam/test/python/run2010_cfg.py index a3f51fa552046..a0cd40d2f6ce7 100644 --- a/SimG4CMS/HcalTestBeam/test/python/run2010_cfg.py +++ b/SimG4CMS/HcalTestBeam/test/python/run2010_cfg.py @@ -3,11 +3,10 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") - process.load("SimG4CMS.HcalTestBeam.TB2010GeometryXML_cfi") - +process.load("Geometry.HcalCommonData.hcalParameters_cfi") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi") process.load("Configuration.EventContent.EventContent_cff") - process.load("SimG4Core.Application.g4SimHits_cfi") process.TFileService = cms.Service("TFileService", diff --git a/SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h b/SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h index 7258595cb7651..8af79889b9d4c 100644 --- a/SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h +++ b/SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h @@ -2,6 +2,7 @@ #define SimG4CMS_ShowerLibraryProducer_FiberSD_h #include "SimG4Core/Notification/interface/Observer.h" +#include "SimG4Core/Notification/interface/BeginOfJob.h" #include "SimG4Core/Notification/interface/BeginOfRun.h" #include "SimG4Core/Notification/interface/BeginOfEvent.h" #include "SimG4Core/Notification/interface/EndOfEvent.h" @@ -23,6 +24,7 @@ class G4Step; class G4HCofThisEvent; class FiberSD : public SensitiveCaloDetector, + public Observer, public Observer, public Observer, public Observer { @@ -46,6 +48,7 @@ class FiberSD : public SensitiveCaloDetector, virtual uint32_t setDetUnitId(G4Step*); virtual void fillHits(edm::PCaloHitContainer&, std::string); + virtual void update(const BeginOfJob *); virtual void update(const BeginOfRun *); virtual void update(const BeginOfEvent *); virtual void update(const ::EndOfEvent *); diff --git a/SimG4CMS/ShowerLibraryProducer/src/FiberSD.cc b/SimG4CMS/ShowerLibraryProducer/src/FiberSD.cc index cf19038129304..9dbf765a17e43 100644 --- a/SimG4CMS/ShowerLibraryProducer/src/FiberSD.cc +++ b/SimG4CMS/ShowerLibraryProducer/src/FiberSD.cc @@ -1,6 +1,10 @@ #include "SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h" #include "SimDataFormats/CaloHit/interface/HFShowerPhoton.h" #include "DataFormats/Math/interface/Point3D.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" +#include "Geometry/Records/interface/HcalSimNumberingRecord.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/EventSetup.h" #include "G4VPhysicalVolume.hh" #include "G4PVPlacement.hh" @@ -124,6 +128,21 @@ void FiberSD::DrawAll() {} void FiberSD::PrintAll() {} +void FiberSD::update(const BeginOfJob * job) { + + const edm::EventSetup* es = (*job)(); + edm::ESHandle hdc; + es->get().get(hdc); + if (hdc.isValid()) { + HcalDDDSimConstants *hcalConstants = (HcalDDDSimConstants*)(&(*hdc)); + theShower->initRun(0, hcalConstants); + } else { + edm::LogError("HcalSim") << "HCalSD : Cannot find HcalDDDSimConstant"; + throw cms::Exception("Unknown", "HCalSD") << "Cannot find HcalDDDSimConstant" << "\n"; + } + +} + void FiberSD::update(const BeginOfRun *) {} void FiberSD::update(const BeginOfEvent *) {} diff --git a/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllEarly_50ns_cfi.py b/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllEarly_50ns_cfi.py index 3126c35260b7c..92f9869f5b59a 100644 --- a/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllEarly_50ns_cfi.py +++ b/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllEarly_50ns_cfi.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24), probValue = cms.vdouble(0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.01965,0.00953,0.00440,0.00196), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), fileNames = FileNames diff --git a/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllEarly_75ns_cfi.py b/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllEarly_75ns_cfi.py index e378914c1fa92..17095504f196f 100644 --- a/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllEarly_75ns_cfi.py +++ b/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllEarly_75ns_cfi.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24), probValue = cms.vdouble(0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.01965,0.00953,0.00440,0.00196), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), fileNames = FileNames diff --git a/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllLate_50ns_cfi.py b/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllLate_50ns_cfi.py index e7b9a64dca8c0..2952db5195977 100644 --- a/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllLate_50ns_cfi.py +++ b/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllLate_50ns_cfi.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24), probValue = cms.vdouble(0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.01965,0.00953,0.00440,0.00196), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), fileNames = FileNames diff --git a/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllLate_75ns_cfi.py b/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllLate_75ns_cfi.py index e6134cd7f637f..f271e1aa50319 100644 --- a/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllLate_75ns_cfi.py +++ b/SimGeneral/MixingModule/python/mix_E7TeV_Flat20_AllLate_75ns_cfi.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24), probValue = cms.vdouble(0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.01965,0.00953,0.00440,0.00196), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), fileNames = FileNames diff --git a/SimGeneral/MixingModule/python/mix_E7TeV_FlatDist10_2011EarlyData_50ns_cfi.py b/SimGeneral/MixingModule/python/mix_E7TeV_FlatDist10_2011EarlyData_50ns_cfi.py index bef43774093dd..ad93e5bf9ee60 100644 --- a/SimGeneral/MixingModule/python/mix_E7TeV_FlatDist10_2011EarlyData_50ns_cfi.py +++ b/SimGeneral/MixingModule/python/mix_E7TeV_FlatDist10_2011EarlyData_50ns_cfi.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24), probValue = cms.vdouble(0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0630151648,0.0526654164,0.0402754482,0.0292988928,0.0194384503,0.0122016783,0.007207042,0.004003637,0.0020278322,0.0010739954,0.0004595759,0.0002229748,0.0001028162,4.58337152809607E-05), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), fileNames = FileNames diff --git a/SimGeneral/MixingModule/python/mix_E7TeV_FlatDist10_2011EarlyData_inTimeOnly_cfi.py b/SimGeneral/MixingModule/python/mix_E7TeV_FlatDist10_2011EarlyData_inTimeOnly_cfi.py index 0b5fbf2f248b9..b104a97d18f48 100644 --- a/SimGeneral/MixingModule/python/mix_E7TeV_FlatDist10_2011EarlyData_inTimeOnly_cfi.py +++ b/SimGeneral/MixingModule/python/mix_E7TeV_FlatDist10_2011EarlyData_inTimeOnly_cfi.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24), probValue = cms.vdouble(0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0698146584,0.0630151648,0.0526654164,0.0402754482,0.0292988928,0.0194384503,0.0122016783,0.007207042,0.004003637,0.0020278322,0.0010739954,0.0004595759,0.0002229748,0.0001028162,4.58337152809607E-05), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), fileNames = FileNames diff --git a/SimGeneral/MixingModule/python/mix_E7TeV_ProbDist_2010Data_BX156_cfi.py b/SimGeneral/MixingModule/python/mix_E7TeV_ProbDist_2010Data_BX156_cfi.py index 6a736a74b3bb9..af29d5b469e0f 100644 --- a/SimGeneral/MixingModule/python/mix_E7TeV_ProbDist_2010Data_BX156_cfi.py +++ b/SimGeneral/MixingModule/python/mix_E7TeV_ProbDist_2010Data_BX156_cfi.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10), probValue = cms.vdouble(0.145168,0.251419,0.251596,0.17943,0.10,0.05,0.02,0.01,0.005,0.002,0.001), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), fileNames = FileNames diff --git a/SimGeneral/MixingModule/python/mix_E7TeV_Summer_2011_50ns_PoissonOOT.py b/SimGeneral/MixingModule/python/mix_E7TeV_Summer_2011_50ns_PoissonOOT.py index ff15f907d6dda..bc174c504b1f4 100644 --- a/SimGeneral/MixingModule/python/mix_E7TeV_Summer_2011_50ns_PoissonOOT.py +++ b/SimGeneral/MixingModule/python/mix_E7TeV_Summer_2011_50ns_PoissonOOT.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24), probValue = cms.vdouble(0.0400676665,0.040358009,0.0807116334,0.0924154156,0.0924154156,0.0924154156,0.0924154156,0.0924154156,0.0870356742,0.0767913175,0.0636400516,0.0494955563,0.036223831,0.0249767088,0.0162633216,0.0099919945,0.0058339324,0.0032326433,0.0017151846,0.0008505404,0.0004108859,0.0001905137,0.0000842383,0.000034939,0.0000142801), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), manage_OOT = cms.untracked.bool(True), ## manage out-of-time pileup diff --git a/SimGeneral/MixingModule/python/mix_E8TeV_FlatDist_2011EarlyData_50ns_cfi.py b/SimGeneral/MixingModule/python/mix_E8TeV_FlatDist_2011EarlyData_50ns_cfi.py index 2ba72f30866f0..ddda6e68b7db7 100644 --- a/SimGeneral/MixingModule/python/mix_E8TeV_FlatDist_2011EarlyData_50ns_cfi.py +++ b/SimGeneral/MixingModule/python/mix_E8TeV_FlatDist_2011EarlyData_50ns_cfi.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24), probValue = cms.vdouble(0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.04593,0.01965,0.00953,0.00440,0.00196), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), fileNames = FileNames diff --git a/SimGeneral/MixingModule/python/mix_E8TeV_ProbDist_2011EarlyData_50ns_cfi.py b/SimGeneral/MixingModule/python/mix_E8TeV_ProbDist_2011EarlyData_50ns_cfi.py index 70c1bb5cf173e..a7378ff2efad9 100644 --- a/SimGeneral/MixingModule/python/mix_E8TeV_ProbDist_2011EarlyData_50ns_cfi.py +++ b/SimGeneral/MixingModule/python/mix_E8TeV_ProbDist_2011EarlyData_50ns_cfi.py @@ -24,7 +24,6 @@ probFunctionVariable = cms.vint32(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24), probValue = cms.vdouble(0.00130001,0.00728453,0.0224114,0.0458138,0.0721875,0.09741,0.114875,0.120895,0.11885,0.10471,0.0878654,0.0681808,0.0497561,0.0345137,0.0230669,0.0137068,0.00810676,0.00446449,0.00229114,0.00119335,0.000606673,0.000271114,0.000146668,6.66674e-05,2.6667e-05), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ), sequential = cms.untracked.bool(False), fileNames = FileNames diff --git a/SimGeneral/MixingModule/test/mm_histoNumber_cfg.py b/SimGeneral/MixingModule/test/mm_histoNumber_cfg.py index 59ab6b2237bbe..6c009e53495de 100644 --- a/SimGeneral/MixingModule/test/mm_histoNumber_cfg.py +++ b/SimGeneral/MixingModule/test/mm_histoNumber_cfg.py @@ -52,7 +52,6 @@ process.mix.input.nbPileupEvents = cms.PSet( fileName = cms.untracked.string('histrandom.root'), histoName = cms.untracked.string('h1f'), - seed = cms.untracked.int32(54321) ) process.mix.input.fileNames = cms.untracked.vstring( diff --git a/SimGeneral/MixingModule/test/mm_probFunction_cfg.py b/SimGeneral/MixingModule/test/mm_probFunction_cfg.py index 30e193597c122..39b73e85abb71 100644 --- a/SimGeneral/MixingModule/test/mm_probFunction_cfg.py +++ b/SimGeneral/MixingModule/test/mm_probFunction_cfg.py @@ -55,7 +55,6 @@ # probValue = cms.vdouble(4914.0,3267.0,1311.0,397.0,92.0,14.0,3.0,2.0,0.0,0.0), probValue = cms.vdouble(0.4914,0.3267,0.1311,0.0397,0.0092,0.0014,0.0003,0.0002,0,0), histoFileName = cms.untracked.string('histProbFunction.root'), - seed = cms.untracked.int32(54321) ) process.mix.input.fileNames = cms.untracked.vstring( diff --git a/Validation/CaloTowers/test/CaloScan/README b/Validation/CaloTowers/test/CaloScan/README new file mode 100644 index 0000000000000..a8cebbf287666 --- /dev/null +++ b/Validation/CaloTowers/test/CaloScan/README @@ -0,0 +1,66 @@ +Please follow the steps as below: + +(1) cmsrel CMSSW_7_6_0_pre4 (for instance) + +(2) cd CMSSW_7_6_0_pre4/src + +(3) cmsenv + +(4) git cms-addpkg Validation/CaloTowers + +(5) scram b + +(6) mkdir scan + +(7) cd Validation/CaloTowers/CaloScan + +(8) ./make_configs.csh + +(9) ./submit_batch.csh + +NB: it uses batch submission (batch.csh) to lxbatch at CERN +with input file +/afs/cern.ch/cms/data/CMSSW/Validation/HcalHits/data/620/mc_pi50_eta05.root +Each of 25 job uses 2K out of total 50K input. + +In 1-1.5 hour (in the submission directory, /Validation/CaloTowers/CaloScan +in this case) the results of 25 batch jobs will be arriving. +Once all 25 jobs finished and 25 *.root files appeared locally, + +(10) cmsRun merging_cfg.py +(to produce final DQMxxx.root file) + +(11) clean up the directory +rm -r pi50_*.py *.log LSFJOB_* pi50_*.root + +(12) move this DQMxxx.root to Validation/CaloTowers/test/macros +renaming it into something like here: + +pi50scan760pre4_postLS1_fullGeom_ECALHCAL_CaloTowers.root + +NB: there is naming convention pi50scan<...>_ECALHCAL_CaloTowers.root +where <...> can be any meaningful string (to appear in the legend of histos) + +(13) to compare two sets of histos, for instance if you have in +Validation/CaloTowers/test/macros +pi50scan760pre4_postLS1_ECALHCAL_CaloTowers.root and +pi50scan760pre3_postLS1_ECALHCAL_CaloTowers.root + +(here "760pre4_postLS1" and "760pre3_postLS1" are mentioned <...> strings) - + +./RunPions.csh 760pre4_postLS1 760pre3_postLS1 + + +(14) the result appear as the local directory +760pre4_postLS1_vs_760pre3_postLS1_SinglePi + +which can be +(i) viewed with web browser locally, e.g. +firefox 760pre4_postLS1_vs_760pre3_postLS1_SinglePi/index.html + +(ii) uploaded to some web server and viewed from anywhere: + +https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HCAL/calo_scan_single_pi/760pre4_postLS1_vs_760pre3_postLS1_SinglePi/ + +(in this case, the results from the two releases are just identical) +NB: hitso labels correspond to aforementioned <...> strings, here 760pre4_postLS1/760pre3_postLS1 diff --git a/Validation/CaloTowers/test/CaloScan/batch.csh b/Validation/CaloTowers/test/CaloScan/batch.csh new file mode 100755 index 0000000000000..32d2e8fc6c708 --- /dev/null +++ b/Validation/CaloTowers/test/CaloScan/batch.csh @@ -0,0 +1,23 @@ +#!/bin/csh +setenv num ${1} + +echo '===> num.' $num + +setenv name pi50 + +setenv MYWORKDIR $LS_SUBCWD + +setenv MYOUT ${MYWORKDIR} +#---------------- +cd ${MYWORKDIR} +eval `scramv1 runtime -csh` +cp ${MYWORKDIR}/${name}_${num}.py ${WORKDIR}/conf.py +# +cd ${WORKDIR} +cp /afs/cern.ch/cms/data/CMSSW/Validation/HcalHits/data/620/mc_pi50_eta05.root mc.root +echo ${WORKDIR} + +cmsRun conf.py > & ${name}_${num}.log +#--------------------------------------------------------------- + rfcp ${name}_${num}.log ${MYWORKDIR}/. + rfcp output.root ${MYOUT}/${name}_${num}.root diff --git a/Validation/CaloTowers/test/CaloScan/make_configs.csh b/Validation/CaloTowers/test/CaloScan/make_configs.csh new file mode 100755 index 0000000000000..586b1b33289a3 --- /dev/null +++ b/Validation/CaloTowers/test/CaloScan/make_configs.csh @@ -0,0 +1,23 @@ +#!/bin/csh +set template=template.py +set head=pi50 + +#--- service variables +set chunk = 2000 +set j = 1 +set one = 1 + + +set i=1 +while ( ${i} < 26) + +if( ${i} < 26 ) then + echo "i :" ${i} + @ j = ${i} - $one + @ j = $j * $chunk + $one + echo "j :" ${j} + cat ${template} | sed s/XXXXX/${j}/ > ${head}_${i}.py +endif + +@ i = ${i} + "1" +end diff --git a/Validation/CaloTowers/test/CaloScan/merging_cfg.py b/Validation/CaloTowers/test/CaloScan/merging_cfg.py new file mode 100644 index 0000000000000..77394a19da839 --- /dev/null +++ b/Validation/CaloTowers/test/CaloScan/merging_cfg.py @@ -0,0 +1,75 @@ +import os +import FWCore.ParameterSet.Config as cms + +process = cms.Process("CONV") + +process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.MessageLogger.cerr.FwkReport.reportEvery = 1000 + +process.load("DQMServices.Core.DQMStore_cfi") +process.load("DQMServices.Components.MEtoEDMConverter_cfi") + +#process.load("DQMServices.Core.DQM_cfg") +#process.DQM.collectorHost = '' + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + 'file:pi50_1.root', + 'file:pi50_2.root', + 'file:pi50_3.root', + 'file:pi50_4.root', + 'file:pi50_5.root', + 'file:pi50_6.root', + 'file:pi50_7.root', + 'file:pi50_8.root', + 'file:pi50_9.root', + 'file:pi50_10.root', + 'file:pi50_11.root', + 'file:pi50_12.root', + 'file:pi50_13.root', + 'file:pi50_14.root', + 'file:pi50_15.root', + 'file:pi50_16.root', + 'file:pi50_17.root', + 'file:pi50_18.root', + 'file:pi50_19.root', + 'file:pi50_20.root', + 'file:pi50_21.root', + 'file:pi50_22.root', + 'file:pi50_23.root', + 'file:pi50_24.root', + 'file:pi50_25.root' + ) +) + +process.load('Configuration/StandardSequences/EDMtoMEAtRunEnd_cff') +process.dqmSaver.referenceHandling = cms.untracked.string('all') + +cmssw_version = os.environ.get('CMSSW_VERSION','CMSSW_X_Y_Z') +Workflow = '/HcalValidation/'+'Harvesting/'+str(cmssw_version) +process.dqmSaver.workflow = Workflow + +process.hcaldigisClient = cms.EDAnalyzer("HcalDigisClient", + outputFile = cms.untracked.string('HcalDigisHarvestingME.root'), + DQMDirName = cms.string("/") # root directory +) + +process.calotowersClient = cms.EDAnalyzer("CaloTowersClient", + outputFile = cms.untracked.string('CaloTowersHarvestingME.root'), + DQMDirName = cms.string("/") # root directory +) +process.hcalrechitsClient = cms.EDAnalyzer("HcalRecHitsClient", + outputFile = cms.untracked.string('HcalRecHitsHarvestingME.root'), + DQMDirName = cms.string("/") # root directory +) + +process.p = cms.Path( +process.EDMtoME * +process.calotowersClient * +process.hcalrechitsClient * +process.hcaldigisClient * +process.dqmSaver) diff --git a/Validation/CaloTowers/test/CaloScan/submit_batch.csh b/Validation/CaloTowers/test/CaloScan/submit_batch.csh new file mode 100755 index 0000000000000..03f96890fb81b --- /dev/null +++ b/Validation/CaloTowers/test/CaloScan/submit_batch.csh @@ -0,0 +1,7 @@ +#!/bin/csh +set i=1 + +while ( ${i} < 26 ) +bsub -u /dev/null -q 1nd batch.csh ${i} +@ i = ${i} + "1" +end diff --git a/Validation/CaloTowers/test/CaloScan/template.py b/Validation/CaloTowers/test/CaloScan/template.py new file mode 100644 index 0000000000000..1487aa4b8dee9 --- /dev/null +++ b/Validation/CaloTowers/test/CaloScan/template.py @@ -0,0 +1,117 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") + +### RANDOM setting (change last digit(s) to make runs different !) +process.load("Configuration.StandardSequences.SimulationRandomNumberGeneratorSeeds_cff") + +process.load("Configuration.StandardSequences.Simulation_cff") +process.load("Configuration.StandardSequences.Reconstruction_cff") +process.load("SimGeneral.MixingModule.mixNoPU_cfi") +process.load('Configuration/StandardSequences/DigiToRaw_cff') +process.load('Configuration/StandardSequences/RawToDigi_cff') + +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag = autoCond['run2_mc'] + +process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") +process.load("Configuration.StandardSequences.GeometryDB_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") +process.g4SimHits.UseMagneticField = False + +process.load("DQMServices.Core.DQMStore_cfi") +process.load("DQMServices.Components.MEtoEDMConverter_cfi") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(2000) +) +# Input source +process.source = cms.Source("PoolSource", + firstEvent = cms.untracked.uint32(XXXXX), + fileNames = cms.untracked.vstring('file:mc.root') +) + +process.FEVT = cms.OutputModule("PoolOutputModule", + outputCommands = cms.untracked.vstring('drop *', 'keep *_MEtoEDMConverter_*_*'), + splitLevel = cms.untracked.int32(0), + fileName = cms.untracked.string("output.root") +) + +process.VtxSmeared.SigmaX = 0.00001 +process.VtxSmeared.SigmaY = 0.00001 +process.VtxSmeared.SigmaZ = 0.00001 + +process.HcalSimHitsAnalyser = cms.EDAnalyzer("HcalSimHitsValidation", + outputFile = cms.untracked.string('HcalSimHitsValidation.root') +) + +process.hcalDigiAnalyzer = cms.EDAnalyzer("HcalDigisValidation", + outputFile = cms.untracked.string('HcalDigisValidationRelVal.root'), + digiLabel = cms.InputTag("hcalDigis"), + zside = cms.untracked.string('*'), + mode = cms.untracked.string('multi'), + + hcalselector = cms.untracked.string('all'), + mc = cms.untracked.string('yes') # 'yes' for MC +) + +process.hcalRecoAnalyzer = cms.EDAnalyzer("HcalRecHitsValidation", + outputFile = cms.untracked.string('HcalRecHitValidationRelVal.root'), + HBHERecHitCollectionLabel = cms.untracked.InputTag("hbhereco"), + HFRecHitCollectionLabel = cms.untracked.InputTag("hfreco"), + HORecHitCollectionLabel = cms.untracked.InputTag("horeco"), + eventype = cms.untracked.string('single'), + ecalselector = cms.untracked.string('yes'), + hcalselector = cms.untracked.string('all'), + mc = cms.untracked.string('yes') # default ! +) + +process.hcalTowerAnalyzer = cms.EDAnalyzer("CaloTowersValidation", + outputFile = cms.untracked.string('CaloTowersValidationRelVal.root'), + CaloTowerCollectionLabel = cms.untracked.InputTag('towerMaker'), + hcalselector = cms.untracked.string('all'), + mc = cms.untracked.string('yes') # default! +) + +#--- replace hbhereco with hbheprereco +delattr(process,"hbhereco") +process.hbhereco = process.hbheprereco.clone() +process.hcalLocalRecoSequence = cms.Sequence(process.hbhereco+process.hfreco+process.horeco) + + +#--- post-LS1 customization +process.mix.digitizers.hcal.ho.photoelectronsToAnalog = cms.vdouble([4.0]*16) +process.mix.digitizers.hcal.ho.siPMCode = cms.int32(1) +process.mix.digitizers.hcal.ho.pixels = cms.int32(2500) +process.mix.digitizers.hcal.ho.doSiPMSmearing = cms.bool(False) +process.mix.digitizers.hcal.hf1.samplingFactor = cms.double(0.60) +process.mix.digitizers.hcal.hf2.samplingFactor = cms.double(0.60) +process.g4SimHits.HFShowerLibrary.FileName = 'SimG4CMS/Calo/data/HFShowerLibrary_npmt_noatt_eta4_16en_v3.root' + + +#---------- PATH +process.g4SimHits.Generator.HepMCProductLabel = 'generator' +process.p = cms.Path( + process.VtxSmeared * process.g4SimHits * process.mix * + process.ecalDigiSequence * process.hcalDigiSequence * + process.addPileupInfo * + process.ecalPacker * + process.esDigiToRaw * + process.hcalRawData * + process.rawDataCollector * + process.ecalDigis * + process.ecalPreshowerDigis * + process.hcalDigis * + process.calolocalreco * + process.caloTowersRec * + process.hcalnoise * + process.HcalSimHitsAnalyser * + process.hcalDigiAnalyzer * + process.hcalTowerAnalyzer * + process.hcalRecoAnalyzer * + process.MEtoEDMConverter +) + +process.outpath = cms.EndPath(process.FEVT) + diff --git a/Validation/HcalDigis/src/HcalDigisValidation.cc b/Validation/HcalDigis/src/HcalDigisValidation.cc index 6557e4fb5a4bf..105797bc515c2 100644 --- a/Validation/HcalDigis/src/HcalDigisValidation.cc +++ b/Validation/HcalDigis/src/HcalDigisValidation.cc @@ -465,7 +465,7 @@ void HcalDigisValidation::analyze(const edm::Event& iEvent, const edm::EventSetu ESHandle decoder; iSetup.get().get(decoder); - iSetup.get().get(htopo); + iSetup.get().get(htopo); //Get all handles edm::Handle emulTPs; diff --git a/Validation/HcalHits/src/SimG4HcalValidation.cc b/Validation/HcalHits/src/SimG4HcalValidation.cc index 0d1436ea3ebab..10be39868e4c8 100644 --- a/Validation/HcalHits/src/SimG4HcalValidation.cc +++ b/Validation/HcalHits/src/SimG4HcalValidation.cc @@ -18,11 +18,11 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESTransientHandle.h" +#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "DetectorDescription/Core/interface/DDCompactView.h" +#include "Geometry/Records/interface/HcalSimNumberingRecord.h" +#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "G4SDManager.hh" #include "G4Step.hh" @@ -153,11 +153,12 @@ void SimG4HcalValidation::init() { void SimG4HcalValidation::update(const BeginOfJob * job) { // Numbering From DDD - edm::ESTransientHandle pDD; - (*job)()->get().get(pDD); + edm::ESHandle hdc; + (*job)()->get().get(hdc); + HcalDDDSimConstants *hcons = (HcalDDDSimConstants*)(&(*hdc)); edm::LogInfo("ValidHcal") << "HcalTestAnalysis:: Initialise " - << "HcalNumberingFromDDD for " << names[0]; - numberingFromDDD = new HcalNumberingFromDDD(names[0], (*pDD)); + << "HcalNumberingFromDDD"; + numberingFromDDD = new HcalNumberingFromDDD(hcons); // Numbering scheme org = new HcalTestNumberingScheme(false);