From 023deee726d4fae5d7aa73fdb30f077eb00a2286 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 20 Oct 2020 10:40:31 +0200 Subject: [PATCH] delete unused headers --- .../interface/OrderedLaserHitPair.h | 35 - .../interface/OrderedLaserHitPairs.h | 27 - .../LaserAlignment/interface/SeedLayerPairs.h | 28 - .../interface/MuonInfoTuple.h | 83 - .../EcalLaserAnalyzer/interface/TMCORLin.h | 40 - .../EcalLaserAnalyzer/interface/TMCORSat.h | 36 - .../EcalLaserAnalyzer/interface/TMCReader.h | 71 - .../EcalLaserAnalyzer/interface/TMConfig.h | 108 - .../EcalLaserAnalyzer/interface/TMEGeom.h | 64 - .../interface/TPEDestalAnalysis.h | 52 - .../HcalAlgos/interface/DoublePadeDelay.h | 168 - .../HcalAlgos/interface/equalADCSignalTime.h | 16 - .../SiPixelObjects/interface/PixelAliasList.h | 279 -- .../SiPixelObjects/interface/PixelConfig.h | 72 - .../interface/PixelConfigAlias.h | 51 - .../interface/PixelConfigFile.h | 843 ----- .../interface/PixelConfigList.h | 132 - .../interface/PixelMaskOverride.h | 39 - .../interface/PixelTrimOverride.h | 36 - .../interface/PixelVersionAlias.h | 27 - .../interface/CSCFakeCrosstalkMap.h | 27 - .../interface/CSCFakeDBCrosstalkPopCon.h | 41 - .../interface/CSCFakeDBGainsPopCon.h | 41 - .../interface/CaloSimInfoExtra.h | 79 - .../interface/eECALMatrixExtra.h | 57 - .../interface/TrackDetMatchInfoCollection.h | 9 - Calibration/Tools/interface/smartSelector.h | 52 - .../CandAlgos/interface/CloneProducer.h | 59 - CommonTools/CandUtils/interface/CandMatcher.h | 239 -- .../CandUtils/interface/FastCandMatcher.h | 103 - .../CandUtils/interface/NamedCandCombiner.h | 150 - .../ParticleFlow/interface/ObjectSelector.h | 43 - .../ParticleFlow/interface/ObjectSelectors.h | 17 - .../interface/BinomialProbability.h | 49 - .../UtilAlgos/interface/DummyMatchSelector.h | 26 - .../UtilAlgos/interface/MassMinSelector.h | 21 - .../UtilAlgos/interface/MassRangeSelector.h | 22 - CommonTools/UtilAlgos/interface/MinSelector.h | 20 - .../UtilAlgos/interface/ObjectPairFilter.h | 60 - .../interface/ObjectRefVectorSelector.h | 23 - .../UtilAlgos/interface/OrPairSelector.h | 21 - CommonTools/Utils/interface/Angle.h | 23 - CommonTools/Utils/interface/InvariantMass.h | 12 - CommonTools/Utils/interface/LazyResult.h | 76 - CommonTools/Utils/interface/MassMinSelector.h | 22 - .../Utils/interface/MassRangeSelector.h | 23 - CommonTools/Utils/interface/MinSelector.h | 19 - CommonTools/Utils/interface/OrPairSelector.h | 22 - .../interface/DTCompactMapPluginHandler.h | 1 - .../interface/DTConfigPluginHandler.h | 1 - .../CastorObjects/interface/AllClasses.h | 16 - CondFormats/Common/interface/Constants.h | 16 - .../interface/SiStripBadChannelRcd.h | 1 - .../DataRecord/interface/SiStripBadFiberRcd.h | 1 - .../interface/SiStripBadModuleRcd.h | 1 - .../DataRecord/interface/SiStripModuleHVRcd.h | 1 - .../interface/SiStripPerformanceSummaryRcd.h | 1 - .../interface/SiStripRunSummaryRcd.h | 1 - .../HcalObjects/interface/HcalItemArrayColl.h | 101 - .../interface/HcalItemArrayCollById.h | 161 - .../eos/polymorphic_portable_archive.hpp | 35 - .../interface/eos/portable_archive.hpp | 35 - .../interface/MapPathTodetUnit.h | 0 .../EcalIntercalibConstantsHandler.h | 17 - .../EcalIntercalibConstantsMCHandler.h | 18 - .../interface/EcalIntercalibErrorsHandler.h | 23 - .../EcalIntercalibErrorsXMLTranslator.h | 17 - .../EcalPFRecHitThresholdsXMLTranslator.h | 17 - .../interface/EcalTimeCalibConstantsHandler.h | 18 - .../EcalTimeCalibConstantsXMLTranslator.h | 19 - .../interface/EcalTimeCalibErrorsHandler.h | 18 - .../EcalTimeCalibErrorsXMLTranslator.h | 19 - CondTools/Ecal/test/testXMLTranslators.cc | 472 --- CondTools/L1Trigger/interface/Interval.h | 104 - .../RPC/interface/L1RPCHwConfigDBWriter.h | 18 - CondTools/RPC/interface/RPCEMapDBWriter.h | 18 - .../interface/SiStripCondObjBuilderBase.h | 30 - .../interface/SiStripDepCondObjBuilderBase.h | 30 - .../BTauReco/interface/PFCombinedTauTagInfo.h | 192 -- .../BTauReco/interface/PFIsolatedTauTagInfo.h | 147 - DataFormats/BTauReco/interface/TrackIPData.h | 23 - DataFormats/Common/interface/NewPolicy.h | 13 - DataFormats/Common/interface/OwnArray.h | 506 --- .../Common/interface/TransientDataFrame.h | 51 - .../Common/interface/debugging_allocator.h | 80 - DataFormats/Common/test/OwnArray_t.cpp | 188 -- DataFormats/Common/test/testOwnArray.cc | 139 - .../interface/private/extTkRotation.h | 366 --- .../interface/private/newTkRotation.h | 366 --- .../interface/private/oldTkRotation.h | 370 --- .../GeometryVector/interface/OnePiRange.h | 133 - .../interface/private/extBasic2DVector.h | 264 -- .../interface/private/oldBasic2DVector.h | 241 -- .../interface/private/oldBasic3DVector.h | 352 --- .../interface/PFClusterMETCollection.h | 23 - DataFormats/Math/interface/SSEArray.h | 111 - DataFormats/Math/interface/private/AVXVec.h | 187 -- .../interface/PFBlockElementFwd.h | 15 - .../interface/PFBlockElementSuperClusterFwd.h | 11 - .../interface/PFClusterShapeAssociation.h | 31 - .../interface/PFParticleFwd.h | 27 - .../interface/PFSuperClusterFwd.h | 27 - .../interface/PFTrajectoryPointFwd.h | 27 - .../interface/BranchDescriptionIndex.h | 31 - .../Provenance/interface/TypeInBranchType.h | 62 - .../RPCDigi/interface/RPCDigiL1Linkfwd.h | 4 - .../interface/PixelDigiCollectionfwd.h | 4 - .../interface/SiStripClusterfwd.h | 4 - .../interface/ConstantsForSummaryPlots.h | 10 - .../SiStripDigi/interface/SiStripDigifwd.h | 4 - .../interface/SiPixelRecHitfwd.h | 4 - .../interface/BasicTrajectorySeed.h | 9 - .../WENu/interface/GenPurposeSkimmer.h | 199 -- .../interface/GenPurposeSkimmerAcceptance.h | 221 -- .../ZEE/interface/AnalysisErsatz.h | 139 - ElectroWeakAnalysis/ZMuMu/bin/csa08IsoBkg.cpp | 288 -- ElectroWeakAnalysis/ZMuMu/bin/csa08ZFit.cpp | 384 --- ElectroWeakAnalysis/ZMuMu/bin/zMassFit.cpp | 1040 ------- ElectroWeakAnalysis/ZMuMu/bin/zMassHSFit.cpp | 353 --- ElectroWeakAnalysis/ZMuMu/bin/zMassMCFit.cpp | 355 --- ElectroWeakAnalysis/ZMuMu/bin/zMassResFit.cpp | 280 -- ElectroWeakAnalysis/ZMuMu/bin/zMuMuExpFit.cpp | 259 -- ElectroWeakAnalysis/ZMuMu/bin/zMuMuFit.cpp | 283 -- .../ZMuMu/bin/zToMuMuMassMCFit.cpp | 438 --- .../DTRawToDigi/interface/DTROS25Data.h | 61 - .../ESRawToDigi/interface/ESCrcKchipFast.h | 50 - .../interface/ECALUnpackerException.h | 32 - .../EcalRawToDigi/interface/MyWatcher.h | 43 - .../RPCRawToDigi/interface/RPCRawSynchro.h | 1 - EventFilter/Utilities/interface/ModuleWeb.h | 51 - EventFilter/Utilities/interface/config_json.h | 43 - .../interface/TypeInfoHolder.h | 45 - .../TauolaInterface/interface/TauolaWrapper.h | 105 - .../interface/BPHMuonChargeSelect.h | 54 - .../interface/BPHParticleChargeSelect.h | 73 - IOPool/Common/interface/CustomStreamer.h | 58 - .../interface/BoxNDScanner.h | 172 - .../interface/MultivariateFunctorScanner.h | 77 - .../interface/rescanArray.h | 122 - .../interface/CorrectedMETProducerT.h | 110 - .../DTSectorCollector/interface/DTSCCand.h | 123 - .../interface/L1GctSimpleJetFinder.h | 54 - L1Trigger/L1TCalorimeter/interface/classes.h | 19 - .../interface/OMTFConfigurator.h | 25 - .../interface/OMTFPatternMaker.h | 32 - .../interface/L1AnalysisRecoTrackBase.h | 17 - .../L1Analyzer/interface/L1PromptAnalysis.h | 288 -- .../Engine/interface/MagneticFieldHelpers.h | 42 - .../interface/RectangularVolumeBounds.h | 8 - Mixing/Base/interface/FixedPUGenerator.h | 25 - Mixing/Base/interface/PUGenerator.h | 22 - OnlineDB/CSCCondDB/interface/AutoCorrMat.h | 112 - .../CSCCondDB/interface/CSCCableReadTest.h | 27 - OnlineDB/CSCCondDB/interface/CSCxTalk.h | 162 - OnlineDB/CSCCondDB/interface/SaturationFcn.h | 65 - OnlineDB/CSCCondDB/interface/SaturationFit.h | 57 - OnlineDB/EcalCondDB/interface/IConfig.h | 14 - OnlineDB/EcalCondDB/interface/IRunIOV.h | 23 - OnlineDB/EcalCondDB/interface/ITimeIOV.h | 21 - .../EcalCondDB/interface/all_cali_types.h | 7 - OnlineDB/EcalCondDB/interface/all_dcu_types.h | 11 - OnlineDB/EcalCondDB/interface/all_mod_types.h | 21 - .../EcalCondDB/test/InsertDCUIdarkPed.cpp | 354 --- OnlineDB/EcalCondDB/test/TestChannelView.cpp | 125 - OnlineDB/EcalCondDB/test/TestDCU.cpp | 315 -- OnlineDB/EcalCondDB/test/TestMOD.cpp | 265 -- PhysicsTools/FWLite/interface/WSelectorFast.h | 87 - .../MVAComputer/interface/MVAModuleHelper.h | 160 - .../interface/WPlusJetsEventSelector.h | 2 - PhysicsTools/PatUtils/interface/JetSelector.h | 67 - .../PatUtils/interface/JetSelector.icc | 63 - .../PatUtils/interface/PatSelectorByFlags.h | 19 - PhysicsTools/PatUtils/interface/RefHelper.h | 130 - .../SelectorUtils/interface/Variables.h | 16 - .../UtilAlgos/interface/DummyMatchSelector.h | 26 - .../UtilAlgos/interface/EventSelector.h | 1 - .../UtilAlgos/interface/MCMatchSelector.h | 43 - .../UtilAlgos/interface/NtpProducer.h | 74 - .../interface/SelectedOutputCollectionTrait.h | 49 - .../UtilAlgos/interface/SelectionAdderTrait.h | 147 - .../UtilAlgos/interface/StoreContainerTrait.h | 39 - .../UtilAlgos/interface/TwoObjectCalculator.h | 16 - .../Utilities/interface/GammaPropagator.h | 16 - .../Utilities/interface/GammaZInterference.h | 30 - PhysicsTools/Utilities/interface/Number.h | 15 - PhysicsTools/Utilities/interface/ZLineShape.h | 29 - .../interface/PiZeroDiscriminatorProducer.h | 59 - .../EgammaTools/interface/ConversionTools.h | 1 - .../EgammaTools/interface/EffectiveAreas.h | 1 - RecoHI/HiJetAlgos/interface/UECalibration.h | 162 - RecoJets/JetAnalyzers/doc/myJetAna.html | 90 - .../interface/CaloTowerBoundries.h | 139 - RecoJets/JetAnalyzers/interface/MyCluster.h | 68 - RecoJets/JetAnalyzers/interface/myFilter.h | 64 - RecoJets/JetAnalyzers/interface/myJetAna.h | 487 --- RecoJets/JetAnalyzers/test/myFilter.cc | 1024 ------ RecoJets/JetAnalyzers/test/myJetAna.cc | 2767 ----------------- .../EcalUncalibRecHitLeadingEdgeAlgo.h | 71 - .../interface/MuonSeedDetLayer.h | 72 - .../interface/EtaPhiMeasurementEstimator.h | 1 - .../interface/rangesIntersect.h | 25 - .../interface/GsfTrackProducerAlgorithm.h | 71 - .../interface/GSTransientTrackingRecHit.h | 8 - .../interface/ReconstructorFromLinPtFinder.h | 26 - .../interface/CombinedKinematicConstraintT.h | 218 -- .../MonteCarloLinearizationPointFinder.h | 33 - .../src/MonteCarloLinearizationPointFinder.cc | 28 - .../CaloSimAlgos/interface/CaloVNoisifier.h | 19 - .../interface/RPCDigiSimLinkfwd.h | 4 - .../interface/PixelDigiSimLinkfwd.h | 4 - .../interface/StripCompactDigiSimLinksfwd.h | 4 - .../interface/StripDigiSimLinkfwd.h | 4 - SimG4CMS/Calo/interface/HcalTestHistoClass.h | 1 - .../Application/interface/DDDWorldObserver.h | 21 - .../Notification/interface/ComponentBuilder.h | 14 - .../interface/ComponentFactoryByName.h | 42 - .../interface/DispatchableG4Step.h | 8 - SimG4Core/Notification/interface/OwnIt.h | 23 - .../TopTools/interface/TopologyWorker.h | 1718 ---------- .../interface/CurvilinearJacobian.h | 25 - .../GsfTools/interface/GaussianSumUtilities.h | 154 - .../interface/GaussianSumUtilities.icc | 573 ---- .../PatternTools/interface/MediumProperties.h | 7 - TrackingTools/Records/interface/Records.h | 4 - 224 files changed, 25434 deletions(-) delete mode 100644 Alignment/LaserAlignment/interface/OrderedLaserHitPair.h delete mode 100644 Alignment/LaserAlignment/interface/OrderedLaserHitPairs.h delete mode 100644 Alignment/LaserAlignment/interface/SeedLayerPairs.h delete mode 100644 Alignment/MuonAlignmentAlgorithms/interface/MuonInfoTuple.h delete mode 100644 CalibCalorimetry/EcalLaserAnalyzer/interface/TMCORLin.h delete mode 100644 CalibCalorimetry/EcalLaserAnalyzer/interface/TMCORSat.h delete mode 100644 CalibCalorimetry/EcalLaserAnalyzer/interface/TMCReader.h delete mode 100644 CalibCalorimetry/EcalLaserAnalyzer/interface/TMConfig.h delete mode 100644 CalibCalorimetry/EcalLaserAnalyzer/interface/TMEGeom.h delete mode 100644 CalibCalorimetry/EcalLaserAnalyzer/interface/TPEDestalAnalysis.h delete mode 100644 CalibCalorimetry/HcalAlgos/interface/DoublePadeDelay.h delete mode 100644 CalibCalorimetry/HcalAlgos/interface/equalADCSignalTime.h delete mode 100644 CalibFormats/SiPixelObjects/interface/PixelAliasList.h delete mode 100644 CalibFormats/SiPixelObjects/interface/PixelConfig.h delete mode 100644 CalibFormats/SiPixelObjects/interface/PixelConfigAlias.h delete mode 100644 CalibFormats/SiPixelObjects/interface/PixelConfigFile.h delete mode 100644 CalibFormats/SiPixelObjects/interface/PixelConfigList.h delete mode 100644 CalibFormats/SiPixelObjects/interface/PixelMaskOverride.h delete mode 100644 CalibFormats/SiPixelObjects/interface/PixelTrimOverride.h delete mode 100644 CalibFormats/SiPixelObjects/interface/PixelVersionAlias.h delete mode 100644 CalibMuon/CSCCalibration/interface/CSCFakeCrosstalkMap.h delete mode 100644 CalibMuon/CSCCalibration/interface/CSCFakeDBCrosstalkPopCon.h delete mode 100644 CalibMuon/CSCCalibration/interface/CSCFakeDBGainsPopCon.h delete mode 100644 Calibration/IsolatedParticles/interface/CaloSimInfoExtra.h delete mode 100644 Calibration/IsolatedParticles/interface/eECALMatrixExtra.h delete mode 100644 Calibration/Tools/interface/TrackDetMatchInfoCollection.h delete mode 100644 Calibration/Tools/interface/smartSelector.h delete mode 100644 CommonTools/CandAlgos/interface/CloneProducer.h delete mode 100755 CommonTools/CandUtils/interface/CandMatcher.h delete mode 100755 CommonTools/CandUtils/interface/FastCandMatcher.h delete mode 100755 CommonTools/CandUtils/interface/NamedCandCombiner.h delete mode 100644 CommonTools/ParticleFlow/interface/ObjectSelector.h delete mode 100644 CommonTools/ParticleFlow/interface/ObjectSelectors.h delete mode 100644 CommonTools/Statistics/interface/BinomialProbability.h delete mode 100644 CommonTools/UtilAlgos/interface/DummyMatchSelector.h delete mode 100755 CommonTools/UtilAlgos/interface/MassMinSelector.h delete mode 100755 CommonTools/UtilAlgos/interface/MassRangeSelector.h delete mode 100755 CommonTools/UtilAlgos/interface/MinSelector.h delete mode 100755 CommonTools/UtilAlgos/interface/ObjectPairFilter.h delete mode 100755 CommonTools/UtilAlgos/interface/ObjectRefVectorSelector.h delete mode 100755 CommonTools/UtilAlgos/interface/OrPairSelector.h delete mode 100644 CommonTools/Utils/interface/Angle.h delete mode 100755 CommonTools/Utils/interface/InvariantMass.h delete mode 100644 CommonTools/Utils/interface/LazyResult.h delete mode 100755 CommonTools/Utils/interface/MassMinSelector.h delete mode 100755 CommonTools/Utils/interface/MassRangeSelector.h delete mode 100755 CommonTools/Utils/interface/MinSelector.h delete mode 100755 CommonTools/Utils/interface/OrPairSelector.h delete mode 100644 CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h delete mode 100644 CondCore/DTPlugins/interface/DTConfigPluginHandler.h delete mode 100644 CondFormats/CastorObjects/interface/AllClasses.h delete mode 100644 CondFormats/Common/interface/Constants.h delete mode 100644 CondFormats/DataRecord/interface/SiStripBadChannelRcd.h delete mode 100644 CondFormats/DataRecord/interface/SiStripBadFiberRcd.h delete mode 100644 CondFormats/DataRecord/interface/SiStripBadModuleRcd.h delete mode 100644 CondFormats/DataRecord/interface/SiStripModuleHVRcd.h delete mode 100644 CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h delete mode 100644 CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h delete mode 100644 CondFormats/HcalObjects/interface/HcalItemArrayColl.h delete mode 100644 CondFormats/HcalObjects/interface/HcalItemArrayCollById.h delete mode 100644 CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp delete mode 100644 CondFormats/Serialization/interface/eos/portable_archive.hpp delete mode 100644 CondFormats/SiPixelObjects/interface/MapPathTodetUnit.h delete mode 100644 CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h delete mode 100644 CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h delete mode 100644 CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h delete mode 100644 CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h delete mode 100644 CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h delete mode 100644 CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h delete mode 100644 CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h delete mode 100644 CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h delete mode 100644 CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h delete mode 100644 CondTools/Ecal/test/testXMLTranslators.cc delete mode 100644 CondTools/L1Trigger/interface/Interval.h delete mode 100644 CondTools/RPC/interface/L1RPCHwConfigDBWriter.h delete mode 100644 CondTools/RPC/interface/RPCEMapDBWriter.h delete mode 100644 CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h delete mode 100644 CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h delete mode 100644 DataFormats/BTauReco/interface/PFCombinedTauTagInfo.h delete mode 100644 DataFormats/BTauReco/interface/PFIsolatedTauTagInfo.h delete mode 100644 DataFormats/BTauReco/interface/TrackIPData.h delete mode 100644 DataFormats/Common/interface/NewPolicy.h delete mode 100644 DataFormats/Common/interface/OwnArray.h delete mode 100644 DataFormats/Common/interface/TransientDataFrame.h delete mode 100644 DataFormats/Common/interface/debugging_allocator.h delete mode 100644 DataFormats/Common/test/OwnArray_t.cpp delete mode 100644 DataFormats/Common/test/testOwnArray.cc delete mode 100644 DataFormats/GeometrySurface/interface/private/extTkRotation.h delete mode 100644 DataFormats/GeometrySurface/interface/private/newTkRotation.h delete mode 100644 DataFormats/GeometrySurface/interface/private/oldTkRotation.h delete mode 100644 DataFormats/GeometryVector/interface/OnePiRange.h delete mode 100644 DataFormats/GeometryVector/interface/private/extBasic2DVector.h delete mode 100644 DataFormats/GeometryVector/interface/private/oldBasic2DVector.h delete mode 100644 DataFormats/GeometryVector/interface/private/oldBasic3DVector.h delete mode 100644 DataFormats/METReco/interface/PFClusterMETCollection.h delete mode 100644 DataFormats/Math/interface/SSEArray.h delete mode 100644 DataFormats/Math/interface/private/AVXVec.h delete mode 100644 DataFormats/ParticleFlowReco/interface/PFBlockElementFwd.h delete mode 100644 DataFormats/ParticleFlowReco/interface/PFBlockElementSuperClusterFwd.h delete mode 100644 DataFormats/ParticleFlowReco/interface/PFClusterShapeAssociation.h delete mode 100644 DataFormats/ParticleFlowReco/interface/PFParticleFwd.h delete mode 100644 DataFormats/ParticleFlowReco/interface/PFSuperClusterFwd.h delete mode 100644 DataFormats/ParticleFlowReco/interface/PFTrajectoryPointFwd.h delete mode 100644 DataFormats/Provenance/interface/BranchDescriptionIndex.h delete mode 100644 DataFormats/Provenance/interface/TypeInBranchType.h delete mode 100644 DataFormats/RPCDigi/interface/RPCDigiL1Linkfwd.h delete mode 100644 DataFormats/SiPixelDigi/interface/PixelDigiCollectionfwd.h delete mode 100644 DataFormats/SiStripCluster/interface/SiStripClusterfwd.h delete mode 100644 DataFormats/SiStripCommon/interface/ConstantsForSummaryPlots.h delete mode 100644 DataFormats/SiStripDigi/interface/SiStripDigifwd.h delete mode 100644 DataFormats/TrackerRecHit2D/interface/SiPixelRecHitfwd.h delete mode 100644 DataFormats/TrajectorySeed/interface/BasicTrajectorySeed.h delete mode 100644 ElectroWeakAnalysis/WENu/interface/GenPurposeSkimmer.h delete mode 100644 ElectroWeakAnalysis/WENu/interface/GenPurposeSkimmerAcceptance.h delete mode 100644 ElectroWeakAnalysis/ZEE/interface/AnalysisErsatz.h delete mode 100644 ElectroWeakAnalysis/ZMuMu/bin/csa08IsoBkg.cpp delete mode 100644 ElectroWeakAnalysis/ZMuMu/bin/csa08ZFit.cpp delete mode 100644 ElectroWeakAnalysis/ZMuMu/bin/zMassFit.cpp delete mode 100644 ElectroWeakAnalysis/ZMuMu/bin/zMassHSFit.cpp delete mode 100644 ElectroWeakAnalysis/ZMuMu/bin/zMassMCFit.cpp delete mode 100644 ElectroWeakAnalysis/ZMuMu/bin/zMassResFit.cpp delete mode 100755 ElectroWeakAnalysis/ZMuMu/bin/zMuMuExpFit.cpp delete mode 100644 ElectroWeakAnalysis/ZMuMu/bin/zMuMuFit.cpp delete mode 100644 ElectroWeakAnalysis/ZMuMu/bin/zToMuMuMassMCFit.cpp delete mode 100644 EventFilter/DTRawToDigi/interface/DTROS25Data.h delete mode 100644 EventFilter/ESRawToDigi/interface/ESCrcKchipFast.h delete mode 100644 EventFilter/EcalRawToDigi/interface/ECALUnpackerException.h delete mode 100644 EventFilter/EcalRawToDigi/interface/MyWatcher.h delete mode 100644 EventFilter/RPCRawToDigi/interface/RPCRawSynchro.h delete mode 100644 EventFilter/Utilities/interface/ModuleWeb.h delete mode 100644 EventFilter/Utilities/interface/config_json.h delete mode 100644 FWCore/ServiceRegistry/interface/TypeInfoHolder.h delete mode 100644 GeneratorInterface/TauolaInterface/interface/TauolaWrapper.h delete mode 100644 HeavyFlavorAnalysis/SpecificDecay/interface/BPHMuonChargeSelect.h delete mode 100644 HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleChargeSelect.h delete mode 100644 IOPool/Common/interface/CustomStreamer.h delete mode 100644 JetMETCorrections/InterpolationTables/interface/BoxNDScanner.h delete mode 100644 JetMETCorrections/InterpolationTables/interface/MultivariateFunctorScanner.h delete mode 100644 JetMETCorrections/InterpolationTables/interface/rescanArray.h delete mode 100644 JetMETCorrections/Type1MET/interface/CorrectedMETProducerT.h delete mode 100644 L1Trigger/DTSectorCollector/interface/DTSCCand.h delete mode 100644 L1Trigger/GlobalCaloTrigger/interface/L1GctSimpleJetFinder.h delete mode 100644 L1Trigger/L1TCalorimeter/interface/classes.h delete mode 100644 L1Trigger/L1TMuonOverlap/interface/OMTFConfigurator.h delete mode 100644 L1Trigger/L1TMuonOverlap/interface/OMTFPatternMaker.h delete mode 100644 L1Trigger/L1TNtuples/interface/L1AnalysisRecoTrackBase.h delete mode 100644 L1TriggerOffline/L1Analyzer/interface/L1PromptAnalysis.h delete mode 100644 MagneticField/Engine/interface/MagneticFieldHelpers.h delete mode 100644 MagneticField/VolumeGeometry/interface/RectangularVolumeBounds.h delete mode 100644 Mixing/Base/interface/FixedPUGenerator.h delete mode 100644 Mixing/Base/interface/PUGenerator.h delete mode 100644 OnlineDB/CSCCondDB/interface/AutoCorrMat.h delete mode 100644 OnlineDB/CSCCondDB/interface/CSCCableReadTest.h delete mode 100644 OnlineDB/CSCCondDB/interface/CSCxTalk.h delete mode 100644 OnlineDB/CSCCondDB/interface/SaturationFcn.h delete mode 100644 OnlineDB/CSCCondDB/interface/SaturationFit.h delete mode 100644 OnlineDB/EcalCondDB/interface/IConfig.h delete mode 100644 OnlineDB/EcalCondDB/interface/IRunIOV.h delete mode 100644 OnlineDB/EcalCondDB/interface/ITimeIOV.h delete mode 100644 OnlineDB/EcalCondDB/interface/all_cali_types.h delete mode 100644 OnlineDB/EcalCondDB/interface/all_dcu_types.h delete mode 100644 OnlineDB/EcalCondDB/interface/all_mod_types.h delete mode 100644 OnlineDB/EcalCondDB/test/InsertDCUIdarkPed.cpp delete mode 100644 OnlineDB/EcalCondDB/test/TestChannelView.cpp delete mode 100644 OnlineDB/EcalCondDB/test/TestDCU.cpp delete mode 100644 OnlineDB/EcalCondDB/test/TestMOD.cpp delete mode 100644 PhysicsTools/FWLite/interface/WSelectorFast.h delete mode 100644 PhysicsTools/MVAComputer/interface/MVAModuleHelper.h delete mode 100644 PhysicsTools/PatExamples/interface/WPlusJetsEventSelector.h delete mode 100644 PhysicsTools/PatUtils/interface/JetSelector.h delete mode 100644 PhysicsTools/PatUtils/interface/JetSelector.icc delete mode 100644 PhysicsTools/PatUtils/interface/PatSelectorByFlags.h delete mode 100644 PhysicsTools/PatUtils/interface/RefHelper.h delete mode 100644 PhysicsTools/SelectorUtils/interface/Variables.h delete mode 100644 PhysicsTools/UtilAlgos/interface/DummyMatchSelector.h delete mode 100644 PhysicsTools/UtilAlgos/interface/EventSelector.h delete mode 100644 PhysicsTools/UtilAlgos/interface/MCMatchSelector.h delete mode 100755 PhysicsTools/UtilAlgos/interface/NtpProducer.h delete mode 100755 PhysicsTools/UtilAlgos/interface/SelectedOutputCollectionTrait.h delete mode 100755 PhysicsTools/UtilAlgos/interface/SelectionAdderTrait.h delete mode 100755 PhysicsTools/UtilAlgos/interface/StoreContainerTrait.h delete mode 100644 PhysicsTools/UtilAlgos/interface/TwoObjectCalculator.h delete mode 100644 PhysicsTools/Utilities/interface/GammaPropagator.h delete mode 100644 PhysicsTools/Utilities/interface/GammaZInterference.h delete mode 100644 PhysicsTools/Utilities/interface/Number.h delete mode 100644 PhysicsTools/Utilities/interface/ZLineShape.h delete mode 100644 RecoEcal/EgammaClusterProducers/interface/PiZeroDiscriminatorProducer.h delete mode 100644 RecoEgamma/EgammaTools/interface/ConversionTools.h delete mode 100644 RecoEgamma/EgammaTools/interface/EffectiveAreas.h delete mode 100644 RecoHI/HiJetAlgos/interface/UECalibration.h delete mode 100644 RecoJets/JetAnalyzers/doc/myJetAna.html delete mode 100644 RecoJets/JetAnalyzers/interface/CaloTowerBoundries.h delete mode 100644 RecoJets/JetAnalyzers/interface/MyCluster.h delete mode 100644 RecoJets/JetAnalyzers/interface/myFilter.h delete mode 100755 RecoJets/JetAnalyzers/interface/myJetAna.h delete mode 100644 RecoJets/JetAnalyzers/test/myFilter.cc delete mode 100644 RecoJets/JetAnalyzers/test/myJetAna.cc delete mode 100644 RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitLeadingEdgeAlgo.h delete mode 100644 RecoMuon/TrackingTools/interface/MuonSeedDetLayer.h delete mode 100755 RecoTracker/SpecialSeedGenerators/interface/EtaPhiMeasurementEstimator.h delete mode 100644 RecoTracker/TkMSParametrization/interface/rangesIntersect.h delete mode 100644 RecoTracker/TrackProducer/interface/GsfTrackProducerAlgorithm.h delete mode 100644 RecoTracker/TransientTrackingRecHit/interface/GSTransientTrackingRecHit.h delete mode 100644 RecoVertex/ConfigurableVertexReco/interface/ReconstructorFromLinPtFinder.h delete mode 100644 RecoVertex/KinematicFit/interface/CombinedKinematicConstraintT.h delete mode 100644 RecoVertex/LinearizationPointFinders/interface/MonteCarloLinearizationPointFinder.h delete mode 100644 RecoVertex/LinearizationPointFinders/src/MonteCarloLinearizationPointFinder.cc delete mode 100644 SimCalorimetry/CaloSimAlgos/interface/CaloVNoisifier.h delete mode 100644 SimDataFormats/RPCDigiSimLink/interface/RPCDigiSimLinkfwd.h delete mode 100644 SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLinkfwd.h delete mode 100644 SimDataFormats/TrackerDigiSimLink/interface/StripCompactDigiSimLinksfwd.h delete mode 100644 SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLinkfwd.h delete mode 100644 SimG4CMS/Calo/interface/HcalTestHistoClass.h delete mode 100644 SimG4Core/Application/interface/DDDWorldObserver.h delete mode 100644 SimG4Core/Notification/interface/ComponentBuilder.h delete mode 100644 SimG4Core/Notification/interface/ComponentFactoryByName.h delete mode 100644 SimG4Core/Notification/interface/DispatchableG4Step.h delete mode 100644 SimG4Core/Notification/interface/OwnIt.h delete mode 100644 TopQuarkAnalysis/TopTools/interface/TopologyWorker.h delete mode 100644 TrackingTools/AnalyticalJacobians/interface/CurvilinearJacobian.h delete mode 100644 TrackingTools/GsfTools/interface/GaussianSumUtilities.h delete mode 100644 TrackingTools/GsfTools/interface/GaussianSumUtilities.icc delete mode 100644 TrackingTools/PatternTools/interface/MediumProperties.h delete mode 100644 TrackingTools/Records/interface/Records.h diff --git a/Alignment/LaserAlignment/interface/OrderedLaserHitPair.h b/Alignment/LaserAlignment/interface/OrderedLaserHitPair.h deleted file mode 100644 index 76fd9ddfdd728..0000000000000 --- a/Alignment/LaserAlignment/interface/OrderedLaserHitPair.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef LaserAlignment_OrderedLaserHitPair_H -#define LaserAlignment_OrderedLaserHitPair_H - -/** \class OrderedLaserHitPair - * pair of ordered laser hits - * - * $Date: Thu May 10 13:54:44 CEST 2007 $ - * $Revision: 1.1 $ - * \author Maarten Thomas - */ - -#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" - -class OrderedLaserHitPair { -public: - - typedef TrackingRecHit OuterHit; - typedef TrackingRecHit InnerHit; - - - - OrderedLaserHitPair( const InnerHit * ih, const OuterHit * oh) - : theInnerHit(ih), theOuterHit(oh) { } - - - - const InnerHit * inner() const { return theInnerHit; } - const OuterHit * outer() const { return theOuterHit; } -private: - const InnerHit* theInnerHit; - const OuterHit* theOuterHit; -}; - -#endif - diff --git a/Alignment/LaserAlignment/interface/OrderedLaserHitPairs.h b/Alignment/LaserAlignment/interface/OrderedLaserHitPairs.h deleted file mode 100644 index 27e74191c6b31..0000000000000 --- a/Alignment/LaserAlignment/interface/OrderedLaserHitPairs.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef LaserAlignment_OrderedLaserHitPairs_H -#define LaserAlignment_OrderedLaserHitPairs_H - -/** \class OrderedLaserHitPairs - * ordered pairs of laser hits; used for seedgenerator - * - * $Date: Thu May 10 13:53:49 CEST 2007 $ - * $Revision: 1.1 $ - * \author Maarten Thomas - */ - -#include "Alignment/LaserAlignment/interface/OrderedLaserHitPair.h" -#include - -class OrderedLaserHitPairs : public std::vector { -public: - - virtual ~OrderedLaserHitPairs(){} - - virtual unsigned int size() const { return std::vector::size(); } - - virtual const OrderedLaserHitPair& operator[](unsigned int i) const { - return std::vector::operator[](i); - } - -}; -#endif diff --git a/Alignment/LaserAlignment/interface/SeedLayerPairs.h b/Alignment/LaserAlignment/interface/SeedLayerPairs.h deleted file mode 100644 index 7d6525c5f70b1..0000000000000 --- a/Alignment/LaserAlignment/interface/SeedLayerPairs.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef LaserAlignment_SeedLayerPairs_H -#define LaserAlignment_SeedLayerPairs_H - -/** \class SeedLayerPairs - * interface to access pairs of layers; used for seedgenerator - * - * $Date: 2007/05/10 12:00:32 $ - * $Revision: 1.2 $ - * \author Maarten Thomas - */ - -#include -class DetLayer; -class LayerWithHits; - -class SeedLayerPairs { -public: - - typedef std::pair< const LayerWithHits*, const LayerWithHits*> LayerPair; - - SeedLayerPairs() {}; - virtual ~SeedLayerPairs() {}; - virtual std::vector operator()()= 0; - - -}; - -#endif diff --git a/Alignment/MuonAlignmentAlgorithms/interface/MuonInfoTuple.h b/Alignment/MuonAlignmentAlgorithms/interface/MuonInfoTuple.h deleted file mode 100644 index 09646247d6d80..0000000000000 --- a/Alignment/MuonAlignmentAlgorithms/interface/MuonInfoTuple.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef Alignment_MuonAlignmentAlgorithms_MuonInfoTuple_H -#define Alignment_MuonAlignmentAlgorithms_MuonInfoTuple_H - -/* $Date$ - * $Revision: 1.3 $ - * \author Luca Scodellaro - */ - -#define MAX_HIT 60 -#define MAX_HIT_CHAM 14 -#define MAX_SEGMENT 5 - - -typedef struct { - int nhits; - float xc[MAX_HIT]; float yc[MAX_HIT]; float zc[MAX_HIT]; - float erx[MAX_HIT]; - int wh[MAX_HIT]; int st[MAX_HIT]; int sr[MAX_HIT]; - int sl[MAX_HIT]; int la[MAX_HIT]; -} Info1D; - - -typedef struct{ - float p, pt, eta, phi, charge; - int nhits[MAX_SEGMENT]; - int nseg; - float xSl[MAX_SEGMENT]; - float dxdzSl[MAX_SEGMENT]; - float exSl[MAX_SEGMENT]; - float edxdzSl[MAX_SEGMENT]; - float exdxdzSl[MAX_SEGMENT]; - float ySl[MAX_SEGMENT]; - float dydzSl[MAX_SEGMENT]; - float eySl[MAX_SEGMENT]; - float edydzSl[MAX_SEGMENT]; - float eydydzSl[MAX_SEGMENT]; - float xSlSL1[MAX_SEGMENT]; - float dxdzSlSL1[MAX_SEGMENT]; - float exSlSL1[MAX_SEGMENT]; - float edxdzSlSL1[MAX_SEGMENT]; - float exdxdzSlSL1[MAX_SEGMENT]; - float xSL1SL3[MAX_SEGMENT]; - float xSlSL3[MAX_SEGMENT]; - float dxdzSlSL3[MAX_SEGMENT]; - float exSlSL3[MAX_SEGMENT]; - float edxdzSlSL3[MAX_SEGMENT]; - float exdxdzSlSL3[MAX_SEGMENT]; - float xSL3SL1[MAX_SEGMENT]; - float xc[MAX_SEGMENT][MAX_HIT_CHAM]; - float yc[MAX_SEGMENT][MAX_HIT_CHAM]; - float zc[MAX_SEGMENT][MAX_HIT_CHAM]; - float xcp[MAX_SEGMENT][MAX_HIT_CHAM]; - float ycp[MAX_SEGMENT][MAX_HIT_CHAM]; - float zcp[MAX_SEGMENT][MAX_HIT_CHAM]; - float ex[MAX_SEGMENT][MAX_HIT_CHAM]; - int wh[MAX_SEGMENT]; int st[MAX_SEGMENT]; int sr[MAX_SEGMENT]; - int sl[MAX_SEGMENT][MAX_HIT_CHAM]; - int la[MAX_SEGMENT][MAX_HIT_CHAM]; -} Residual1DHit; - - - - -typedef struct { - int wh, st, se; - float dx, dz, alpha, beta, gamma, dy; - float ex, ez, ealpha, ebeta, egamma, ey; - float corr_xz, corr_xalpha, corr_xbeta, corr_xgamma, corr_xy; - float corr_zalpha, corr_zbeta, corr_zgamma, corr_zy; - float corr_alphabeta, corr_alphagamma, corr_alphay; - float corr_betagamma, corr_betay; - float corr_gammay; -} DTSegmentResult; - - -typedef struct { - int wh, st, se; - float cov[60][60]; - int sl[12], la[12]; - float dx[12], dy[12], dz[12], alpha[12], beta[12], gamma[12]; -} DTHitResult; - -#endif diff --git a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMCORLin.h b/CalibCalorimetry/EcalLaserAnalyzer/interface/TMCORLin.h deleted file mode 100644 index d534b6fb89129..0000000000000 --- a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMCORLin.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef TMCORLin_H -#define TMCORLin_H - -#include "TObject.h" - -class TMCORLin: public TObject -{ - - private: - - int smin; - float pn_par0[36][2][10]; - float pn_par1[36][2][10]; - float pn_par2[36][2][10]; - float apd_par0[36][3][1700]; - float apd_par1[36][3][1700]; - float apd_par2[36][3][1700]; - - int convert(int); - - void init(); - void loadConsts(); - void loadConsts(int,int); - - public: - // Default Constructor, mainly for Root - TMCORLin(); - TMCORLin(int); - - // Destructor: Does nothing - virtual ~TMCORLin(); - - double computeCorlin_pn(int, int ,int ,double ); - double computeCorlin_apd(int, int ,int ,double ); - - // ClassDef(TMCORLin,1) -}; - -#endif - diff --git a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMCORSat.h b/CalibCalorimetry/EcalLaserAnalyzer/interface/TMCORSat.h deleted file mode 100644 index 701469f22d6f0..0000000000000 --- a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMCORSat.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef TMCORSat_H -#define TMCORSat_H - -#include "TObject.h" - -class TMCORSat: public TObject -{ - - private: - - int smin; - float pn_rg[36][10]; - float apd_rg[36][2][1700]; - - int convert(int); - - void init(); - void loadConsts(); - void loadConsts(int); - - public: - // Default Constructor, mainly for Root - TMCORSat(); - TMCORSat(int); - - // Destructor: Does nothing - virtual ~TMCORSat(); - - double getPNrg(int, int, int); - double getAPDrg(int, int ,int); - - // ClassDef(TMCORSat,1) -}; - -#endif - diff --git a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMCReader.h b/CalibCalorimetry/EcalLaserAnalyzer/interface/TMCReader.h deleted file mode 100644 index 34b76482c15aa..0000000000000 --- a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMCReader.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef TMCReader_H -#define TMCReader_H - -#include "TObject.h" - -#define FNPNMAX 10 -#define FNLMODNMAX 9 -#define FNCHANMAX 200 - -#define fNpns 2 -#define fNchans 400 -#define fNbins 102 - -class TMCReader: public TObject -{ - - private: - - int smN,nlmodN,arr[FNLMODNMAX]; - long int timestart,timestop; - float evts[fNpns+1][FNCHANMAX+FNPNMAX]; - double min[fNpns+1][FNCHANMAX+FNPNMAX],max[fNpns+1][FNCHANMAX+FNPNMAX]; - double val[fNpns+1][FNCHANMAX+FNPNMAX],sig[fNpns+1][FNCHANMAX+FNPNMAX]; - double wbin[fNpns+1][FNCHANMAX+FNPNMAX]; - float sumprob; - - int smlocal,color,lmdir,part; - - void init(); - - public: - // Default Constructor, mainly for Root - TMCReader(); - - // Destructor: Does nothing - virtual ~TMCReader(); - - void validMCLaser(int,int); - void getMCLaserData(int,int); - void validMCPulse(int); - void getMCPulseData(int); - - int getSMNumb() {return smN;} - int getNbOflmodN() {return nlmodN;} - int getlmodN(int indx) {return arr[indx];} - int getstartime() {return timestart;} - int getstoptime() {return timestop;} - int getnevts(int norm) {return (int) evts[norm][0];} - - void setsmlocal(int sm) {smlocal=sm;} - void setcolor(int c) {color=c;} - void setdirlmodN(int lmp) {lmdir=lmp;} - void setpartition(int p) {part=p;} - - void changedatatoraw(int,int,int); - void changedatatopeak(int,int,int); - - void printeinjData(int,int,int); - void printlaserData(int,int,int,int); - void printlaserpeak(int,int,int); - void printnormlaserData(int,int,int,int,int); - void printnormlaserpeak(int,int,int,int); - - - // ClassDef(TMCReader,1) -}; - -#endif - - - diff --git a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMConfig.h b/CalibCalorimetry/EcalLaserAnalyzer/interface/TMConfig.h deleted file mode 100644 index 7cc110071d3ff..0000000000000 --- a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMConfig.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef TMConfig_H -#define TMConfig_H - -#include "TObject.h" - -#define fNsmNmax 36 //number of SM -#define fNlmodN 9 //number of lmodN in a SM -#define fNmem 10 //number of PNs in a MEM -#define fNmodN 4 //number of modN in a SM -#define fNtt 68 //number of trigger towers in a SM -#define fNmax 8 -#define fNburmax 3 -#define fNseqmax 3 -#define fNcolors 6 //number of laser colors - -class TMConfig: public TObject -{ - - private: - int smin; - int arr[fNsmNmax+1][fNmodN+1]; - int nbof[fNsmNmax+1][fNlmodN+1]; - int towerlist[fNsmNmax+1][fNlmodN][fNmax+1]; - int channlist[fNsmNmax+1][fNlmodN][fNmax+1]; - int addrpn[fNsmNmax+1][fNmodN+1][fNmem]; - int n_pin[fNsmNmax+1][fNmodN+1]; - int seqTypeOfSignal[fNseqmax+1],numbOfEventperBurstAndSignal[fNseqmax+1]; - int numbOfBurstperSignal[fNseqmax+1]; - int ped_size[fNburmax+1],laser_size[fNcolors][fNseqmax+1]; - double alpha[fNcolors],beta[fNcolors]; - double alpha_run[fNcolors][fNsmNmax+1][fNtt],beta_run[fNcolors][fNsmNmax+1][fNtt]; - - void init(); - void readSequenzaConfig(); - void readlmodNConfig(); - void readpnConfig(); - void initShapeAnalysis(); - void initLaserPulseFit(); - void initTPFit(); - void initPNFit(); - void initMatacqPulseFit(); - - int convert(int); - - int firstSample, lastSample; - double alpha_start, beta_start; - - int firstpnSample, lastpnSample; - int nbofiter,nbofpresamp,samplemin,samplemax; - int nbofpnpresamp, nbofpnsamp, nbofsamp; - - int nbofmtqsamples,nbofmtqpresamp,vlastmtqsample,nbofmtqsigmas; - int nbofmtqsamp1esbeforemax_parab,nbofmtqsamplesaftermax_parab; - int thres_mtq,ampllow_trise,amplhigh_trise; - - public: - // Default Constructor, mainly for Root - TMConfig(); - - // Destructor: Does nothing - virtual ~TMConfig(); - - int getfirstSM() {return smin;} - int getfirstSample() {return firstSample;} - int getlastSample() {return lastSample;} - int getfirstPNSample() {return firstpnSample;} - int getlastPNSample() {return lastpnSample;} - float getalpha0() {return alpha_start;} - float getbeta0() {return beta_start;} - int getsampleMin() {return samplemin;} - int getsampleMax() {return samplemax;} - int getNbOfxtalpresamples() {return nbofpresamp;} - int getNbOfPNpresamples() {return nbofpnpresamp;} - int getNbOfiterations() {return nbofiter;} - int getNbOfPNsamples() { return nbofpnsamp;} - int getNbOfxtalsamples() { return nbofsamp;} - double getalpha_ls(int c) { return alpha[c];} - double getbeta_ls(int c) { return beta[c];} - - void loadPParams(); - double getalpha_run(int,int,int); - double getbeta_run(int,int,int); - - int getNbOf(int,int); - int getTNumb(int,int,int); - int getXNumb(int,int,int); - int getPNaddr(int,int,int); - int getNbOfPNs(int,int); - - int getNbOfMatacqsamples() {return nbofmtqsamples;} - int getNbOfMatacqpresamples() {return nbofmtqpresamp;} - int getvlastMatacqsample() {return vlastmtqsample;} - int getNoiseCutForMatacq() {return nbofmtqsigmas;} - int getNbOfsamplesBefMax() {return nbofmtqsamp1esbeforemax_parab;} - int getNbOfsamplesAftMax() {return nbofmtqsamplesaftermax_parab;} - int getThresForMatacq() {return thres_mtq;} - int getLowLevelForTRise() {return ampllow_trise;} - int getHighLevelForTRise() {return amplhigh_trise;} - - int getSignalTypeForSeq(int seqNumb) { return seqTypeOfSignal[seqNumb];} - int getNbOfBurstperSignalForSeq(int seqNumb) { return numbOfBurstperSignal[seqNumb];} - int getNbOfEventperBurstAndSignalForSeq(int seqNumb) { return numbOfEventperBurstAndSignal[seqNumb];} - - // ClassDef(TMConfig,1) -}; - -#endif - diff --git a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMEGeom.h b/CalibCalorimetry/EcalLaserAnalyzer/interface/TMEGeom.h deleted file mode 100644 index fb27a0413fc63..0000000000000 --- a/CalibCalorimetry/EcalLaserAnalyzer/interface/TMEGeom.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef TMEGeom_H -#define TMEGeom_H - -#include "TObject.h" - -#define nTT 25 - -class TMEGeom: public TObject -{ - - private: - - int ttindarr[5][5]; - - - public: - // Default Constructor, mainly for Root - TMEGeom(); - - // Destructor: Does nothing - virtual ~TMEGeom(); - -int nbOfXTalinmodN(int); -int nbOfXTalinlmodN(int); - -int xtaltoadcn(int); -int adcltoxtal(int,int); -int adcltoadcn(int,int); -int adcltotNumb(int,int); -int adcmtoadcn(int,int); -int adcmtoadcl(int,int,int); -int adcntoadcm(int); -int adcntomodN(int); -int adcntolmodN(int,int); -int adcntoxtal(int); -int tNumbtomodN(int); -int tNumbtomodulN(int); -int tNumbtolmodN(int); -int tNumbtoside(int); -int lmodNtoside(int); -int lmodNtomodN(int); -int lmodNtolmcha(int); - -int modN_offset(int); -int lmodN_offset(int); - -int adcntoij(int); -int adcltoij(int,int); -int ijtoadcn(int,int); -int ijtoadcl(int,int,int); - -int tNumbtolvcha(int); -int tNumbtohvcha(int); -int adcltolvcha(int,int); -int adcltohvcha(int,int); - -int hvchatolvcha(int); - -void tNumbtoij(int); - -// ClassDef(TMEGeom,1) -}; - -#endif diff --git a/CalibCalorimetry/EcalLaserAnalyzer/interface/TPEDestalAnalysis.h b/CalibCalorimetry/EcalLaserAnalyzer/interface/TPEDestalAnalysis.h deleted file mode 100644 index cafa6a2ea3231..0000000000000 --- a/CalibCalorimetry/EcalLaserAnalyzer/interface/TPEDestalAnalysis.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef TPEDestalAnalysis_H -#define TPEDestalAnalysis_H - -#include "TObject.h" - -#define fNpns 2 -#define fNchans 400 -#define ngains 3 - -class TPEDestalAnalysis: public TObject -{ - - private: - - int nevt; - long int timestart[ngains],timestop[ngains]; - long int pntimestart[ngains],pntimestop[ngains]; - double valhf[ngains][fNchans+fNpns],sighf[ngains][fNchans+fNpns]; - double valbf[ngains][fNchans+fNpns],sigbf[ngains][fNchans+fNpns]; - double evts[ngains][fNchans+fNpns],evtn[ngains][fNchans+fNpns]; - - double cuthflow[ngains][fNchans+fNpns],cuthfhig[ngains][fNchans+fNpns]; - double cutbflow[ngains][fNchans+fNpns],cutbfhig[ngains][fNchans+fNpns]; - - void init(); - - public: - // Default Constructor, mainly for Root - TPEDestalAnalysis(); - - // Destructor: Does nothing - virtual ~TPEDestalAnalysis(); - - void reinit(); - void reinit(int); - void putDateStart(int,long int); - void putDateStop(int,long int); - void putpnDateStart(int,long int); - void putpnDateStop(int,long int); - void getDateStart(int); - void getDateStop(int); - double getCuthflow(int g,int i) {return cuthflow[g][i];} - double getCutbfhig(int g,int i) {return cutbfhig[g][i];} - void putValues(int,int,double,double,double); - void putValuesWithCuts(int,int,double,double,double); - void computepedestalcuts(int,int,int,int); - void printpedestalData(int,int,int,int,int,int); - - // ClassDef(TPEDestalAnalysis,1) -}; - -#endif diff --git a/CalibCalorimetry/HcalAlgos/interface/DoublePadeDelay.h b/CalibCalorimetry/HcalAlgos/interface/DoublePadeDelay.h deleted file mode 100644 index eb02251ae4466..0000000000000 --- a/CalibCalorimetry/HcalAlgos/interface/DoublePadeDelay.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef CalibCalorimetry_HcalAlgos_DoublePadeDelay_h_ -#define CalibCalorimetry_HcalAlgos_DoublePadeDelay_h_ - -#include -#include - -#include "CalibCalorimetry/HcalAlgos/interface/AbsElectronicODERHS.h" - -// -// Two differential equations using the Pade delay scheme. The control -// equation and the output equation are coupled only via the timing -// parameter of the output equation (this timing is determined by the -// control output). In this particular model, there is no feedback from -// the output into the control. -// -template -class DoublePadeDelay : public AbsElectronicODERHS -{ -public: - inline DoublePadeDelay(const unsigned padeRow1, const unsigned padeColumn1, - const unsigned padeRow2, const unsigned padeColumn2) - : ode1_(padeRow1, padeColumn1), ode2_(padeRow2, padeColumn2) - { - validate(); - } - - inline DoublePadeDelay(const unsigned padeRow1, const unsigned padeColumn1, - const unsigned padeRow2, const unsigned padeColumn2, - const HcalInterpolatedPulse& pulse) - : AbsElectronicODERHS(pulse), - ode1_(padeRow1, padeColumn1), - ode2_(padeRow2, padeColumn2) - { - validate(); - } - - inline virtual DoublePadeDelay* clone() const - {return new DoublePadeDelay(*this);} - - inline virtual void calc(const double t, - const double* x, const unsigned lenX, - double* derivative) - { - if (!allParametersSet()) throw cms::Exception( - "In DoublePadeDelay::calc: timing and/or ODE parameters not set"); - - // The input signal - const double currentIn = inputPulse_(t); - - // The output signal - const double currentOut = x[outputNode()]; - - // Numbers of parameters used by the member objects - const unsigned npTau1 = tau1_.nParameters(); - const unsigned npOde1 = ode1_.nParameters(); - const unsigned npTau2 = tau2_.nParameters(); - const unsigned npOde2 = ode2_.nParameters(); - - // Parameters for this code. - // Order of parameters in the overall parameter set is: - // parameters for tau1, then for ode1, then tau2, then ode2, - // then parameters of this code. - const double* pstart = ¶ms_[npTau1 + npOde1 + npTau2 + npOde2]; - const double* pars = pstart; - const double ctlGainOut = *pars++; - const double inGainOut = *pars++; - const double outGainOut = *pars++; - assert(thisCodeNumPars == static_cast(pars - pstart)); - - // Save a little bit of time by not calculating the input - // signal derivatives in case they will not be needed - const unsigned row = std::max(ode1_.getPadeRow(), ode2_.getPadeRow()); - const double dIdt = row ? inputPulse_.derivative(t) : 0.0; - const double d2Id2t = row > 1U ? inputPulse_.secondDerivative(t) : 0.0; - - // Set the timing parameters of the control circuit - unsigned firstPar = npTau1 + npOde1; - const double tau2 = tau2_(currentIn, ¶ms_[firstPar], npTau2); - - // Set the ODE parameters for the control circuit - firstPar += npTau2; - if (npOde2) - ode2_.setParameters(¶ms_[firstPar], npOde2); - - // Run the control circuit - const unsigned ctrlNode = controlNode(); - double control; - if (ctrlNode < AbsElectronicODERHS::invalidNode) - { - // The control circuit solves an ODE - control = x[ctrlNode]; - ode2_.calculate(tau2, currentIn, dIdt, d2Id2t, - x, lenX, ctrlNode, derivative); - } - else - { - // The control circuit does not solve an ODE. - // Instead, it drives its output directly. - ode2_.calculate(tau2, currentIn, dIdt, d2Id2t, - 0, 0U, 0U, &control); - } - - // Timing parameter for the output circuit (the preamp) - const double vtau = ctlGainOut*control + - inGainOut*currentIn + - outGainOut*currentOut; - const double tau = tau1_(vtau, ¶ms_[0], npTau1); - - // ODE parameters for the output circuit - if (npOde1) - ode1_.setParameters(¶ms_[npTau1], npOde1); - - // Run the output circuit - ode1_.calculate(tau, currentIn, dIdt, d2Id2t, x, lenX, 0U, derivative); - } - - inline unsigned numberOfNodes() const - {return ode1_.getPadeColumn() + ode2_.getPadeColumn();} - - inline unsigned nParameters() const - { - const unsigned npTau1 = tau1_.nParameters(); - const unsigned npOde1 = ode1_.nParameters(); - const unsigned npTau2 = tau2_.nParameters(); - const unsigned npOde2 = ode2_.nParameters(); - return npTau1 + npOde1 + npTau2 + npOde2 + thisCodeNumPars; - } - - inline unsigned outputNode() const {return 0U;} - - // The second ODE is the one for control. It's output node - // is the control node. - inline unsigned controlNode() const - { - if (ode2_.getPadeColumn()) - // ode2 has a real output node - return ode1_.getPadeColumn(); - else - // ode2 does not have a real output node - return AbsElectronicODERHS::invalidNode; - } - -private: - static const unsigned thisCodeNumPars = 3U; - - inline void validate() const - { - // Basically, we need to avoid the situation in which - // we need to solve the differential equation for the control - // circuit but do not need to solve the differential equation - // for the preamp. It this case we will not have a good way - // to pass the preamp output to the simulator. The simplest - // way to ensure correctness of the whole procedure is to require - // that the preamp must always be modeled by an ODE. Indeed, - // one will almost surely need to represent it by at least - // a low-pass filter. - if (!ode1_.getPadeColumn()) throw cms::Exception( - "In DoublePadeDelay::validate: the output " - "circuit must be modeled by an ODE"); - } - - ODE1 ode1_; - ODE2 ode2_; - DelayTimeModel1 tau1_; - DelayTimeModel2 tau2_; -}; - -#endif // CalibCalorimetry_HcalAlgos_DoublePadeDelay_h_ diff --git a/CalibCalorimetry/HcalAlgos/interface/equalADCSignalTime.h b/CalibCalorimetry/HcalAlgos/interface/equalADCSignalTime.h deleted file mode 100644 index baa88e325b8ee..0000000000000 --- a/CalibCalorimetry/HcalAlgos/interface/equalADCSignalTime.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CalibCalorimetry_HcalAlgos_equalADCSignalTime_h_ -#define CalibCalorimetry_HcalAlgos_equalADCSignalTime_h_ - -class QIE8Simulator; - -// -// Determine the start time of the simulator input signal which -// produces equal ADC counts in time slices N and N+1. If the start -// time is set to "ttry" then ADC[N] should be larger than ADC[N+1]. -// If the start time is set to "ttry"+25 then ADC[N] should be smaller -// than ADC[N+1]. Note that N should be positive. -// -double equalADCSignalTime(QIE8Simulator& sim, double dt, - double tDigitize, unsigned N, double ttry); - -#endif // CalibCalorimetry_HcalAlgos_equalADCSignalTime_h_ diff --git a/CalibFormats/SiPixelObjects/interface/PixelAliasList.h b/CalibFormats/SiPixelObjects/interface/PixelAliasList.h deleted file mode 100644 index ec3df7f2b7fb9..0000000000000 --- a/CalibFormats/SiPixelObjects/interface/PixelAliasList.h +++ /dev/null @@ -1,279 +0,0 @@ -#ifndef PixelAliasList_h -#define PixelAliasList_h -/*! \file CalibFormats/SiPixelObjects/interface/PixelAliasList.h -* \brief The class to handle 'aliases.txt' -* -* A longer explanation will be placed here later -*/ - -#include "CalibFormats/SiPixelObjects/interface/PixelConfigAlias.h" -#include "CalibFormats/SiPixelObjects/interface/PixelConfigList.h" -#include "CalibFormats/SiPixelObjects/interface/PixelVersionAlias.h" - -#include -#include -#include -#include - -namespace pos { - /*! \class PixelAliasList PixelAliasList.h "interface/PixelAliasList.h" -* -* A longer explanation will be placed here later -*/ - // Added by Dario, May 20th, 2008 ===================================================================== - typedef std::pair versionAliasPair; - typedef std::vector vectorVAPairs; - typedef std::map pathVersionAliasMmap; - typedef std::map pathAliasPair; - typedef std::map pathAliasMmap; - // End of Dario's addition ============================================================================ - class PixelAliasList { - public: - void writefile() { - std::string directory = std::getenv("PIXELCONFIGURATIONBASE"); - - std::string filename = directory + "/aliases.txt"; - - std::ofstream out(filename.c_str()); - - out << "ConfigurationAliases" << std::endl; - for (unsigned int i = 0; i < pixelConfigAliases_.size(); i++) { - PixelConfigAlias& theAlias = pixelConfigAliases_[i]; - out << theAlias.name() << " " << theAlias.key() << " "; - - unsigned int n = theAlias.nVersionAliases(); - for (unsigned int j = 0; j < n; j++) { - out << theAlias.versionAliasesPath(j) << " "; - out << theAlias.versionAliasesAlias(j) << " "; - } - - out << ";" << std::endl; - } - - out << "VersionAliases" << std::endl; - for (unsigned int i = 0; i < pixelVersionAliases_.size(); i++) { - PixelVersionAlias& theAlias = pixelVersionAliases_[i]; - - out << theAlias.path() << " " << theAlias.version() << " " << theAlias.alias() << " ;" << std::endl; - } - } - - void readfile(std::string filename) { - std::ifstream in(filename.c_str()); - if (!in.good()) { - std::cout << "[PixelAliasList::readfile()]\t\tCould not open file:" << filename << std::endl; - } - assert(in.good()); - - // Added by Dario, May 28th, 2008 ===================================================================== - pixelConfigAliases_.clear(); - pixelVersionAliases_.clear(); - aliasMmap.clear(); - versionMmap.clear(); - // End of Dario's addition ============================================================================ - - std::string tag; - - in >> tag; - while (tag.substr(0, 1) == "#") { - in.ignore(4096, '\n'); //skips to endl; - in >> tag; - } - - assert(tag == "ConfigurationAliases"); - - in >> tag; - - while (tag != "VersionAliases") { - std::string alias = tag; - - unsigned int key; - in >> key; - - //std::cout << "[PixelAliasList::readfile()] Alias, key:"<> tag; - std::string theAlias = alias; - - // Added by Dario, May 20th, 2008 ===================================================================== - pathAliasPair tmpPAPair; - if (tag == ";") { - tmpPAPair[""] = " "; - aliasMmap[theAlias] = tmpPAPair; - } - // End of Dario's addition ============================================================================ - while (tag != ";") { - std::string path; - std::string alias; - - path = tag; - in >> alias; - //std::cout << "[PixelAliasList::readfile()] path, alias:"<> tag; - } - - pixelConfigAliases_.push_back(anAlias); - - in >> tag; - } - - assert(tag == "VersionAliases"); - - std::string path; - std::string alias; - unsigned int version; - - in >> path; - in >> version; - in >> alias; - in >> tag; - - //std::cout << "path version alias tag:"<> path; - in >> version; - in >> alias; - in >> tag; - } - - in.close(); - } - - void insertAlias(PixelConfigAlias& anAlias) { - for (unsigned int i = 0; i < pixelConfigAliases_.size(); i++) { - if (pixelConfigAliases_[i].name() == anAlias.name()) { - std::cout << "[PixelAliasList::insertAlias()]\t\t\tReplacing existing alias:" << anAlias.name() << std::endl; - pixelConfigAliases_[i] = anAlias; - return; - } - } - pixelConfigAliases_.push_back(anAlias); - } - - PixelConfigAlias* versionAliases(std::string aliasName) { - for (unsigned int i = 0; i < pixelConfigAliases_.size(); i++) { - if (pixelConfigAliases_[i].name() == aliasName) { - return &(pixelConfigAliases_[i]); - } - } - return 0; - } - - void insertVersionAlias(PixelVersionAlias& anAlias) { - for (unsigned int i = 0; i < pixelVersionAliases_.size(); i++) { - if (pixelVersionAliases_[i].alias() == anAlias.alias() && pixelVersionAliases_[i].path() == anAlias.path()) { - std::cout << "[PixelAliasList::insertVersionAlias()]\t\tReplacing existing version alias:" << anAlias.path() - << " " << anAlias.alias() << std::endl; - pixelVersionAliases_[i] = anAlias; - return; - } - } - pixelVersionAliases_.push_back(anAlias); - } - - void updateConfigAlias(std::string path, unsigned int version, std::string alias, PixelConfigList& config) { - //first loop over configuration aliases - for (unsigned int i = 0; i < pixelConfigAliases_.size(); i++) { - //std::cout << "Looping over aliases:"< getVersionAliases(std::string path) { - std::vector tmp; - for (unsigned int i = 0; i < pixelVersionAliases_.size(); i++) { - //std::cout << "path alias:"< getConfigAliases(std::string path) { - std::vector configAliasVector; - for (pathAliasMmap::iterator it = aliasMmap.begin(); it != aliasMmap.end(); it++) { - if ((*it).first == path) { - configAliasVector.push_back((*it).second); - } - } - return configAliasVector; - } - // End of Dario's addition ============================================================================ - - unsigned int nAliases() { return pixelConfigAliases_.size(); } - std::string name(unsigned int i) { return pixelConfigAliases_[i].name(); } - unsigned int key(unsigned int i) { return pixelConfigAliases_[i].key(); } - PixelConfigAlias operator[](unsigned int i) { return pixelConfigAliases_[i]; } - - unsigned int nVersionAliases() { return pixelVersionAliases_.size(); } - std::string path(unsigned int i) { return pixelVersionAliases_[i].path(); } - unsigned int version(unsigned int i) { return pixelVersionAliases_[i].version(); } - std::string alias(unsigned int i) { return pixelVersionAliases_[i].alias(); } - - private: - std::vector pixelConfigAliases_; - std::vector pixelVersionAliases_; - // Added by Dario, May 20th, 2008 ===================================================================== - pathAliasMmap aliasMmap; - pathVersionAliasMmap versionMmap; - // End of Dario's addition ============================================================================ - }; -} // namespace pos - -#endif diff --git a/CalibFormats/SiPixelObjects/interface/PixelConfig.h b/CalibFormats/SiPixelObjects/interface/PixelConfig.h deleted file mode 100644 index a050e02b37759..0000000000000 --- a/CalibFormats/SiPixelObjects/interface/PixelConfig.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef PixelConfig_h -#define PixelConfig_h -/*! \file CalibFormats/SiPixelObjects/interface/PixelConfig.h -* \brief This class implements.. -* -* A longer explanation will be placed here later -*/ - -#include -#include -#include -#include - -namespace pos{ -/*! \class PixelConfig PixelConfig.h "interface/PixelConfig.h" -* \brief This class implements.. -* -* A longer explanation will be placed here later -*/ - class PixelConfig { - - public: - - void write(std::ofstream& out){ - for (unsigned int i=0;i aPair(dir,version); - versions_.push_back(aPair); - } - //returns -1 if it can not find the dir. - int find(std::string dir, unsigned int &version){ -// std::cout << "[pos::PixelConfig::find()] versions_.size() = " << versions_.size() << std::endl ; - for(unsigned int i=0;i > versions(){ - return versions_; - } - - private: - - std::vector > versions_; - - }; -} -#endif diff --git a/CalibFormats/SiPixelObjects/interface/PixelConfigAlias.h b/CalibFormats/SiPixelObjects/interface/PixelConfigAlias.h deleted file mode 100644 index b113fd7a49ac1..0000000000000 --- a/CalibFormats/SiPixelObjects/interface/PixelConfigAlias.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef PixelConfigAlias_h -#define PixelConfigAlias_h -/*! \file CalibFormats/SiPixelObjects/interface/PixelConfigAlias.h -* \brief This class implements the steps that are used in a scan over Threshold and CalDelay -* -* A longer explanation will be placed here later -*/ - -#include -#include - -namespace pos{ -/*! \class PixelConfigAlias PixelConfigAlias.h "interface/PixelConfigAlias.h" -* -* A longer explanation will be placed here later -*/ - class PixelConfigAlias { - - public: - PixelConfigAlias(std::string name, unsigned int key) { - name_=name; - key_=key; - } - void addVersionAlias(std::string path, std::string alias) { - std::pair apair(path,alias); - versionAliases_.push_back(apair); - } - - std::string name() { return name_; } - unsigned int key() { return key_; } - - unsigned int nVersionAliases() { return versionAliases_.size(); } - std::string versionAliasesPath(unsigned int i) { return versionAliases_[i].first; } - std::string versionAliasesAlias(unsigned int i) { return versionAliases_[i].second; } - - void setKey(unsigned int key) {key_=key;} - - std::vector > versionAliases() { - return versionAliases_; - } - - - private: - - std::string name_; - unsigned int key_; - std::vector > versionAliases_; - - }; -} -#endif diff --git a/CalibFormats/SiPixelObjects/interface/PixelConfigFile.h b/CalibFormats/SiPixelObjects/interface/PixelConfigFile.h deleted file mode 100644 index 12357d4724be2..0000000000000 --- a/CalibFormats/SiPixelObjects/interface/PixelConfigFile.h +++ /dev/null @@ -1,843 +0,0 @@ -#ifndef PixelConfigFile_h -#define PixelConfigFile_h -/*! \file CalibFormats/SiPixelObjects/interface/PixelConfigFile.h -* \brief This class implements.. -* -* OK, first this is not a DB; this class will try to -* define an interface to accessing the configuration data. -*/ - -#include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h" -#include "CalibFormats/SiPixelObjects/interface/PixelConfigAlias.h" -#include "CalibFormats/SiPixelObjects/interface/PixelConfig.h" -#include "CalibFormats/SiPixelObjects/interface/PixelConfigList.h" -#include "CalibFormats/SiPixelObjects/interface/PixelAliasList.h" -#include "CalibFormats/SiPixelObjects/interface/PixelVersionAlias.h" -#include "CalibFormats/SiPixelObjects/interface/PixelCalibBase.h" -#include "CalibFormats/SiPixelObjects/interface/PixelConfigKey.h" -#include "CalibFormats/SiPixelObjects/interface/PixelTrimBase.h" -#include "CalibFormats/SiPixelObjects/interface/PixelTrimAllPixels.h" -#include "CalibFormats/SiPixelObjects/interface/PixelMaskBase.h" -#include "CalibFormats/SiPixelObjects/interface/PixelMaskAllPixels.h" -#include "CalibFormats/SiPixelObjects/interface/PixelDACSettings.h" -#include "CalibFormats/SiPixelObjects/interface/PixelTBMSettings.h" -#include "CalibFormats/SiPixelObjects/interface/PixelDetectorConfig.h" -#include "CalibFormats/SiPixelObjects/interface/PixelLowVoltageMap.h" -#include "CalibFormats/SiPixelObjects/interface/PixelMaxVsf.h" -#include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h" -#include "CalibFormats/SiPixelObjects/interface/PixelFEDCard.h" -#include "CalibFormats/SiPixelObjects/interface/PixelCalibConfiguration.h" -#include "CalibFormats/SiPixelObjects/interface/PixelPortCardConfig.h" -#include "CalibFormats/SiPixelObjects/interface/PixelPortcardMap.h" -#include "CalibFormats/SiPixelObjects/interface/PixelDelay25Calib.h" -#include "CalibFormats/SiPixelObjects/interface/PixelFECConfig.h" -#include "CalibFormats/SiPixelObjects/interface/PixelTKFECConfig.h" -#include "CalibFormats/SiPixelObjects/interface/PixelFEDConfig.h" -#include "CalibFormats/SiPixelObjects/interface/PixelTTCciConfig.h" -#include "CalibFormats/SiPixelObjects/interface/PixelLTCConfig.h" -#include "CalibFormats/SiPixelObjects/interface/PixelFEDTestDAC.h" -#include "CalibFormats/SiPixelObjects/interface/PixelGlobalDelay25.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DEBUG_CF_ 0 - -namespace pos { - /*! \class PixelConfigFile PixelConfigFile.h "interface/PixelConfigFile.h" -* -* -* OK, first this is not a DB; this class will try to -* define an interface to accessing the configuration data. -*/ - class PixelConfigFile { - public: - static std::vector > getAliases() { - PixelAliasList& aliases = getAlias(); - std::vector > tmp; - for (unsigned int i = 0; i < aliases.nAliases(); i++) { - std::pair apair(aliases.name(i), aliases.key(i)); - tmp.push_back(apair); - } - return tmp; - } - - static std::vector getVersionAliases(std::string path) { return getAlias().getVersionAliases(path); } - - static bool getVersionAliases(std::string configAlias, - unsigned int& key, - std::vector >& versionAliases) { - PixelConfigAlias* alias = getAlias().versionAliases(configAlias); - if (alias == 0) { - return false; - } - key = alias->key(); - versionAliases = alias->versionAliases(); - return true; - } - - static std::map getAliases_map() { - PixelAliasList& aliases = getAlias(); - std::map tmp; - for (unsigned int i = 0; i < aliases.nAliases(); i++) { - tmp.insert(make_pair(aliases.name(i), aliases.key(i))); - } - return tmp; - } - - static PixelConfigList& configList() { - static PixelConfigList theConfigList = getConfig(); - return theConfigList; - } - - static unsigned int getVersion(std::string path, std::string alias) { return getAlias().getVersion(path, alias); } - - // Added by Dario, May 20th, 2008 ===================================================================== - static pos::pathVersionAliasMmap getVersionData() { return getAlias().getVersionData(); } - static pos::pathVersionAliasMmap getVersionData(std::string koc) { return getAlias().getVersionData(koc); } - - static std::vector getConfigAliases(std::string path) { return getAlias().getConfigAliases(path); } - // End of Dario's addition ============================================================================ - - static void addAlias(std::string alias, unsigned int key) { - PixelConfigAlias anAlias(alias, key); - getAlias().insertAlias(anAlias); - getAlias().writefile(); - } - - static void addAlias(std::string alias, - unsigned int key, - std::vector > versionaliases) { - PixelConfigAlias anAlias(alias, key); - for (unsigned int i = 0; i < versionaliases.size(); i++) { - anAlias.addVersionAlias(versionaliases[i].first, versionaliases[i].second); - } - getAlias().insertAlias(anAlias); - getAlias().writefile(); - } - - static std::vector > getVersions(pos::PixelConfigKey key) { - static PixelConfigList& configs = getConfig(); - PixelConfig& theConfig = configs[key.key()]; - return theConfig.versions(); - } - - static void addVersionAlias(std::string path, unsigned int version, std::string alias) { - PixelConfigList& configs = getConfig(); - - PixelVersionAlias anAlias(path, version, alias); - getAlias().insertVersionAlias(anAlias); - getAlias().updateConfigAlias(path, version, alias, configs); - getAlias().writefile(); - configs.writefile(); - } - - static unsigned int makeKey(std::vector > versions) { - PixelConfig config; - - for (unsigned int i = 0; i < versions.size(); i++) { - config.add(versions[i].first, versions[i].second); - } - - PixelConfigList& configs = getConfig(); - - unsigned int newkey = configs.add(config); - - configs.writefile(); - - return newkey; - } - - static PixelConfigList& getConfig() { - static PixelConfigList configs; - - //FIXME - - static int counter = 0; - - if (counter != 0) { - while (counter != 0) { - std::cout << __LINE__ - << "]\t[PixelConfigFile::getConfig()]\t\t\t\t Waiting for other thread to complete reading" - << std::endl; - ::sleep(1); - } - return configs; - } - - counter++; - - static std::string directory; - static int first = 1; - - directory = std::getenv("PIXELCONFIGURATIONBASE"); - std::string filename = directory + "/configurations.txt"; - /* Don't know who put this snippet of code here: this case is already contemplated in the 'else' of the 'if' statement below - if(!first) - { - configs.reload(filename) - } -*/ - if (first) { - first = 0; - configs.readfile(filename); - forceConfigReload(false); - } else { - // if( getForceConfigReload() ) { - configs.reload(filename); - forceConfigReload(false); - // } - } - - counter--; - - return configs; - } - - static PixelAliasList& getAlias() { - static std::string directory; - static int first = 1; - - static PixelAliasList aliases; - - directory = std::getenv("PIXELCONFIGURATIONBASE"); - std::string filename = directory + "/aliases.txt"; - - if (first) { - first = 0; - aliases.readfile(filename); - - forceAliasesReload(false); - } else { - if (getForceAliasesReload()) { - aliases.readfile(filename); - forceAliasesReload(false); - } - } - - return aliases; - } - - static void forceAliasesReload(bool m) { - if (getForceAliasesReload() != m) { - getForceAliasesReload() = m; - } - } - - static void forceConfigReload(bool m) { - if (getForceConfigReload() != m) { - getForceConfigReload() = m; - } - } - - //Returns the path the the configuration data. - static std::string getPath(std::string path, PixelConfigKey key) { - unsigned int theKey = key.key(); - - assert(theKey <= getConfig().size()); - - unsigned int last = path.find_last_of("/"); - assert(last != (unsigned int)std::string::npos); - - std::string base = path.substr(0, last); - std::string ext = path.substr(last + 1); - - unsigned int slashpos = base.find_last_of("/"); - if (slashpos == (unsigned int)std::string::npos) { - std::cout << "[pos::PixelConfigFile::getPath()]\t\t\tOn path:" << path << std::endl; - std::cout << "[pos::PixelConfigFile::getPath()]\t\t\tRecall that you need a trailing /" << std::endl; - ::abort(); - } - - std::string dir = base.substr(slashpos + 1); - - // std::cout << "[pos::PixelConfigFile::get()]\t\t\tExtracted dir:" < - static void get(T*& data, std::string path, PixelConfigKey key) { - unsigned int theKey = key.key(); - - if (theKey >= configList().size()) { - configList() = getConfig(); - } - - assert(theKey <= configList().size()); - - unsigned int last = path.find_last_of("/"); - assert(last != (unsigned int)std::string::npos); - - std::string base = path.substr(0, last); - std::string ext = path.substr(last + 1); - - unsigned int slashpos = base.find_last_of("/"); - if (slashpos == (unsigned int)std::string::npos) { - std::cout << "[pos::PixelConfigFile::get()]\t\t\tAsking for data of type:" << typeid(data).name() << std::endl; - std::cout << "[pos::PixelConfigFile::get()]\t\t\tOn path:" << path << std::endl; - std::cout << "[pos::PixelConfigFile::get()]\t\t\tRecall that you need a trailing /" << std::endl; - ::abort(); - } - - std::string dir = base.substr(slashpos + 1); - - // std::cout << "[pos::PixelConfigFile::get()]\t\t\tExtracted dir:" < - static bool configurationDataExists(T*& data, std::string path, PixelConfigKey key) { - std::string mthn = "]\t[pos::PixelConfigFile::configurationDataExists()]\t "; - /* pos::PixelTimeFormatter * timer = new pos::PixelTimeFormatter("PixelConfigFile::ConfigurationDataExists") ; */ - unsigned int theKey = key.key(); - - assert(theKey <= configList().size()); - - unsigned int last = path.find_last_of("/"); - assert(last != (unsigned int)std::string::npos); - - std::string base = path.substr(0, last); - std::string ext = path.substr(last + 1); - - unsigned int slashpos = base.find_last_of("/"); - if (slashpos == (unsigned int)std::string::npos) { - std::cout << __LINE__ << mthn << "Asking for data of type:" << typeid(data).name() << std::endl; - std::cout << __LINE__ << mthn << "On path:" << path << std::endl; - std::cout << __LINE__ << mthn << "Recall that you need a trailing /" << std::endl; - ::abort(); - } - - std::string dir = base.substr(slashpos + 1); - /* timer->stopTimer() ; */ - // std::cout << __LINE__ << mthn << "Extracted dir:" << dir <stopTimer() ; */ - /* delete timer ; */ - - std::ostringstream s1; - s1 << version; - std::string strversion = s1.str(); - - static std::string directory; - directory = std::getenv("PIXELCONFIGURATIONBASE"); - - std::string fullpath = directory + "/" + dir + "/" + strversion + "/"; - - //std::cout << __LINE__ << mthn << "Directory for configuration data:"< - static void get(T*& data, std::string path, unsigned int version) { - std::string mthn = "]\t[pos::PixelConfigFile::get()]\t\t\t\t "; - - unsigned int last = path.find_last_of("/"); - assert(last != (unsigned int)std::string::npos); - - std::string base = path.substr(0, last); - std::string ext = path.substr(last + 1); - - unsigned int slashpos = base.find_last_of("/"); - //if (slashpos==std::string::npos) { - //std::cout << __LINE__ << mthn << "Asking for data of type:" << typeid(data).name() << std::endl; - //std::cout << __LINE__ << mthn << "On path:" << path << std::endl; - //std::cout << __LINE__ << mthn << "Recall that you need a trailing /" << std::endl; - //::abort(); - //} - - std::string dir = base.substr(slashpos + 1); - - //std::cout << __LINE__ << mthn << "Extracted dir :" << dir < - static void get(std::map& pixelObjects, PixelConfigKey key) { - typename std::map::iterator iObject = pixelObjects.begin(); - - for (; iObject != pixelObjects.end(); ++iObject) { - get(iObject->second, iObject->first, key); - } - } - - static int makeNewVersion(std::string path, std::string& dir) { - //std::cout << "[pos::PixelConfigFile::makeNewVersion()]\t\tInserting data on path:"< - static int put(const T* object, std::string path) { - std::string dir; - int version = makeNewVersion(path, dir); - object->writeASCII(dir); - return version; - } - - template - static int put(std::vector objects, std::string path) { - std::cout << "[pos::PixelConfigFile::put()]\t\t# of objects to write: " << objects.size() << std::endl; - std::string dir; - int version = makeNewVersion(path, dir); - for (unsigned int i = 0; i < objects.size(); i++) { - // std::cout << "[pos::PixelConfigFile::put()]\t\t\t\t\tWill write i="<writeASCII(dir); - } - return version; - } - - private: - static bool& getForceAliasesReload() { - static bool forceAliasesReload = false; - return forceAliasesReload; - } - static bool& getForceConfigReload() { - static bool forceConfigReload = false; - return forceConfigReload; - } - }; - -} // namespace pos -#endif diff --git a/CalibFormats/SiPixelObjects/interface/PixelConfigList.h b/CalibFormats/SiPixelObjects/interface/PixelConfigList.h deleted file mode 100644 index 859287d1b1cb2..0000000000000 --- a/CalibFormats/SiPixelObjects/interface/PixelConfigList.h +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef PixelConfigList_h -#define PixelConfigList_h -/*! \file CalibFormats/SiPixelObjects/interface/PixelConfigList.h -* \brief This class implements the configuration key which actually just is an integer. -* -* A longer explanation will be placed here later -*/ - -#include "CalibFormats/SiPixelObjects/interface/PixelConfig.h" - -#include -#include -#include -#include - -namespace pos { - /*! \class PixelConfigList PixelConfigList.h "interface/PixelConfigList.h" -* \brief This class implements.. -* -* A longer explanation will be placed here later -*/ - class PixelConfigList { - public: - void writefile() { - std::string directory = std::getenv("PIXELCONFIGURATIONBASE"); - /* directory+="/PixelConfigDataExamples/"; */ - directory += "/"; - - std::string filename = directory + "/configurations.txt"; - - std::ofstream out(filename.c_str()); - assert(out.good()); - - for (unsigned int i = 0; i < configs.size(); i++) { - //std::cout << "key "<> tag; - while (tag.substr(0, 1) == "#") { - in.ignore(4096, '\n'); //skips to endl; - in >> tag; - } - - unsigned int version = 0; - - while (!in.eof()) { - if (tag != "key") { - std::cout << "PixelConfigDB: tag=" << tag << std::endl; - assert(0); - } - unsigned int tmp_version; - in >> tmp_version; - if (version != tmp_version) { - std::cout << "PixelConfigDB: read version: " << tmp_version << " while expected " << version << std::endl; - assert(0); - } - - in >> tag; - while (tag.substr(0, 1) == "#") { - in.ignore(4096, '\n'); //skips to endl; - in >> tag; - } - - PixelConfig aConfig; - while (tag != "key" && in.good()) { - unsigned int tmp; - in >> tmp; - //std::cout << "adding: "<> tag; - while (tag.substr(0, 1) == "#") { - in.ignore(4096, '\n'); //skips to endl; - in >> tag; - } - } - - configs.push_back(aConfig); - version++; - }; - - in.close(); - } - - //Method will return new key - unsigned int clone(unsigned int oldkey, std::string path, unsigned int version) { - PixelConfig aConfig = configs[oldkey]; - - unsigned int oldversion; - - if (-1 == aConfig.update(path, oldversion, version)) { - std::cout << "Old version not found for path=" << path << " in config " << oldkey << std::endl; - assert(0); - } - - configs.push_back(aConfig); - - return configs.size() - 1; - } - - //Method will return new key - unsigned int add(PixelConfig& aConfig) { - configs.push_back(aConfig); - - return configs.size() - 1; - } - - unsigned int size() { return configs.size(); } - - PixelConfig& operator[](unsigned int i) { return configs[i]; } - - void reload(std::string filename) { - configs.clear(); - readfile(filename); - } - - unsigned int numberOfConfigs() { return configs.size(); } - - private: - std::vector configs; - }; -} // namespace pos -#endif diff --git a/CalibFormats/SiPixelObjects/interface/PixelMaskOverride.h b/CalibFormats/SiPixelObjects/interface/PixelMaskOverride.h deleted file mode 100644 index 6d3fe01377ed4..0000000000000 --- a/CalibFormats/SiPixelObjects/interface/PixelMaskOverride.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef PixelMaskOverride_h -#define PixelMaskOverride_h -/** -* \file CalibFormats/SiPixelObjects/interface/PixelMaskOverride.h -* \brief This class implements.. -* -* A longer explanation will be placed here later -* -*/ - -#include -#include "PixelROCMaskBits.h" -#include "CalibFormats/SiPixelObjects/interface/PixelMaskOverrideBase.h" - -namespace pos{ -/*! \ingroup ConfigurationObjects "Configuration Objects" -* -* @{ -* -* \class PixelMaskOverride PixelMaskOverride.h -* \brief This is the documentation about PixelMaskOverride... -* -*/ - class PixelMaskOverride: public PixelMaskOverrideBase { - - public: - - PixelMaskOverride(std::string filename); - - PixelROCMaskBits getMaskBits(int ROCId ); - - private: - - //need to store the input here.... - - }; -} -/* @} */ -#endif diff --git a/CalibFormats/SiPixelObjects/interface/PixelTrimOverride.h b/CalibFormats/SiPixelObjects/interface/PixelTrimOverride.h deleted file mode 100644 index 3b0e9c1892ffc..0000000000000 --- a/CalibFormats/SiPixelObjects/interface/PixelTrimOverride.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef PixelTrimOverride_h -#define PixelTrimOverride_h -// -// This class provide a base class for the -// pixel trim data for the pixel FEC configuration -// This is a pure interface (abstract class) that -// needs to have an implementation. -// -// Need to figure out what is 'VMEcommand' below! -// -// All applications should just use this -// interface and not care about the specific -// implementation -// -#include -#include "PixelTrimBase.h" -#include "PixelMaskBase.h" - -namespace pos{ - class PixelTrimOverride: public PixelTrimOverrideBase { - - public: - - PixelTrimOverride(std::string filename); - - //Build the commands needed to configure ROC - //Need to use the mask bits also for this - std::string getConfigCommand(PixelMaskBase& pixelMask); - - private: - - //need to store the private data here... - - }; -} -#endif diff --git a/CalibFormats/SiPixelObjects/interface/PixelVersionAlias.h b/CalibFormats/SiPixelObjects/interface/PixelVersionAlias.h deleted file mode 100644 index 54c9b08fceeb5..0000000000000 --- a/CalibFormats/SiPixelObjects/interface/PixelVersionAlias.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef PixelVersionAlias_h -#define PixelVersionAlias_h - -#include - -namespace pos{ - class PixelVersionAlias { - - public: - PixelVersionAlias(std::string path, unsigned int version, std::string alias) { - path_=path; - version_=version; - alias_=alias; - } - - std::string path() {return path_;} - unsigned int version() {return version_;} - std::string alias() {return alias_;} - - private: - - std::string path_; - unsigned int version_; - std::string alias_; - }; -} -#endif diff --git a/CalibMuon/CSCCalibration/interface/CSCFakeCrosstalkMap.h b/CalibMuon/CSCCalibration/interface/CSCFakeCrosstalkMap.h deleted file mode 100644 index 8f2944e44bffa..0000000000000 --- a/CalibMuon/CSCCalibration/interface/CSCFakeCrosstalkMap.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _CSC_FAKE_CROSSTALK_MAP -#define _CSC_FAKE_CROSSTALK_MAP - -#include "CondFormats/CSCObjects/interface/CSCcrosstalk.h" - -class CSCFakeCrosstalkMap{ - public: - CSCFakeCrosstalkMap(); - - const CSCcrosstalk & get(){ - return (*cncrosstalk); - } - - void smear(); - - private: - float theMean; - float theMin; - float theMinChi; - int theSeed; - long int theM; - - CSCcrosstalk *cncrosstalk ; - -}; - -#endif diff --git a/CalibMuon/CSCCalibration/interface/CSCFakeDBCrosstalkPopCon.h b/CalibMuon/CSCCalibration/interface/CSCFakeDBCrosstalkPopCon.h deleted file mode 100644 index 0dc7fd7a2c5bd..0000000000000 --- a/CalibMuon/CSCCalibration/interface/CSCFakeDBCrosstalkPopCon.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _CSCFAKEDBCROSSTALKPOPCON_H -#define _CSCFAKEDBCROSSTALKPOPCON_H - -#include -#include "FWCore/Framework/interface/SourceFactory.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "CondFormats/CSCObjects/interface/CSCDBCrosstalk.h" -#include "CondFormats/DataRecord/interface/CSCDBCrosstalkRcd.h" -#include - -class CSCFakeDBCrosstalkPopCon: public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { - public: - CSCFakeDBCrosstalkPopCon(const edm::ParameterSet&); - ~CSCFakeDBCrosstalkPopCon(); - - float mean,min,minchi; - int seed;long int M; - - CSCDBCrosstalk * prefillDBFakeCrosstalk(); - - typedef std::unique_ptr ReturnType; - - ReturnType produceDBCrosstalk(const CSCDBCrosstalkRcd&); - - private: - // ----------member data --------------------------- - void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue&, edm::ValidityInterval & ); - CSCDBCrosstalk *cndbcrosstalk ; - -}; - -#endif - diff --git a/CalibMuon/CSCCalibration/interface/CSCFakeDBGainsPopCon.h b/CalibMuon/CSCCalibration/interface/CSCFakeDBGainsPopCon.h deleted file mode 100644 index e43e57c0e6331..0000000000000 --- a/CalibMuon/CSCCalibration/interface/CSCFakeDBGainsPopCon.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _CSCFAKEDBGAINSPOPCON_H -#define _CSCFAKEDBGAINSPOPCON_H - -#include -#include "FWCore/Framework/interface/SourceFactory.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "CondFormats/CSCObjects/interface/CSCDBGains.h" -#include "CondFormats/DataRecord/interface/CSCDBGainsRcd.h" -#include - -class CSCFakeDBGainsPopCon: public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { - public: - CSCFakeDBGainsPopCon(const edm::ParameterSet&); - ~CSCFakeDBGainsPopCon(); - - float mean,min,minchi; - int seed;long int M; - - CSCDBGains * prefillDBGains(); - - typedef std::unique_ptr ReturnType; - - ReturnType produceDBGains(const CSCDBGainsRcd&); - - private: - // ----------member data --------------------------- - void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue&, edm::ValidityInterval & ); - CSCDBGains *cndbgains ; - -}; - -#endif diff --git a/Calibration/IsolatedParticles/interface/CaloSimInfoExtra.h b/Calibration/IsolatedParticles/interface/CaloSimInfoExtra.h deleted file mode 100644 index e8344427f89fd..0000000000000 --- a/Calibration/IsolatedParticles/interface/CaloSimInfoExtra.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef CalibrationIsolatedParticlesCaloSimInfoExtra_h -#define CalibrationIsolatedParticlesCaloSimInfoExtra_h - -// system include files -#include -#include -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" - -#include "FWCore/Framework/interface/Event.h" - -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/Candidate/interface/Candidate.h" - -#include "SimDataFormats/Track/interface/SimTrack.h" -#include "SimDataFormats/Track/interface/SimTrackContainer.h" -#include "SimDataFormats/Vertex/interface/SimVertex.h" -#include "SimDataFormats/Vertex/interface/SimVertexContainer.h" -#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" - -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloTopology/interface/CaloTopology.h" -#include "Geometry/CaloTopology/interface/HcalTopology.h" -#include "RecoCaloTools/Navigation/interface/CaloTowerNavigator.h" -#include "Calibration/IsolatedParticles/interface/CaloSimInfo.h" - -namespace spr{ - - struct energyMap { - energyMap() {pdgId=0;} - int pdgId; - std::vector > matched; - std::vector > gamma; - std::vector > charged; - std::vector > neutral; - std::vector > rest; - std::vector > all; - }; - - // takes the EcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. - template< typename T> - std::map eECALSimInfo(const edm::Event&, CaloNavigator& navigator, const CaloGeometry* geo, edm::Handle& hits, edm::Handle& SimTk, edm::Handle& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, double timeCut=150, bool debug=false); - - template< typename T> - std::map eECALSimInfoTotal(const edm::Event&, const DetId& det, const CaloGeometry* geo, const CaloTopology* caloTopology, edm::Handle& hitsEB, edm::Handle& hitsEE, edm::Handle& SimTk, edm::Handle& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, int itry=-1, double timeCut=150, bool debug=false); - - template< typename T> - energyMap eECALSimInfoMatrix(const edm::Event&, const DetId& det, const CaloGeometry* geo, const CaloTopology* caloTopology, edm::Handle& hitsEB, edm::Handle& hitsEE, edm::Handle& SimTk, edm::Handle& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, double timeCut=150, bool debug=false); - - // takes the HcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. - template - std::map eHCALSimInfoTotal(const edm::Event&, const HcalTopology* topology, const DetId& det, const CaloGeometry* geo, edm::Handle& hits,edm::Handle& SimTk, edm::Handle& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, int itry=-1, double timeCut=150, bool includeHO=false, bool debug=false); - - template - energyMap eHCALSimInfoMatrix(const edm::Event&, const HcalTopology* topology, const DetId& det, const CaloGeometry* geo, edm::Handle& hits,edm::Handle& SimTk, edm::Handle& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, double timeCut=150, bool includeHO=false, bool debug=false); - - // Actual function which does the matching of SimHits to SimTracks using geantTrackId - template - energyMap caloSimInfoMatrix(const CaloGeometry* geo, edm::Handle& hits, edm::Handle& SimTk, edm::Handle& SimVtx, std::vector< typename T::const_iterator> hit, edm::SimTrackContainer::const_iterator trkInfo, double timeCut=150, bool includeHO=false, bool debug=false); - - // Functions to study the Hits for which history cannot be traced back - template - std::vector missedECALHits(const edm::Event&, CaloNavigator& navigator, edm::Handle& hits, edm::Handle& SimTk, edm::Handle& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, bool flag, bool debug=false); - - template - std::vector missedHCALHits(const edm::Event&, const HcalTopology* topology, const DetId& det, edm::Handle& hits,edm::Handle& SimTk, edm::Handle& SimVtx, const reco::Track* pTrack, TrackerHitAssociator& associate, int ieta, int iphi, bool flag, bool includeHO=false, bool debug=false); - - template - std::vector missedCaloHits(edm::Handle& hits, std::vector matchedId, std::vector< typename T::const_iterator> caloHits, bool flag, bool includeHO=false, bool debug=false); -} - -#include "Calibration/IsolatedParticles/interface/CaloSimInfoExtra.icc" -#endif diff --git a/Calibration/IsolatedParticles/interface/eECALMatrixExtra.h b/Calibration/IsolatedParticles/interface/eECALMatrixExtra.h deleted file mode 100644 index 437efa65d9fad..0000000000000 --- a/Calibration/IsolatedParticles/interface/eECALMatrixExtra.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -The function eECALmatrix returns total energy contained in -NxN crystal matrix for EcalRecHits or PCaloSimHits. - -Inputs : -1. CaloNavigator at the DetId around which NxN has to be formed -2. The EcalRecHitCollection and -3. Number of crystals to be navigated along eta and phi along - one direction (navigation is done alone +-deta and +-dphi). - -Authors: Seema Sharma, Sunanda Banerjee -Created: August 2009 -*/ - - -#ifndef CalibrationIsolatedParticleseECALMatrixExtra_h -#define CalibrationIsolatedParticleseECALMatrixExtra_h - -// system include files -#include -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/DetId/interface/DetId.h" - -#include "Calibration/IsolatedParticles/interface/MatrixECALDetIds.h" -#include "RecoCaloTools/Navigation/interface/CaloNavigator.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloTopology/interface/CaloTopology.h" -#include "Calibration/IsolatedParticles/interface/eECALMatrix.h" - -namespace spr{ - - // Energy in NxN crystal matrix - template< typename T> - double eECALmatrix(CaloNavigator& navigator,edm::Handle& hits, int ieta, int iphi, bool debug=false); - - template< typename T> - std::vector > eECALmatrixCell(const DetId& detId, edm::Handle& hitsEB, edm::Handle& hitsEE, const CaloGeometry* geo, const CaloTopology* caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false); - - // Energy in ietaXiphi crystal matrix - template< typename T> - std::pair eECALmatrixTotal(const DetId& detId, edm::Handle& hitsEB, edm::Handle& hitsEE, const CaloGeometry* geo, const CaloTopology* caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, bool debug=false); - - // returns vector of hits in NxN matrix - template - std::vector > energyECALCell(std::vector& vdets, edm::Handle& hitsEB, edm::Handle& hitsEE, double ebThr=-100, double eeThr=-100, bool debug=false); - -} - -#include "Calibration/IsolatedParticles/interface/eECALMatrixExtra.icc" - -#endif diff --git a/Calibration/Tools/interface/TrackDetMatchInfoCollection.h b/Calibration/Tools/interface/TrackDetMatchInfoCollection.h deleted file mode 100644 index caf10e4172aa6..0000000000000 --- a/Calibration/Tools/interface/TrackDetMatchInfoCollection.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef HTrackAssociator_HTrackDetMatchInfoCollection_h -#define HTrackAssociator_HTrackDetMatchInfoCollection_h - -#include -#include "Calibration/Tools/interface/TrackDetMatchInfo.h" - -typedef std::vector HTrackDetMatchInfoCollection; - -#endif diff --git a/Calibration/Tools/interface/smartSelector.h b/Calibration/Tools/interface/smartSelector.h deleted file mode 100644 index 12e38f1a10bf6..0000000000000 --- a/Calibration/Tools/interface/smartSelector.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*/ - -#ifndef smartSelector_h -#define smartSelector_h - -#include - -class smartSelector -{ - public : - - //! ctor - smartSelector (int smallestPart = 0) : - m_smallestPart (smallestPart) {} - - //! set the smallest part only if was set to 0 - int setSmallestPart (int smallestPart) - { - if (!m_smallestPart) - { - m_smallestPart = smallestPart ; - return 0 ; - } - else return 1 ; - } - - //! actual selector - int accept (int eventNb, const int numberOfFractions) const - { - if (!m_smallestPart) return 1 ; - if (m_smallestPart == numberOfFractions) return 1 ; - int position = eventNb % m_smallestPart ; - int sum = 0 ; - for (int i=1 ; i= sum && - position < sum + numberOfFractions) - return 1 ; - return 0 ; - } - - private : - - int m_smallestPart ; - -} ; - - -#endif diff --git a/CommonTools/CandAlgos/interface/CloneProducer.h b/CommonTools/CandAlgos/interface/CloneProducer.h deleted file mode 100644 index 4405c92d80ae4..0000000000000 --- a/CommonTools/CandAlgos/interface/CloneProducer.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef CandAlgos_CloneProducer_h -#define CandAlgos_CloneProducer_h -/** \class CloneProducer - * - * Clones a concrete Candidate collection - * to a CandidateCollection (i.e.: OwnVector) filled - * with clones of the original candidate collection - * - * \author: Francesco Fabozzi, INFN - * modified by Luca Lista, INFN - * - * Template parameters: - * - C : Concrete candidate collection type - * - */ -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "DataFormats/Candidate/interface/Candidate.h" - -template -class CloneProducer : public edm::EDProducer { -public: - /// constructor from parameter set - explicit CloneProducer( const edm::ParameterSet& ); - /// destructor - ~CloneProducer(); - -private: - /// process an event - virtual void produce( edm::Event&, const edm::EventSetup& ); - /// labels of the collection to be converted - edm::EDGetTokenT srcToken_; -}; - -template -CloneProducer::CloneProducer( const edm::ParameterSet& par ) : - srcToken_( consumes( par.template getParameter( "src" ) ) ) { - produces(); -} - -template -CloneProducer::~CloneProducer() { -} - -template -void CloneProducer::produce( edm::Event& evt, const edm::EventSetup& ) { - std::unique_ptr coll( new reco::CandidateCollection ); - edm::Handle masterCollection; - evt.getByToken( srcToken_, masterCollection ); - for( size_t i = 0; i < masterCollection->size(); ++i ) { - reco::CandidateBaseRef masterClone( edm::Ref( masterCollection, i ) ); - coll->push_back( masterClone->clone() ); - } - evt.put( std::move( coll ) ); -} - -#endif diff --git a/CommonTools/CandUtils/interface/CandMatcher.h b/CommonTools/CandUtils/interface/CandMatcher.h deleted file mode 100755 index 9a0c2c1fdcbf6..0000000000000 --- a/CommonTools/CandUtils/interface/CandMatcher.h +++ /dev/null @@ -1,239 +0,0 @@ -#ifndef CandUtils_CandMatcher_h -#define CandUtils_CandMatcher_h -/* class CandMatcher - * - * \author Luca Lista, INFN - * - */ -#include -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/Common/interface/AssociationMap.h" -#include "DataFormats/Common/interface/OneToOne.h" -#include "FWCore/Utilities/interface/EDMException.h" -#include "CommonTools/CandUtils/interface/CandMapTrait.h" - -template -class CandMatcherBase { -public: - /// map type - typedef typename reco::helper::CandMapTrait::type map_type; - /// ref type - typedef typename reco::helper::CandRefTrait::ref_type ref_type; - /// refProd type - typedef typename reco::helper::CandRefTrait::refProd_type refProd_type; - /// map vector - typedef std::vector map_vector; - /// concrete candidate reference type - typedef typename map_type::key_type reference_type; - /// concrete candidate reference type - typedef typename reference_type::value_type value_type; - /// constructor - explicit CandMatcherBase( const map_vector & maps ); - /// constructor - explicit CandMatcherBase( const map_type & map ); - /// destructor - virtual ~CandMatcherBase(); - /// get match from transient reference - ref_type operator()( const reco::Candidate & ) const; - -protected: - /// get ultimate daughter (can skip status = 3 in MC) - virtual std::vector getDaughters( const reco::Candidate * ) const = 0; - /// composite candidate preselection - virtual bool compositePreselect( const reco::Candidate & c, const reco::Candidate & m ) const = 0; - /// init maps - void initMaps(); - -protected: - const std::vector & maps() const { return maps_; } -private: - /// pointers to stored maps - std::vector maps_; - /// reference to matched collectino - refProd_type matched_; - /// pointer map type - typedef std::map CandRefMap; - /// pointer map type - typedef std::map MatchedRefMap; - /// pointer map of candidates (e.g.: reco) - CandRefMap candRefs_; - /// pointer map of matched candidates (e.g.: MC truth) - MatchedRefMap matchedRefs_; - /// mother + n.daughters indices from matched - std::vector > matchedMothers_; - /// init at constructor - void init(); -}; - -template -class CandMatcher : public CandMatcherBase { -public: - /// constructor - explicit CandMatcher( const typename CandMatcherBase::map_vector & maps ); - /// constructor - explicit CandMatcher( const typename CandMatcherBase::map_type & map ); - /// destructor - virtual ~CandMatcher(); - -protected: - /// get ultimate daughter (get all in the general case) - virtual std::vector getDaughters( const reco::Candidate * ) const; - /// composite candidate preselection - virtual bool compositePreselect( const reco::Candidate & c, const reco::Candidate & m ) const; -}; - -#include -#include - -template -void CandMatcherBase::init() { - matched_ = maps_.front()->refProd().val; - for( typename map_vector::const_iterator m = maps_.begin() + 1; - m != maps_.end(); ++ m ) { - if( (*m)->refProd().val != matched_ ) - throw edm::Exception( edm::errors::InvalidReference ) - << "Multiple match maps specified matching different MC truth collections.\n" - << "Please, specify maps all matching to the same MC truth collection.\n" - << "In most of the cases you may want to match to genParticleCandidate."; - } -} - -template -CandMatcherBase::CandMatcherBase( const typename CandMatcherBase::map_vector & maps ): - maps_( maps ) { - init(); -} - -template -CandMatcherBase::CandMatcherBase( const typename CandMatcherBase::map_type & map ): - maps_( 1, & map ) { - init(); -} - -template -void CandMatcherBase::initMaps() { - using namespace reco; - using namespace std; - for( typename map_vector::const_iterator m = maps_.begin(); - m != maps_.end(); ++ m ) { - typename CandMatcherBase::map_type::ref_type::key_type cands = (*m)->refProd().key; - for( size_t i = 0; i < cands->size(); ++ i ) { - candRefs_[ & (*cands)[ i ] ] = reference_type( cands, i ); - } - const C2 & matched = * matched_; - size_t matchedSize = matched.size(); - for( size_t i = 0; i < matchedSize; ++ i ) - matchedRefs_[ & matched[ i ] ] = ref_type( matched_, i ); - matchedMothers_.resize( matchedSize ); - for( size_t i = 0; i < matchedSize; ++ i ) { - const Candidate & c = matched[ i ]; - for( Candidate::const_iterator d = c.begin(); d != c.end(); ++ d ) { - vector daus = getDaughters( & * d ); - for( size_t j = 0; j < daus.size(); ++ j ) { - const Candidate * daughter = daus[ j ]; - typename MatchedRefMap::const_iterator f = matchedRefs_.find( daughter ); - if ( f == matchedRefs_.end() ) continue; - size_t k = f->second.key(); - assert( k < matchedMothers_.size() ); - matchedMothers_[ k ].insert( i ); - } - } - } - } -} - -template -CandMatcherBase::~CandMatcherBase() { -} - -template -typename CandMatcherBase::ref_type CandMatcherBase::operator()( const reco::Candidate & c ) const { - using namespace reco; - using namespace std; - if ( c.hasMasterClone() ) - return (*this)( * c.masterClone() ); - unsigned int nDau = c.numberOfDaughters(); - const C2 & matched = * matched_; - if ( nDau > 0 ) { - // check for composite candidate c - // navigate to daughters and find parent matches - set momsIntersection, momDaughters, tmp; - for( Candidate::const_iterator d = c.begin(); d != c.end(); ++ d ) { - // check here generically if status == 3, then descend down to one more level - ref_type m = (*this)( * d ); - // if a daughter does not match, return a null ref. - if ( m.isNull() ) return ref_type(); - // get matched mother indices (fetched previously) - const set & allMomDaughters = matchedMothers_[ m.key() ]; - momDaughters.clear(); - for( set::const_iterator k = allMomDaughters.begin(); - k != allMomDaughters.end(); ++ k ) { - size_t m = * k; - if( compositePreselect( c, matched[ m ] ) ) - momDaughters.insert( m ); - } - // if no mother was found return null reference - if ( momDaughters.size() == 0 ) return ref_type(); - // the first time, momsIntersection is set to momDaughters - if ( momsIntersection.size() == 0 ) momsIntersection = momDaughters; - else { - tmp.clear(); - set_intersection( momsIntersection.begin(), momsIntersection.end(), - momDaughters.begin(), momDaughters.end(), - inserter( tmp, tmp.begin() ) ); - swap( momsIntersection, tmp ); - } - if ( momsIntersection.size() == 0 ) return ref_type(); - } - // if multiple mothers are found, return a null reference - if ( momsIntersection.size() > 1 ) return ref_type(); - // return a reference to the unique mother - return ref_type( matched_, * momsIntersection.begin() ); - } else { - // check for non-composite (leaf) candidate - // if one of the maps contains the candidate c - for( typename std::vector::const_iterator m = maps_.begin(); - m != maps_.end(); ++ m ) { - typename CandRefMap::const_iterator f = candRefs_.find( & c ); - if ( f != candRefs_.end() ) { - reference_type ref = f->second; - typename map_type::const_iterator f = (*m)->find( ref ); - if ( f != (*m)->end() ) { - return f->val; - } - } - } - return ref_type(); - } -} - -template -CandMatcher::CandMatcher( const typename CandMatcherBase::map_vector & maps ) : - CandMatcherBase( maps ) { - CandMatcherBase::initMaps(); -} - -template -CandMatcher::CandMatcher( const typename CandMatcherBase::map_type & map ) : - CandMatcherBase( map ) { - CandMatcherBase::initMaps(); -} - -template -CandMatcher::~CandMatcher() { -} - -template -std::vector CandMatcher::getDaughters( const reco::Candidate * c ) const { - std::vector v; - v.push_back( c ); - return v; -} - -template -bool CandMatcher::compositePreselect( const reco::Candidate & c, const reco::Candidate & m ) const { - // By default, check that the number of daughters is identical - return( c.numberOfDaughters() == m.numberOfDaughters() ); -} - -#endif diff --git a/CommonTools/CandUtils/interface/FastCandMatcher.h b/CommonTools/CandUtils/interface/FastCandMatcher.h deleted file mode 100755 index aad0f64bf0243..0000000000000 --- a/CommonTools/CandUtils/interface/FastCandMatcher.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef CandUtils_FastCandMatcher_h -#define CandUtils_FastCandMatcher_h -/* class CandMatcher - * - * \author Luca Lista, INFN - * - */ -#include -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/Common/interface/AssociationMap.h" -#include "DataFormats/Common/interface/OneToOne.h" -#include "FWCore/Utilities/interface/EDMException.h" - -template -class FastCandMatcher { -public: - /// map type - typedef edm::AssociationMap > map_type; - /// map vector - typedef std::vector map_vector; - /// constructor - explicit FastCandMatcher( const map_vector & maps ); - /// constructor - explicit FastCandMatcher( const map_type & map ); - /// get match from transient reference - const reco::Candidate * operator()( const reco::Candidate & ) const; - -protected: - const std::vector & maps() const { return maps_; } -private: - /// pointers to stored maps - std::vector maps_; -}; - -template -FastCandMatcher::FastCandMatcher( const typename FastCandMatcher::map_vector & maps ): - maps_( maps ) { -} - -template -FastCandMatcher::FastCandMatcher( const typename FastCandMatcher::map_type & map ): - maps_( 1, & map ) { -} - -template -const reco::Candidate * FastCandMatcher::operator()( const reco::Candidate & c ) const { - using namespace reco; - using namespace std; - if ( c.hasMasterClone() ) - return (*this)( * c.masterClone() ); - unsigned int nDau = c.numberOfDaughters(); - if ( nDau > 0 ) { - // check for composite candidate c - // navigate to daughters and find parent matches - set momsIntersection, momDaughters, tmp; - for( Candidate::const_iterator dau = c.begin(); dau != c.end(); ++ dau ) { - // check here generically if status == 3, then descend down to one more level - const Candidate * dauMatch = (*this)( * dau ); - // if a daughter does not match, return a null ref. - if ( dauMatch == 0 ) return 0; - // get matched mothers - size_t mothers = dauMatch->numberOfMothers(); - for( size_t i = 0; i < mothers; ++ i ) { - const reco::Candidate * mom = dauMatch->mother( i ); - if ( mom != 0 && mom->pdgId() == dauMatch->pdgId() && - mom->status() == 3 && dauMatch->status() == 1 ) { - // assume a single mother at this point... - mom = mom->mother( 0 ); - } - momDaughters.insert( mom ); - } - // if no mother was found return null reference - if ( momDaughters.size() == 0 ) return 0; - // the first time, momsIntersection is set to momDaughters - if ( momsIntersection.size() == 0 ) momsIntersection = momDaughters; - else { - tmp.clear(); - set_intersection( momsIntersection.begin(), momsIntersection.end(), - momDaughters.begin(), momDaughters.end(), - inserter( tmp, tmp.begin() ) ); - swap( momsIntersection, tmp ); - } - if ( momsIntersection.size() == 0 ) return 0; - } - // if multiple mothers are found, return a null reference - if ( momsIntersection.size() > 1 ) return 0; - // return a reference to the unique mother - return * momsIntersection.begin(); - } else { - // check for non-composite (leaf) candidate - // if one of the maps contains the candidate c - for( typename std::vector::const_iterator m = maps_.begin(); - m != maps_.end(); ++ m ) { - for( typename map_type::const_iterator i = (*m)->begin(); i != (*m)->end(); ++ i ) { - if ( & * i->key == & c ) - return & * i->val; - } - } - return 0; - } -} - -#endif diff --git a/CommonTools/CandUtils/interface/NamedCandCombiner.h b/CommonTools/CandUtils/interface/NamedCandCombiner.h deleted file mode 100755 index 6f1633fc6c77f..0000000000000 --- a/CommonTools/CandUtils/interface/NamedCandCombiner.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef CandUtils_NamedCandCombiner_h -#define CandUtils_NamedCandCombiner_h -/** \class NamedCandCombiner - * - * \author Luca Lista, INFN - * - */ -#include "CommonTools/CandUtils/interface/NamedCandCombinerBase.h" -#include "CommonTools/CandUtils/interface/AddFourMomenta.h" -#include "CommonTools/CandUtils/interface/CandSelector.h" -#include "CommonTools/UtilAlgos/interface/AnyPairSelector.h" -#include "DataFormats/Candidate/interface/NamedCompositeCandidate.h" -#include "DataFormats/Candidate/interface/ShallowClonePtrCandidate.h" -#include - -namespace combiner { - namespace helpers { - struct NormalClone { - template - static void addDaughter(CMP & cmp, const Ptr & c, std::string name) { - cmp.addDaughter(*c, name); - } - }; - - struct ShallowClone { - template - static void addDaughter(CMP & cmp, const reco::CandidatePtr & c, std::string name) { - if(c->numberOfDaughters()==0) - cmp.addDaughter(reco::ShallowClonePtrCandidate(c), name); - else - cmp.addDaughter(*c, name); - } - }; - } -} - -template -class NamedCandCombiner : public NamedCandCombinerBase { -public: - /// default constructor - NamedCandCombiner(std::string name) : - NamedCandCombinerBase(name), - select_(), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and two charges - NamedCandCombiner(std::string name, int q1, int q2) : - NamedCandCombinerBase(name, q1, q2), - select_(), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and three charges - NamedCandCombiner(std::string name, int q1, int q2, int q3 ) : - NamedCandCombinerBase(name, q1, q2, q3), - select_(), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and four charges - NamedCandCombiner(std::string name, int q1, int q2, int q3, int q4) : - NamedCandCombinerBase(name, q1, q2, q3, q4), - select_(), selectPair_(), setup_(), name_(name) { } - /// default constructor - NamedCandCombiner(std::string name, const Selector & select) : - NamedCandCombinerBase(name), - select_(select), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and two charges - NamedCandCombiner(std::string name, const Selector & select, int q1, int q2 ) : - NamedCandCombinerBase(name, q1, q2), - select_(select), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and three charges - NamedCandCombiner(std::string name, const Selector & select, int q1, int q2, int q3 ) : - NamedCandCombinerBase(name, q1, q2, q3), - select_(select), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and four charges - NamedCandCombiner(std::string name, const Selector & select, int q1, int q2, int q3, int q4 ) : - NamedCandCombinerBase(name, q1, q2, q3, q4), - select_(select), selectPair_(), setup_(), name_(name) { } - /// constructor from selector - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair) : - NamedCandCombinerBase(name), - select_(select), selectPair_(selectPair), setup_(), name_(name) { } - /// constructor from a selector and two charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, int q1, int q2) : - NamedCandCombinerBase(name, q1, q2), - select_(select), selectPair_(selectPair), setup_(), name_(name) { } - /// constructor from a selector and three charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, int q1, int q2, int q3) : - NamedCandCombinerBase(name, q1, q2, q3), - select_(select), selectPair_(selectPair), setup_(), name_(name) { } - /// constructor from a selector and four charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, int q1, int q2, int q3, int q4) : - NamedCandCombinerBase(name, q1, q2, q3, q4), - select_(select), selectPair_(selectPair), setup_(), name_(name) { } - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup) : - NamedCandCombinerBase(name), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector and two charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup, int q1, int q2) : - NamedCandCombinerBase(name, q1, q2), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector and three charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup, int q1, int q2, int q3) : - NamedCandCombinerBase(name, q1, q2, q3), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector and four charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup, int q1, int q2, int q3, int q4) : - NamedCandCombinerBase(name, q1, q2, q3, q4), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector, specifying to check for charge - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup,const std::vector & dauCharge) : - NamedCandCombinerBase(name, true, dauCharge), select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector, specifying to check for charge - NamedCandCombiner( std::string name, const Selector & select, const PairSelector & selectPair, const std::vector & dauCharge ) : - NamedCandCombinerBase(name, true, dauCharge), select_(select), selectPair_(selectPair), setup_(), name_(name) { } - /// constructor from a selector, specifying to check for charge - NamedCandCombiner(std::string name, const std::vector & dauCharge) : - NamedCandCombinerBase(name, true, dauCharge), select_(), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector, specifying optionally to check for charge - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup, - bool checkCharge, bool checkOverlap, const std::vector & dauCharge) : - NamedCandCombinerBase(name, checkCharge, checkOverlap, dauCharge), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// return reference to setup object to allow its initialization - Setup & setup() { return setup_; } - -private: - /// select a candidate - virtual bool select(const reco::Candidate & c) const { - return select_(c); - } - /// select a candidate - virtual bool selectPair(const reco::Candidate & c1, const reco::Candidate & c2) const { - return selectPair_(c1, c2); - } - /// set kinematics to reconstructed composite - virtual void setup(reco::NamedCompositeCandidate & c) const { - setup_.set(c); - } - /// add candidate daughter - virtual void addDaughter(reco::NamedCompositeCandidate & cmp, const reco::CandidatePtr & c, std::string n) const { - Cloner::addDaughter(cmp, c, n); - } - /// candidate selector - Selector select_; - /// candidate pair selector - PairSelector selectPair_; - /// utility to setup composite candidate kinematics from daughters - Setup setup_; - /// name - std::string name_; -}; - -#endif diff --git a/CommonTools/ParticleFlow/interface/ObjectSelector.h b/CommonTools/ParticleFlow/interface/ObjectSelector.h deleted file mode 100644 index 49d7280d68d7e..0000000000000 --- a/CommonTools/ParticleFlow/interface/ObjectSelector.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef CommonTools_ParticleFlow_ObjectSelector -#define CommonTools_ParticleFlow_ObjectSelector - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" - - -namespace edm { - class EventSetup; -} - -namespace ipf2pat { - - template< typename Selector, typename CollectionType > - class ObjectSelector { - public: - ObjectSelector(const edm::ParameterSet& ps) : - eventSetupPtr_(0), - selector_(ps) {} - - - const CollectionType& select( const edm::Handle& handleToCollection, - const edm::EventBase& event ) { - /* static edm::Event e; */ - selector_.select( handleToCollection, event, *eventSetupPtr_ ); - return selector_.selected(); - } - - - private: - const edm::EventSetup* eventSetupPtr_; - - Selector selector_; - }; - - -} - - - -#endif diff --git a/CommonTools/ParticleFlow/interface/ObjectSelectors.h b/CommonTools/ParticleFlow/interface/ObjectSelectors.h deleted file mode 100644 index a4a6a207899c3..0000000000000 --- a/CommonTools/ParticleFlow/interface/ObjectSelectors.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef CommonTools_ParticleFlow_ObjectSelectors -#define CommonTools_ParticleFlow_ObjectSelectors - -#include "CommonTools/ParticleFlow/interface/ObjectSelector.h" -#include "CommonTools/ParticleFlow/interface/PtMinPFCandidateSelectorDefinition.h" -#include "CommonTools/ParticleFlow/interface/PdgIdPFCandidateSelectorDefinition.h" -#include "CommonTools/ParticleFlow/interface/IsolatedPFCandidateSelectorDefinition.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" - - -namespace ipf2pat { - typedef ObjectSelector< pf2pat::PtMinPFCandidateSelectorDefinition, reco::PFCandidateCollection > PtMinPFCandidateSelector; - typedef ObjectSelector< pf2pat::PdgIdPFCandidateSelectorDefinition, reco::PFCandidateCollection > PdgIdPFCandidateSelector; - typedef ObjectSelector< pf2pat::IsolatedPFCandidateSelectorDefinition, reco::PFCandidateCollection > IsolatedPFCandidateSelector; -} - -#endif diff --git a/CommonTools/Statistics/interface/BinomialProbability.h b/CommonTools/Statistics/interface/BinomialProbability.h deleted file mode 100644 index 70cc211076dd8..0000000000000 --- a/CommonTools/Statistics/interface/BinomialProbability.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef BinomialProbability_H -#define BinomialProbability_H - -#include - -/** A simple class for accumulating binomial "events", - * i.e. events that have a yes/no outcome, - * and for computing the binomial error on the - * fraction of positive hits. - */ - -class BinomialProbability { -public: - - BinomialProbability() : theHits(0), theTotal(0) {} - - BinomialProbability(int hits, int entries) : - theHits(hits), theTotal(entries) {} - - float value() const { - return theTotal == 0 ? 0 :float(theHits) / float(theTotal); - } - - float error() const { - float p = value(); - return theTotal <= 1 ? 0 : sqrt( p*(1.f - p)/(theTotal-1)); - } - - int entries() const { return theTotal;} - - int hits() const { return theHits;} - - void hit() { theHits++; theTotal++;} - - void miss() { theTotal++;} - - void update( bool hit) { - if ( hit) theHits++; - theTotal++; - } - -private: - - int theHits; - int theTotal; - -}; - -#endif diff --git a/CommonTools/UtilAlgos/interface/DummyMatchSelector.h b/CommonTools/UtilAlgos/interface/DummyMatchSelector.h deleted file mode 100644 index 8d0d99aab14d8..0000000000000 --- a/CommonTools/UtilAlgos/interface/DummyMatchSelector.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef DummyMatchSelector_h -#define DummyMatchSelector_h - -/** - Dummy class for preselection of object matches. -*/ - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -namespace reco { - - template - class DummyMatchSelector { - - public: - - DummyMatchSelector(const edm::ParameterSet& cfg) { } - - bool operator()( const T1 & c, const T2 & hlt ) const { return true; } - - }; - -} - - -#endif diff --git a/CommonTools/UtilAlgos/interface/MassMinSelector.h b/CommonTools/UtilAlgos/interface/MassMinSelector.h deleted file mode 100755 index 73f37fc036aa6..0000000000000 --- a/CommonTools/UtilAlgos/interface/MassMinSelector.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef UtilAlgos_MassMinSelector_h -#define UtilAlgos_MassMinSelector_h -#include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" -#include "CommonTools/Utils/interface/MassMinSelector.h" - -namespace reco { - namespace modules { - - template<> - struct ParameterAdapter { - static MassMinSelector make( const edm::ParameterSet & cfg ) { - return - MassMinSelector( cfg.getParameter( "massMin" ) ); - } - }; - - } -} - -#endif - diff --git a/CommonTools/UtilAlgos/interface/MassRangeSelector.h b/CommonTools/UtilAlgos/interface/MassRangeSelector.h deleted file mode 100755 index 62019baf4e5b3..0000000000000 --- a/CommonTools/UtilAlgos/interface/MassRangeSelector.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef UtilAlgos_MassRangeSelector_h -#define UtilAlgos_MassRangeSelector_h -#include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" -#include "CommonTools/Utils/interface/MassRangeSelector.h" - -namespace reco { - namespace modules { - - template<> - struct ParameterAdapter { - static MassRangeSelector make( const edm::ParameterSet & cfg ) { - return - MassRangeSelector( cfg.getParameter( "massMin" ), - cfg.getParameter( "massMax" ) ); - } - }; - - } -} - -#endif - diff --git a/CommonTools/UtilAlgos/interface/MinSelector.h b/CommonTools/UtilAlgos/interface/MinSelector.h deleted file mode 100755 index efa3d22ccca5d..0000000000000 --- a/CommonTools/UtilAlgos/interface/MinSelector.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef UtilAlgos_MinSelector_h -#define UtilAlgos_MinSelector_h -#include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" -#include "CommonTools/Utils/interface/MinSelector.h" - -namespace reco { - namespace modules { - - template - struct ParameterAdapter > { - static MinSelector make( const edm::ParameterSet & cfg ) { - return MinSelector( cfg.template getParameter( "min" ) ); - } - }; - - } -} - -#endif - diff --git a/CommonTools/UtilAlgos/interface/ObjectPairFilter.h b/CommonTools/UtilAlgos/interface/ObjectPairFilter.h deleted file mode 100755 index 18a66ca61d081..0000000000000 --- a/CommonTools/UtilAlgos/interface/ObjectPairFilter.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef RecoAlgos_ObjectPairFilter_h -#define RecoAlgos_ObjectPairFilter_h -/** \class ObjectPairFilter - * - * Filters an event if one or more pairs of objects passes a given selection - * - * \author Luca Lista, INFN - * - * \version $Revision: 1.3 $ - * - * $Id: ObjectPairFilter.h,v 1.3 2010/02/20 20:55:26 wmtan Exp $ - * - */ - -#include "FWCore/Framework/interface/EDFilter.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" -#include -#include - -template -class ObjectPairFilter : public edm::EDFilter { -public: - /// constructor - explicit ObjectPairFilter( const edm::ParameterSet & cfg ) : - select_( reco::modules::make( cfg ) ), - srcToken_( consumes( cfg.template getParameter( "src" ) ) ), - minNumber_( 1 ) { - std::vector ints = cfg.template getParameterNamesForType(); - const std::string minNumber( "minNumber" ); - bool foundMinNumber = std::find( ints.begin(), ints.end(), minNumber ) != ints.end(); - if ( foundMinNumber ) - minNumber_ = cfg.template getParameter( minNumber ); - } - -private: - /// process one event - bool filter( edm::Event& evt, const edm::EventSetup&) override { - edm::Handle source; - evt.getByToken( srcToken_, source ); - size_t n = 0; - for( typename C::const_iterator i = source->begin(); i != source->end(); ++ i ) - for( typename C::const_iterator j = i + 1; j != source->end(); ++ j ) { - if ( select_( * i, * j ) ) n ++; - if ( n >= minNumber_ ) return true; - } - return false; - } - /// object filter - S select_; - /// source collection label - edm::EDGetTokenT srcToken_; - /// minimum number of entries in a collection - unsigned int minNumber_; -}; - -#endif - diff --git a/CommonTools/UtilAlgos/interface/ObjectRefVectorSelector.h b/CommonTools/UtilAlgos/interface/ObjectRefVectorSelector.h deleted file mode 100755 index 0537972897fcc..0000000000000 --- a/CommonTools/UtilAlgos/interface/ObjectRefVectorSelector.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CandAlgos_ObjectRefVectorSelector_h -#define CandAlgos_ObjectRefVectorSelector_h -/* \class RefVectorRefVectorStoreMananger - * - * \author Luca Lista, INFN - * - */ -#include "CommonTools/UtilAlgos/interface/ObjectSelector.h" -#include "DataFormats/Common/interface/RefVector.h" - -template, - typename SizeSelector = NonNullNumberSelector, - typename PostProcessor = helper::NullPostProcessor > -class ObjectRefVectorSelector : - public ObjectSelector { -public: - explicit ObjectRefVectorSelector( const edm::ParameterSet & cfg ) : - ObjectSelector( cfg ) { } -}; - -#endif - diff --git a/CommonTools/UtilAlgos/interface/OrPairSelector.h b/CommonTools/UtilAlgos/interface/OrPairSelector.h deleted file mode 100755 index afea4fecf1847..0000000000000 --- a/CommonTools/UtilAlgos/interface/OrPairSelector.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef UtilAlgos_OrPairSelector_h -#define UtilAlgos_OrPairSelector_h -#include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" -#include "CommonTools/Utils/interface/OrPairSelector.h" - -namespace reco { - namespace modules { - - template - struct ParameterAdapter > { - static OrPairSelector make(const edm::ParameterSet & cfg) { - return OrPairSelector(modules::make(cfg.getParameter("cut1")), - modules::make(cfg.getParameter("cut2"))); - } - }; - - } -} - -#endif - diff --git a/CommonTools/Utils/interface/Angle.h b/CommonTools/Utils/interface/Angle.h deleted file mode 100644 index baf9889550e9a..0000000000000 --- a/CommonTools/Utils/interface/Angle.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CommonTools_Utils_Angle_h -#define CommonTools_Utils_Angle_h - -/* \class Angle - * - * returns three-dimensional Angle between two objects; - * defined via scalar product: - * angle = acos((v1 * v2)/(|v1| * |v2|)) - * - * \author Christian Veelken, UC Davis - */ - -#include "DataFormats/Math/interface/LorentzVector.h" -#include "DataFormats/Math/interface/angle.h" - -template -struct Angle { - double operator()( const T1 & t1, const T2 & t2 ) const { - return angle( t1, t2 ); - } -}; - -#endif diff --git a/CommonTools/Utils/interface/InvariantMass.h b/CommonTools/Utils/interface/InvariantMass.h deleted file mode 100755 index 52b1c3500c095..0000000000000 --- a/CommonTools/Utils/interface/InvariantMass.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CommonTools_Utils_InvariantMass_h -#define CommonTools_Utils_InvariantMass_h -#include "DataFormats/Math/interface/LorentzVector.h" - -template -struct InvariantMass { - double operator()( const T1 & t1, const T2 & t2 ) const { - return ( t1.momentum() + t2.momentum() ).mass(); - } -}; - -#endif diff --git a/CommonTools/Utils/interface/LazyResult.h b/CommonTools/Utils/interface/LazyResult.h deleted file mode 100644 index e15dc6afd1cf2..0000000000000 --- a/CommonTools/Utils/interface/LazyResult.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef CommonTools_Utils_LazyResult_h -#define CommonTools_Utils_LazyResult_h -// -*- C++ -*- -// -// Package: CommonTools/Utils -// Class : LazyResult -// -/**\class LazyResult LazyResult.h "CommonTools/Utils/interface/LazyResult.h" - Description: Wrapper around a function call for lazy execution. - - Usage: - // example: lazy addition - auto result = LazyResult(std::plus, x, x); - std::cout << result.value() << std::endl; - -Notes: - * The arguments for the delayed call are stored by reference (watch their - lifetime). - * The overhead in memory compared to just storing the result is small: one - reference per argument, one bool flag and a function pointer (on my system: - 1 byte for lambda function, 8 bytes for global function and 16 bytes for - member function due to possible index to virtual table). - -Implementation: - - * For the Args... we explicitly add const& (also in the the args_ tuple). - Otherwise, the arguments will be stored by value which comes with too much - overhead. This implies that the lifetime of the arguments passed to - LazyResult neet to live longer than the LazyResult instance. Function pointers - are small, so no need for const& to the Func. - * An alternative to using a ::value() member function to get the result could - be a cast operator: operator Result const &(). This might be pretty because - the result is automatically evaluated the first time you try to bind it to - a Result const &. I think this would however be too implicit and dangerous. - -*/ -// -// Original Author: Jonas Rembser -// Created: Mon, 14 Jun 2020 00:00:00 GMT -// - -#include -#include - -template -class LazyResult { -public: - using Result = typename std::invoke_result::type; - - LazyResult(Func func, Args const&... args) : func_(func), args_(args...) {} - - Result const& value() { - if (!evaluated_) { - evaluate(); - } - return result_; - } - -private: - void evaluate() { evaluateImpl(std::make_index_sequence{}); } - - template - void evaluateImpl(std::index_sequence) { - result_ = func_(std::get(args_)...); - evaluated_ = true; - } - - // having evaluated_ and the potentially small func_ together might - // save alignemnt bits (e.g. a lambda function is just 1 byte) - bool evaluated_ = false; - Func func_; - std::tuple args_; - Result result_; -}; - -#endif diff --git a/CommonTools/Utils/interface/MassMinSelector.h b/CommonTools/Utils/interface/MassMinSelector.h deleted file mode 100755 index 8a8bdc2099199..0000000000000 --- a/CommonTools/Utils/interface/MassMinSelector.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef RecoAlgos_MassMinSelector_h -#define RecoAlgos_MassMinSelector_h -/* \class MassMinSelector - * - * \author Luca Lista, INFN - * - * $Id: MassMinSelector.h,v 1.1 2007/07/12 08:30:40 llista Exp $ - */ - -struct MassMinSelector { - MassMinSelector( double massMin ) : - massMin_( massMin ) { } - template - bool operator()( const T & t ) const { - return t.mass() >= massMin_; - } - -private: - double massMin_; -}; - -#endif diff --git a/CommonTools/Utils/interface/MassRangeSelector.h b/CommonTools/Utils/interface/MassRangeSelector.h deleted file mode 100755 index c4b68f3342690..0000000000000 --- a/CommonTools/Utils/interface/MassRangeSelector.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef RecoAlgos_MassRangeSelector_h -#define RecoAlgos_MassRangeSelector_h -/* \class MassRangeSelector - * - * \author Luca Lista, INFN - * - * $Id: MassRangeSelector.h,v 1.3 2007/06/18 18:33:53 llista Exp $ - */ - -struct MassRangeSelector { - MassRangeSelector( double massMin, double massMax ) : - massMin_( massMin ), massMax_( massMax ) { } - template - bool operator()( const T & t ) const { - double mass = t.mass(); - return ( mass >= massMin_ && mass <= massMax_ ); - } - -private: - double massMin_, massMax_; -}; - -#endif diff --git a/CommonTools/Utils/interface/MinSelector.h b/CommonTools/Utils/interface/MinSelector.h deleted file mode 100755 index 14e2fa5b23c3d..0000000000000 --- a/CommonTools/Utils/interface/MinSelector.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef RecoAlgos_MinSelector_h -#define RecoAlgos_MinSelector_h -/* \class MinSelector - * - * \author Luca Lista, INFN - * - * $Id: MinSelector.h,v 1.1 2009/02/24 14:40:26 llista Exp $ - */ - -template -struct MinSelector { - MinSelector( T min ) : min_( min ) { } - bool operator()( T t ) const { return t >= min_; } - -private: - T min_; -}; - -#endif diff --git a/CommonTools/Utils/interface/OrPairSelector.h b/CommonTools/Utils/interface/OrPairSelector.h deleted file mode 100755 index 2619ee3378a2c..0000000000000 --- a/CommonTools/Utils/interface/OrPairSelector.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef CommonTools_Utils_OrPairSelector_h -#define CommonTools_Utils_OrPairSelector_h -/* \class OrPairSelector - * - * \author Luca Lista, INFN - * - * $Id: OrPairSelector.h,v 1.1 2009/02/24 14:40:26 llista Exp $ - */ - -template -struct OrPairSelector { - OrPairSelector(const S1 & s1, const S2 & s2) : s1_(s1), s2_(s2) { } - template - bool operator()(const T1 & t1, const T2 & t2) const { - return s1_(t1) || s2_(t2); - } -private: - S1 s1_; - S2 s2_; -}; - -#endif diff --git a/CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h b/CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h deleted file mode 100644 index c6ea5fb08b964..0000000000000 --- a/CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h +++ /dev/null @@ -1 +0,0 @@ -#error obsolete header diff --git a/CondCore/DTPlugins/interface/DTConfigPluginHandler.h b/CondCore/DTPlugins/interface/DTConfigPluginHandler.h deleted file mode 100644 index c6ea5fb08b964..0000000000000 --- a/CondCore/DTPlugins/interface/DTConfigPluginHandler.h +++ /dev/null @@ -1 +0,0 @@ -#error obsolete header diff --git a/CondFormats/CastorObjects/interface/AllClasses.h b/CondFormats/CastorObjects/interface/AllClasses.h deleted file mode 100644 index ac0d1349110df..0000000000000 --- a/CondFormats/CastorObjects/interface/AllClasses.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CondFormats_CastorObjects_AllClasses_h -#define CondFormats_CastorObjects_AllClasses_h -#include "CondFormats/CastorObjects/interface/AllObjects.h" -/* -class CastorPedestals; -class CastorPedestalWidths; -class CastorGains; -class CastorRawGains; -class CastorGainWidths; -class CastorQIEShape; -class CastorQIEData; -class CastorCalibrationQIEData; -class CastorChannelQuality; -class CastorElectronicsMap; -*/ -#endif diff --git a/CondFormats/Common/interface/Constants.h b/CondFormats/Common/interface/Constants.h deleted file mode 100644 index 8a4253dbcc168..0000000000000 --- a/CondFormats/Common/interface/Constants.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CondCommon_Constants_h -#define CondCommon_Constants_h -#include -#include -#include - -/* constants other than time used in cond - */ - -namespace cond { - - const std::string invalidToken(" "); - -} - -#endif //CondCommon_Constants_h diff --git a/CondFormats/DataRecord/interface/SiStripBadChannelRcd.h b/CondFormats/DataRecord/interface/SiStripBadChannelRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripBadChannelRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripBadFiberRcd.h b/CondFormats/DataRecord/interface/SiStripBadFiberRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripBadFiberRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripBadModuleRcd.h b/CondFormats/DataRecord/interface/SiStripBadModuleRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripBadModuleRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripModuleHVRcd.h b/CondFormats/DataRecord/interface/SiStripModuleHVRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripModuleHVRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h b/CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h b/CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/HcalObjects/interface/HcalItemArrayColl.h b/CondFormats/HcalObjects/interface/HcalItemArrayColl.h deleted file mode 100644 index 40997120b675e..0000000000000 --- a/CondFormats/HcalObjects/interface/HcalItemArrayColl.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef CondFormats_HcalObjects_HcalItemArrayColl_h -#define CondFormats_HcalObjects_HcalItemArrayColl_h - -#include "boost/array.hpp" -#include "boost/serialization/access.hpp" -#include "boost/serialization/version.hpp" -#include "boost/serialization/shared_ptr.hpp" -#include "boost/serialization/vector.hpp" -#include "boost/version.hpp" -#if BOOST_VERSION < 106400 -#include "boost/serialization/array.hpp" -#else -#include "boost/serialization/boost_array.hpp" -#endif - -#include -#include -#include - -// -// This collection manages arrays of pointers and references. -// In particular, it can be used for storing objects in -// an inheritance hierarchy by their base pointers. -// The pointee objects are owned by this collection. -// -template -class HcalItemArrayColl { -public: - typedef Item value_type; - typedef std::array, N> InputArray; - static constexpr unsigned arraySize() { return N; } - - // The following method adds a new array of pointers to the collection. - // This class will take ownership of the pointee objects. - void push_back(InputArray& arr) { - StoredArray st; - for (unsigned i = 0; i < N; ++i) - st[i] = std::shared_ptr(arr[i].release()); - data_.push_back(st); - } - - // Other modifiers - inline void clear() { data_.clear(); } - inline void reserve(const unsigned n) { data_.reserve(n); } - - // Some inspectors - inline std::size_t size() const { return data_.size(); } - inline bool empty() const { return data_.empty(); } - - // The following function returns nullptr if - // one of the argument indices is out of range - inline const Item* get(const unsigned itemIndex, const unsigned arrayIndex) const { - if (itemIndex < data_.size() && arrayIndex < N) - return data_[itemIndex][arrayIndex].get(); - else - return nullptr; - } - - // The following function throws an exception if - // one of the argument indices is out of range - inline Item& at(const unsigned itemIndex, const unsigned arrayIndex) const { - return *data_.at(itemIndex).at(arrayIndex); - } - - // Deep comparison for equality is useful for testing serialization - bool operator==(const HcalItemArrayColl& r) const { - const std::size_t sz = data_.size(); - if (sz != r.data_.size()) - return false; - for (std::size_t i = 0; i < sz; ++i) - for (unsigned j = 0; j < N; ++j) - if (!(*data_[i][j] == *r.data_[i][j])) - return false; - return true; - } - - inline bool operator!=(const HcalItemArrayColl& r) const { return !(*this == r); } - -private: - typedef boost::array, N> StoredArray; - std::vector data_; - - friend class boost::serialization::access; - - template - inline void serialize(Archive& ar, unsigned /* version */) { - ar& data_; - } -}; - -// boost serialization version number for this template -namespace boost { - namespace serialization { - template - struct version > { - BOOST_STATIC_CONSTANT(int, value = 1); - }; - } // namespace serialization -} // namespace boost - -#endif // CondFormats_HcalObjects_HcalItemArrayColl_h diff --git a/CondFormats/HcalObjects/interface/HcalItemArrayCollById.h b/CondFormats/HcalObjects/interface/HcalItemArrayCollById.h deleted file mode 100644 index 2c66a4860a717..0000000000000 --- a/CondFormats/HcalObjects/interface/HcalItemArrayCollById.h +++ /dev/null @@ -1,161 +0,0 @@ -#ifndef CondFormats_HcalObjects_HcalItemArrayCollById_h -#define CondFormats_HcalObjects_HcalItemArrayCollById_h - -#include - -#include "FWCore/Utilities/interface/Exception.h" - -#include "CondFormats/HcalObjects/interface/HcalItemArrayColl.h" -#include "CondFormats/HcalObjects/interface/HcalIndexLookup.h" -#include "DataFormats/HcalDetId/interface/HcalDetId.h" -#include "CondFormats/HcalObjects/interface/HcalDetIdTransform.h" -#include "CondFormats/HcalObjects/interface/AbsHcalAlgoData.h" - -// -// This collection allows lookup of arrays of items by HcalDetId. -// If the given HcalDetId is not explicitly listed in the -// lookup table, default item is returned. -// -// Just like HcalItemArrayColl, this collection works with pointers -// and references only, so it can be used with the inheritance -// scenarios. Note that the ownership of objects is shared with -// the collection provided in the constructor. The default array -// is owned by this collection. Its ownership will also become -// shared if a copy of this collection is made. -// -template -class HcalItemArrayCollById : public AbsHcalAlgoData { -public: - typedef Item value_type; - typedef typename HcalItemArrayColl::InputArray InputArray; - static constexpr unsigned arraySize() { return N; } - - // Dummy constructor. To be used for deserialization only. - inline HcalItemArrayCollById() : transformCode_(HcalDetIdTransform::N_TRANSFORMS) {} - - // Normal constructor - HcalItemArrayCollById(const HcalItemArrayColl& coll, - const HcalIndexLookup& indexLookupTable, - const unsigned detIdTransformCode, - InputArray& defaultFunctors) - : coll_(coll), lookup_(indexLookupTable), transformCode_(detIdTransformCode) { - // Check that the lookup table is valid for this application - if (lookup_.hasDuplicateIds()) - throw cms::Exception( - "In HcalItemArrayCollById constructor:" - " invalid lookup table"); - - // Check that the lookup table is consistent with the size - // of the collection - const unsigned maxIndex = lookup_.largestIndex(); - if (maxIndex != HcalIndexLookup::InvalidIndex && maxIndex >= coll_.size()) - throw cms::Exception( - "In HcalItemArrayCollById constructor:" - " collection and lookup table are inconsistent"); - - HcalDetIdTransform::validateCode(transformCode_); - - // Take care of the default array - setDefault(defaultFunctors); - } - - inline virtual ~HcalItemArrayCollById() {} - - // Modifier for the default array of items - inline void setDefault(InputArray& arr) { - for (unsigned i = 0; i < N; ++i) - default_[i] = std::shared_ptr(arr[i].release()); - } - - // Size of the internal collection, not counting the default - inline std::size_t size() const { return coll_.size(); } - - // Look up the index into the collection by detector id - inline unsigned getIndex(const HcalDetId& id) const { - return lookup_.find(HcalDetIdTransform::transform(id, transformCode_)); - } - - // Item lookup by its index and array index. If item lookup - // by index fails and the array index is not out of bounds, - // default item is returned. - inline const Item* getByIndex(const unsigned itemIndex, const unsigned arrayIndex) const { - const Item* f = coll_.get(itemIndex, arrayIndex); - if (f == nullptr && arrayIndex < N) - f = default_[arrayIndex].get(); - return f; - } - - // The following method will return nullptr if - // there is no corresponding default - inline const Item* getDefault(const unsigned arrayIndex) const { - if (arrayIndex < N) - return default_[arrayIndex].get(); - else - return nullptr; - } - - // Convenience function for getting what we need by id. - // Note that, if you are simply cycling over array indices, - // it will be more efficient to retrieve the item index - // first and then use "getByIndex" method. - inline const Item* get(const HcalDetId& id, const unsigned arrayIndex) const { - return getByIndex(getIndex(id), arrayIndex); - } - - // Similar comment applies here if you are just cycling over array indices - inline const Item& at(const HcalDetId& id, const unsigned arrayIndex) const { - const Item* f = getByIndex(getIndex(id), arrayIndex); - if (f == nullptr) - throw cms::Exception("In HcalItemArrayCollById::at: invalid detector id"); - return *f; - } - -protected: - virtual bool isEqual(const AbsHcalAlgoData& other) const override { - const HcalItemArrayCollById& r = static_cast(other); - if (coll_ != r.coll_) - return false; - if (lookup_ != r.lookup_) - return false; - if (transformCode_ != r.transformCode_) - return false; - for (unsigned j = 0; j < N; ++j) { - // The default may or may not be there - const bool ld = default_[j].get(); - const bool rd = r.default_[j].get(); - if (ld != rd) - return false; - if (ld) - if (!(*default_[j] == *r.default_[j])) - return false; - } - return true; - } - -private: - typedef boost::array, N> StoredArray; - - HcalItemArrayColl coll_; - HcalIndexLookup lookup_; - StoredArray default_; - uint32_t transformCode_; - - friend class boost::serialization::access; - - template - inline void serialize(Archive& ar, unsigned /* version */) { - ar& coll_& lookup_& default_& transformCode_; - } -}; - -// boost serialization version number for this template -namespace boost { - namespace serialization { - template - struct version > { - BOOST_STATIC_CONSTANT(int, value = 1); - }; - } // namespace serialization -} // namespace boost - -#endif // CondFormats_HcalObjects_HcalItemArrayCollById_h diff --git a/CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp b/CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp deleted file mode 100644 index 45933afa4bbd5..0000000000000 --- a/CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*****************************************************************************/ -/** - * \file polymorphic_portable_archive.hpp - * \brief Needed for unit tests on portable archives. - * \author christian.pfligersdorffer@gmx.at - * - * Header for testing portable archives with all of the serialization tests. - * Before use copy all hpp files from this directory to your boost folder - * boost_.../libs/serialization/test and run from there a visual studio - * prompt with b2 oder bjam -sBOOST_ARCHIVE_LIST=portable_archive.hpp - * - * \note Since portable archives version 5.0 we depend on program_options! - * Edit libs/serialization/test/Jamfile.v2 and change the requirements to - * : requirements /boost/filesystem /boost/program_options - */ -/****************************************************************************/ - -#pragma warning(disable : 4217 4127 4310 4244 4800 4267) - -// text_archive test header -// include output archive header -#include "portable_oarchive.hpp" -// set name of test output archive -typedef eos::polymorphic_portable_oarchive test_oarchive; -// set name of test output stream -typedef std::ofstream test_ostream; - -// repeat the above for input archive -#include "portable_iarchive.hpp" -typedef eos::polymorphic_portable_iarchive test_iarchive; -typedef std::ifstream test_istream; - -// define open mode for streams -// binary archives should use std::ios_base::binary -#define TEST_STREAM_FLAGS std::ios_base::binary diff --git a/CondFormats/Serialization/interface/eos/portable_archive.hpp b/CondFormats/Serialization/interface/eos/portable_archive.hpp deleted file mode 100644 index f5b51ccb82cee..0000000000000 --- a/CondFormats/Serialization/interface/eos/portable_archive.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*****************************************************************************/ -/** - * \file portable_archive.hpp - * \brief Needed for unit tests on portable archives. - * \author christian.pfligersdorffer@gmx.at - * - * Header for testing portable archives with all of the serialization tests. - * Before use copy all hpp files from this directory to your boost folder - * boost_.../libs/serialization/test and run from there a visual studio - * prompt with b2 oder bjam -sBOOST_ARCHIVE_LIST=portable_archive.hpp - * - * \note Since portable archives version 5.0 we depend on program_options! - * Edit libs/serialization/test/Jamfile.v2 and change the requirements to - * : requirements /boost/filesystem /boost/program_options - */ -/****************************************************************************/ - -#pragma warning(disable : 4217 4127 4310 4244 4800 4267) - -// text_archive test header -// include output archive header -#include "portable_oarchive.hpp" -// set name of test output archive -typedef eos::portable_oarchive test_oarchive; -// set name of test output stream -typedef std::ofstream test_ostream; - -// repeat the above for input archive -#include "portable_iarchive.hpp" -typedef eos::portable_iarchive test_iarchive; -typedef std::ifstream test_istream; - -// define open mode for streams -// binary archives should use std::ios_base::binary -#define TEST_STREAM_FLAGS std::ios_base::binary diff --git a/CondFormats/SiPixelObjects/interface/MapPathTodetUnit.h b/CondFormats/SiPixelObjects/interface/MapPathTodetUnit.h deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h b/CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h deleted file mode 100644 index 062fd8546863b..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - \file - Declaration of class IntercalibConstantsHandler - - \author Stefano ARGIRO - \version $Id: EcalIntercalibConstantsHandler.h,v 1.1 2008/11/14 15:46:05 argiro Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalIntercalibConstantsHandler_h_ -#define _CondToolsEcal_EcalIntercalibConstantsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalIntercalibConstantsHandler; - -#endif diff --git a/CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h b/CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h deleted file mode 100644 index f92ede7ae1f35..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - \file - Declaration of class InterlcalibConstantsMCHandler - - \author Stefano ARGIRO - \version $Id: EcalIntercalibConstantsMCHandler.h,v 1.1 2009/04/08 15:20:25 argiro Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalIntercalibConstantsMCHandler_h_ -#define _CondToolsEcal_EcalIntercalibConstantsMCHandler_h_ - - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalIntercalibConstantsMCHandler; - -#endif diff --git a/CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h b/CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h deleted file mode 100644 index f881eb7356ebf..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - \file - Declaration of class IntercalibErrorsHandler - - \author Stefano ARGIRO - \version $Id: EcalIntercalibErrorsHandler.h,v 1.1 2008/11/14 15:46:05 argiro Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalIntercalibErrorsHandler_h_ -#define _CondToolsEcal_EcalIntercalibErrorsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalIntercalibErrorsHandler; - -#endif // _CondToolsEcal_EcalIntercalibErrorsHandler_h_ - -// Configure (x)emacs for this file ... -// Local Variables: -// mode:c++ -// compile-command: "scram b" -// End diff --git a/CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h b/CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h deleted file mode 100644 index eec459e867071..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - Translates a EcalIntercalibErrors record to XML - and vice versa - - \author Stefano ARGIRO - \version $Id: EcalIntercalibErrorsXMLTranslator.h,v 1.3 2009/06/30 16:15:16 argiro Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalIntercalibErrorsXMLTranslator_h_ -#define __EcalIntercalibErrorsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalIntercalibErrorsXMLTranslator; - -#endif // __EcalIntercalibErrorsXMLTranslator_h_ diff --git a/CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h b/CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h deleted file mode 100644 index 509ed640de898..0000000000000 --- a/CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - Translates a EcalPFRecHitThresholds record to XML - and vice versa - - \author Stefano ARGIRO - \version $Id: EcalPFRecHitThresholdsXMLTranslator.h,v 1.2 2009/06/30 14:40:11 argiro Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalPFRecHitThresholdsXMLTranslator_h_ -#define __EcalPFRecHitThresholdsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalPFRecHitThresholdsXMLTranslator; - -#endif // __EcalPFRecHitThresholdsXMLTranslator_h_ diff --git a/CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h b/CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h deleted file mode 100644 index f48c154857f93..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - \file - Declaration of class EcalTimeCalibConstantsHandler - - \author Seth COOPER - \version $Id: EcalTimeCalibConstantsHandler.h,v 1.1 2009/10/26 14:14:11 scooper Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalTimeCalibConstantsHandler_h_ -#define _CondToolsEcal_EcalTimeCalibConstantsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalTimeCalibConstantsHandler; - -#endif - diff --git a/CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h b/CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h deleted file mode 100644 index 945623f0d7c1c..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - Translates an EcalTimeCalibConstants record to XML - and vice versa - - \author Seth COOPER - \version $Id: EcalTimeCalibConstantsXMLTranslator.h,v 1.1 2009/10/26 16:15:16 scooper Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalTimeCalibConstantsXMLTranslator_h_ -#define __EcalTimeCalibConstantsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalTimeCalibConstantsXMLTranslator; - - -#endif // __EcalTimeCalibConstantsXMLTranslator_h_ - diff --git a/CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h b/CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h deleted file mode 100644 index b6b829e068020..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - \file - Declaration of class EcalTimeCalibErrorsHandler - - \author Seth COOPER - \version $Id: EcalTimeCalibErrorsHandler.h,v 1.1 2009/10/26 14:14:11 scooper Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalTimeCalibErrorsHandler_h_ -#define _CondToolsEcal_EcalTimeCalibErrorsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalTimeCalibErrorsHandler; - -#endif - diff --git a/CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h b/CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h deleted file mode 100644 index 241363a884e78..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - Translates an EcalTimeCalibErrors record to XML - and vice versa - - \author Seth COOPER - \version $Id: EcalTimeCalibErrorsXMLTranslator.h,v 1.1 2009/10/26 16:15:16 scooper Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalTimeCalibErrorsXMLTranslator_h_ -#define __EcalTimeCalibErrorsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalTimeCalibErrorsXMLTranslator; - - -#endif // __EcalTimeCalibErrorsXMLTranslator_h_ - diff --git a/CondTools/Ecal/test/testXMLTranslators.cc b/CondTools/Ecal/test/testXMLTranslators.cc deleted file mode 100644 index cde70f806f3aa..0000000000000 --- a/CondTools/Ecal/test/testXMLTranslators.cc +++ /dev/null @@ -1,472 +0,0 @@ -#include "CondTools/Ecal/interface/EcalADCToGeVXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalIntercalibConstantsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalLinearCorrectionsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalWeightGroupXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalTBWeightsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalLaserAPDPNRatiosXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h" - -#include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" -#include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" -#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h" - -#include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h" -#include "CondFormats/EcalObjects/interface/EcalTimeCalibErrors.h" - -#include "CondFormats/EcalObjects/interface/EcalXtalGroupId.h" -#include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" - -#include "CondTools/Ecal/interface/EcalGainRatiosXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalChannelStatusXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalWeightSetXMLTranslator.h" - -#include "CondFormats/EcalObjects/interface/EcalGainRatios.h" -#include "CondFormats/EcalObjects/interface/EcalMGPAGainRatio.h" - -#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" -#include "CondFormats/EcalObjects/interface/EcalChannelStatusCode.h" - -#include "CondFormats/EcalObjects/interface/EcalWeightSet.h" -#include "CondTools/Ecal/interface/EcalCondHeader.h" - -#include "CondFormats/EcalObjects/interface/EcalTBWeights.h" - -#include "DataFormats/EcalDetId/interface/EBDetId.h" - - - -#include -using std::cout; -using std::endl; - -#include - -int main(){ - - // Test ADCtoGeV - - EcalCondHeader header; - EcalCondHeader header2; - - - header.method_="testmethod"; - header.version_="testversion"; - header.datasource_="testdata"; - header.since_=123; - header.tag_="testtag"; - header.date_="Mar 24 1973"; - - - - EcalADCToGeVConstant adctogev_constant; - EcalADCToGeVConstant adctogev_constant2; - - adctogev_constant.setEBValue(1.1); - adctogev_constant.setEEValue(2.2); - - std::string adctogevfile("/tmp/EcalADCToGeVConstant.xml"); - std::string adctogevfile2("/tmp/adctogev2.xml"); - - EcalADCToGeVXMLTranslator::writeXML(adctogevfile,header,adctogev_constant); - EcalADCToGeVXMLTranslator::readXML(adctogevfile,header2,adctogev_constant2); - EcalADCToGeVXMLTranslator::writeXML(adctogevfile2,header2,adctogev_constant2); - - - // Test Intercalibration - - - EcalLinearCorrections lin_constants; - EcalIntercalibConstants intercalib_constants; - EcalIntercalibErrors intercalib_errors; - - std::string linfile("/tmp/EcalLinearCorrections.xml"); - std::string intercalibfile("/tmp/EcalIntercalibConstants.xml"); - std::string intercaliberrfile("/tmp/EcalIntercalibErrors.xml"); - std::string intercalibfiledb("/tmp/EcalIntercalibConstantsDB.xml"); - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid = EBDetId::unhashIndex(cellid); - - EcalIntercalibConstant intercalib_constant = - EBDetId::unhashIndex(cellid).iphi(); - - EcalIntercalibConstant lin_constant = - EBDetId::unhashIndex(cellid).iphi(); - - EcalIntercalibError intercalib_error = intercalib_constant +1; - - lin_constants[rawid]=lin_constant; - intercalib_constants[rawid]=intercalib_constant; - intercalib_errors[rawid] =intercalib_error; - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - - if (EEDetId::validHashIndex(cellid)){ - uint32_t rawid = EEDetId::unhashIndex(cellid); - EcalLinearCorrection lin_constant = EEDetId::unhashIndex(cellid).ix();; - EcalIntercalibConstant intercalib_constant = EEDetId::unhashIndex(cellid).ix();; - EcalIntercalibError intercalib_error = intercalib_constant +1; - - lin_constants[rawid]=lin_constant; - intercalib_constants[rawid]=intercalib_constant; - intercalib_errors[rawid]=intercalib_error; - } // if - } - - - - EcalLinearCorrectionsXMLTranslator::writeXML(linfile,header, - lin_constants); - - EcalIntercalibConstantsXMLTranslator::writeXML(intercalibfile,header, - intercalib_constants); - - EcalIntercalibErrorsXMLTranslator::writeXML(intercaliberrfile,header, - intercalib_errors); - - EcalIntercalibConstants lin_constants2; - EcalIntercalibConstants intercalib_constants2; - EcalIntercalibErrors intercalib_errors2; - - - EcalLinearCorrectionsXMLTranslator::readXML(linfile,header2, - lin_constants2); - - EcalIntercalibConstantsXMLTranslator::readXML(intercalibfile,header2, - intercalib_constants2); - - EcalIntercalibErrorsXMLTranslator::readXML(intercaliberrfile,header2, - intercalib_errors2); - - std::string linfile2("/tmp/linfile-2.xml"); - std::string intercalibfile2("/tmp/intercalibfile-2.xml"); - std::string intercaliberrfile2("/tmp/intercaliberrfile-2.xml"); - - EcalLinearCorrectionsXMLTranslator::writeXML(linfile2, - header2, - lin_constants2); - EcalIntercalibConstantsXMLTranslator::writeXML(intercalibfile2, - header2, - intercalib_constants2); - - EcalIntercalibErrorsXMLTranslator::writeXML(intercaliberrfile,header2, - intercalib_errors2); - - cout << "Done testing Intercalib abd Linear Corrections" << endl; - - // Test Timing Intercalibration - - - EcalTimeCalibConstants timeCalib_constants; - EcalTimeCalibErrors timeCalib_errors; - - std::string timeCalibFile("/tmp/EcalTimeCalibConstants.xml"); - std::string timeCalibErrFile("/tmp/EcalTimeCalibErrors.xml"); - std::string timeCalibFileDB("/tmp/EcalTimeCalibConstantsDB.xml"); - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid = EBDetId::unhashIndex(cellid); - - EcalTimeCalibConstant timeCalib_constant = - EBDetId::unhashIndex(cellid).iphi(); - - EcalTimeCalibError timeCalib_error = timeCalib_constant +1; - - timeCalib_constants[rawid]=timeCalib_constant; - timeCalib_errors[rawid] =timeCalib_error; - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - - if (EEDetId::validHashIndex(cellid)){ - uint32_t rawid = EEDetId::unhashIndex(cellid); - EcalTimeCalibConstant timeCalib_constant = EEDetId::unhashIndex(cellid).ix();; - EcalTimeCalibError timeCalib_error = timeCalib_constant +1; - - timeCalib_constants[rawid]=timeCalib_constant; - timeCalib_errors[rawid]=timeCalib_error; - } // if - } - - - - EcalTimeCalibConstantsXMLTranslator::writeXML(timeCalibFile,header, - timeCalib_constants); - - EcalTimeCalibErrorsXMLTranslator::writeXML(timeCalibErrFile,header, - timeCalib_errors); - - EcalTimeCalibConstants timeCalib_constants2; - EcalTimeCalibErrors timeCalib_errors2; - - - EcalTimeCalibConstantsXMLTranslator::readXML(timeCalibFile,header2, - timeCalib_constants2); - - EcalTimeCalibErrorsXMLTranslator::readXML(timeCalibErrFile,header, - timeCalib_errors2); - - std::string timeCalibFile2("/tmp/timeCalibFile-2.xml"); - std::string timeCalibErrFile2("/tmp/timeCalibErrFile-2.xml"); - - EcalTimeCalibConstantsXMLTranslator::writeXML(timeCalibFile2, - header2, - timeCalib_constants2); - - EcalTimeCalibErrorsXMLTranslator::writeXML(timeCalibErrFile2,header2, - timeCalib_errors2); - cout << "Done testing timing intercalib " << endl; - - // test xtalgroup - - EcalWeightGroupXMLTranslator grouptrans; - - EcalWeightXtalGroups groups; - - std::string groupfile("/tmp/EcalWeightXtalGroups.xml"); - - for (int cellid = 0 ; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid = EBDetId::unhashIndex(cellid); - // a random gid - EcalXtalGroupId gid( EBDetId::unhashIndex(cellid).iphi()); - groups[rawid]=gid; - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - - if (EEDetId::validHashIndex(cellid)){ - uint32_t rawid = EEDetId::unhashIndex(cellid); - // a random gid - EcalXtalGroupId gid( EEDetId::unhashIndex(cellid).ix()); - groups[rawid]=gid; - } // if - } - - - - grouptrans.writeXML(groupfile,header,groups); - - EcalWeightXtalGroups groups2; - - grouptrans.readXML(groupfile,header2,groups2); - - std::string groupfile2("/tmp/group-2.xml"); - - grouptrans.writeXML(groupfile2,header2,groups2); - - cout << "Done testing groups " << endl; - - EcalGainRatiosXMLTranslator transGainRatios; - - EcalGainRatios gainratios; - - std::string filenamegr("/tmp/EcalGainRatios.xml"); - std::string newfilegr("/tmp/gainratios-2.xml"); - - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - EcalMGPAGainRatio ecalGR; - ecalGR.setGain12Over6(2.); - ecalGR.setGain6Over1(5.); - - gainratios.insert(std::make_pair(EBDetId::unhashIndex(cellid),ecalGR)); - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EE cells - - if (EEDetId::validHashIndex(cellid)){ - EcalMGPAGainRatio ecalGR; - ecalGR.setGain12Over6(2.); - ecalGR.setGain6Over1(5.); - gainratios.insert(std::make_pair(EEDetId::unhashIndex(cellid),ecalGR)); - } // if - } - - - transGainRatios.writeXML(filenamegr,header,gainratios); - - EcalGainRatios gainratios2; - transGainRatios.readXML(filenamegr,header2,gainratios2); - - - transGainRatios.writeXML(newfilegr,header2,gainratios2); - - - cout << "Done testing gainratios " << endl; - - EcalChannelStatusXMLTranslator transChannelStatus; - - EcalChannelStatus channelstatus; - - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - EcalChannelStatusCode ecalCSC = EcalChannelStatusCode(16); - - uint32_t rawid= EBDetId::unhashIndex(cellid); - - channelstatus[rawid]=ecalCSC; - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on Ee cells - - if (EEDetId::validHashIndex(cellid)){ - - uint32_t rawid= EEDetId::unhashIndex(cellid); - EcalChannelStatusCode ecalCSC = EcalChannelStatusCode(35); - channelstatus[rawid]=ecalCSC; - } // if - } - - std::string cscfile("/tmp/EcalChannelStatus.xml"); - - transChannelStatus.writeXML(cscfile,header,channelstatus); - - EcalChannelStatus channelstatus2; - - transChannelStatus.readXML(cscfile,header2,channelstatus2); - - std::string cscfile2("/tmp/cscfile-2.xml"); - - transChannelStatus.writeXML(cscfile2,header2,channelstatus2); - - - cout << "Done testing channelstatus " << endl; - - EcalTBWeightsXMLTranslator transWeight; - - EcalWeightSet weightset; - - - for(int i=0;i<3;i++) - { - for(int k=0;k<10;k++) - { - weightset.getWeightsBeforeGainSwitch()(i,k) = 1.2*k; - weightset.getWeightsAfterGainSwitch()(i,k) = 1.2*k; - } - } - - - - for(int i=0;i<10;i++) - { - for(int k=0;k<10;k++) - { - weightset.getChi2WeightsBeforeGainSwitch()(i,k) = 1.2*k; - weightset.getChi2WeightsAfterGainSwitch()(i,k) = 1.2*k; - } - } - - EcalXtalGroupId gid=1; - EcalTBWeights::EcalTDCId tid=2; - - - EcalTBWeights tbw; - tbw.setValue(gid,tid,weightset); - - - std::string filew("/tmp/EcalTBWeights.xml"); - std::string filew2("/tmp/tbweight2.xml"); - - transWeight.writeXML(filew,header,tbw); - - - EcalTBWeights tbw2; - - transWeight.readXML(filew,header2,tbw2); - - transWeight.writeXML(filew2,header2,tbw2); - - - // test laser - - std::string filelaser("/tmp/EcalLaserAPDPNratios.xml"); - std::string filelaser2("/tmp/EcalLaserAPDPNratios-2.xml"); - - EcalLaserAPDPNRatios laserrecord1; - EcalLaserAPDPNRatios laserrecord2; - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid= EBDetId::unhashIndex(cellid); - - EcalLaserAPDPNRatios::EcalLaserAPDPNpair pair; - pair.p1 =1; - pair.p2 =2; - pair.p3 =3; - - laserrecord1.setValue(rawid,pair); - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on Ee cells - - if (EEDetId::validHashIndex(cellid)){ - - uint32_t rawid= EEDetId::unhashIndex(cellid); - EcalLaserAPDPNRatios::EcalLaserAPDPNpair pair; - pair.p1 =1; - pair.p2 =2; - pair.p3 =3; - - laserrecord1.setValue(rawid,pair); - - } // if - } - - EcalLaserAPDPNRatiosXMLTranslator::writeXML(filelaser,header,laserrecord1); - EcalLaserAPDPNRatiosXMLTranslator::readXML(filelaser,header2,laserrecord2); - EcalLaserAPDPNRatiosXMLTranslator::writeXML(filelaser2,header2,laserrecord2); - return 0; -} diff --git a/CondTools/L1Trigger/interface/Interval.h b/CondTools/L1Trigger/interface/Interval.h deleted file mode 100644 index 48217473b3f37..0000000000000 --- a/CondTools/L1Trigger/interface/Interval.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef CondTools_L1Trigger_Interval_h -#define CondTools_L1Trigger_Interval_h - -#include -#include - -namespace l1t -{ - /* Template class that will be used to represnt interval from one value to another. - * In general this class is not interested in what interval mark means, most of the time - * it should be number, time or something similar - * - * This class requires that TimeType should have defined operator == and < as defined in STL. - * It is enforced via sserts that start time is less then end time under provided operator <. - * TimeType requires empty constructor. - * - * Payload should have defined copy constructor and assigment operator. - */ - template - class Interval - { - public: - /* Construncts the class with provided start and end times. Payload is created - * with default constructor. - */ - Interval (const TimeType& start, const TimeType& end) - : m_start (start), m_end (end), isInvalid (false) - { assert (m_start <= m_end); } - - /* Constructs the class with given start and end times, as well as given payload. - */ - Interval (const TimeType& start, const TimeType& end, const PayloadType& payload) - : m_start(start), m_end (end), _payload (payload), isInvalid (false) {} - - /* Sets the payload to the given one. */ - void setPayload (const PayloadType& payload) { this->_payload = payload; } - /* Returns the payload */ - const PayloadType& payload () const { return this->_payload; } - - /* Returns start time */ - const TimeType & start () const { return this->m_start; } - /* Returns end time */ - const TimeType & end () const { return this->m_end; } - - /* Static member that will define an invalid interval. Two invalid interfaces are - * always considered equal. - */ - static Interval & invalid (); - - // Operator overloading - bool operator== (const Interval & other) const - { return (this->isInvalid == true && other.isInvalid == true ) || - (this->start () == other.start ()) && (this->end () == other.end () && - this->isInvalid == other.isInvalid); } - - bool operator!= (const Interval & other) const - { return ! (*this == other); } - - protected: - /* Private data */ - TimeType m_start; - TimeType m_end; - PayloadType _payload; - - /* flag that will check if this interval is invalid */ - bool isInvalid; - }; - - /* Manages a list of intervals and provides method to find interval that contains - * some value. - * - * Template parameters are used to manage Interval class, so all requirements to these - * parameters comes from Interval class - */ - template - class IntervalManager - { - public: - /* Adds one given interval to the list of intervals. - */ - void addInterval (const Interval & interval) - { intervalMap.insert (std::make_pair (interval.start (), interval)); } - - /* Removes all stored intervals from the list - */ - void clear () { intervalMap.clear (); } - - /* Returns interval that contaisn given time. If multiple intervals exists - * any of them is returned - */ - const Interval & find (const TimeType & time) const; - - protected: - /* Information to store list of intervals */ - typedef std::map > IntervalMap; - IntervalMap intervalMap; - }; - -} // namespace - -// implementation -#include "CondTools/L1Trigger/src/Interval.icc" - -#endif diff --git a/CondTools/RPC/interface/L1RPCHwConfigDBWriter.h b/CondTools/RPC/interface/L1RPCHwConfigDBWriter.h deleted file mode 100644 index 5ac0c70158af1..0000000000000 --- a/CondTools/RPC/interface/L1RPCHwConfigDBWriter.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef L1RPCHWCONFIGDBWRITER -#define L1RPCHWCONFIGDBWRITER - -#include "CondCore/PopCon/interface/PopConAnalyzer.h" -#include "CondTools/RPC/interface/L1RPCHwConfigSourceHandler.h" - - -class L1RPCHwConfigDBWriter : public popcon::PopConAnalyzer -{ - public: - L1RPCHwConfigDBWriter(const edm::ParameterSet&); - private: - void initSource(const edm::Event& evt, const edm::EventSetup& est); - int m_validate; -}; - - -#endif diff --git a/CondTools/RPC/interface/RPCEMapDBWriter.h b/CondTools/RPC/interface/RPCEMapDBWriter.h deleted file mode 100644 index 37175c3ade0b4..0000000000000 --- a/CondTools/RPC/interface/RPCEMapDBWriter.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef RPCEMAPDBWRITER -#define RPCEMAPDBWRITER - -#include "CondCore/PopCon/interface/PopConAnalyzer.h" -#include "CondTools/RPC/interface/RPCEMapSourceHandler.h" - - -class RPCEMapDBWriter : public popcon::PopConAnalyzer -{ - public: - RPCEMapDBWriter(const edm::ParameterSet&); - private: - void initSource(const edm::Event& evt, const edm::EventSetup& est); - int m_validate; -}; - - -#endif diff --git a/CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h b/CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h deleted file mode 100644 index 115599f4b0aef..0000000000000 --- a/CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CondTools_SiStrip_SiStripCondObjBuilderBase_H -#define CondTools_SiStrip_SiStripCondObjBuilderBase_H - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include -#include - -template -class SiStripCondObjBuilderBase { -public: - SiStripCondObjBuilderBase(const edm::ParameterSet& pset) : _pset(pset){}; - virtual ~SiStripCondObjBuilderBase() noexcept(false){}; - - virtual void initialize(){}; - - /** Returns MetaData information in a stringstream */ - virtual void getMetaDataString(std::stringstream& ss){}; - - /** Check MetaData information in a stringstream */ - virtual bool checkForCompatibility(std::string ss) { return true; } - - /** Returns the CondObj */ - virtual void getObj(T*& obj){}; - -protected: - T* obj_; - edm::ParameterSet _pset; -}; - -#endif // CondTools_SiStrip_SiStripCondObjBuilderBase_H diff --git a/CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h b/CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h deleted file mode 100644 index 7e0b86c9b86d2..0000000000000 --- a/CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CondTools_SiStrip_SiStripDepCondObjBuilderBase_H -#define CondTools_SiStrip_SiStripDepCondObjBuilderBase_H - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include -#include - -template -class SiStripDepCondObjBuilderBase { -public: - SiStripDepCondObjBuilderBase(const edm::ParameterSet& pset) : _pset(pset){}; - virtual ~SiStripDepCondObjBuilderBase(){}; - - virtual void initialize(){}; - - /** Returns MetaData information in a stringstream */ - virtual void getMetaDataString(std::stringstream& ss){}; - - /** Check MetaData information in a stringstream */ - virtual bool checkForCompatibility(std::string ss) { return true; } - - /** Returns the CondObj */ - virtual void getObj(T*& obj, const D* depObj){}; - -protected: - T* obj_; - edm::ParameterSet _pset; -}; - -#endif // CondTools_SiStrip_SiStripDepCondObjBuilderBase_H diff --git a/DataFormats/BTauReco/interface/PFCombinedTauTagInfo.h b/DataFormats/BTauReco/interface/PFCombinedTauTagInfo.h deleted file mode 100644 index aa7354fb2659e..0000000000000 --- a/DataFormats/BTauReco/interface/PFCombinedTauTagInfo.h +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef DataFormats_BTauReco_PFCombinedTauTagInfo_h -#define DataFormats_BTauReco_PFCombinedTauTagInfo_h - -/* class PFCombinedTauTagInfo - * Extended object for the Particle Flow Tau Combination algorithm, - * created: Apr 21 2007, - * revised: Jun 23 2007, - * author: Ludovic Houchu. - */ - -#include -#include - -#include "DataFormats/BTauReco/interface/RefMacros.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" -#include "DataFormats/BTauReco/interface/BaseTagInfo.h" -#include "DataFormats/BTauReco/interface/PFIsolatedTauTagInfo.h" - - - - -namespace reco { - class PFCombinedTauTagInfo : public BaseTagInfo{ - public: - PFCombinedTauTagInfo() { - candidate_selectedByPFChargedHadrCands_=false; - electronTagged_=false; - muonTagged_=false; - PFChargedHadrCands_.clear(); - selectedPFChargedHadrCands_.clear(); - signalPFChargedHadrCands_.clear(); - isolPFChargedHadrCands_.clear(); - leadPFChargedHadrCandsignedSipt_=NAN; - leadPFChargedHadrCandsignedSip3D_=NAN; - signedSflightpath_=NAN; - PFChargedHadrCandsEtJetEtRatio_=NAN; - PFNeutrHadrCandsE_=NAN; - PFNeutrHadrCandsN_=std::numeric_limits::quiet_NaN(); - PFNeutrHadrCandsRadius_=NAN; - PFGammaCandsE_=NAN; - isolPFGammaCandsE_=NAN; - PFGammaCandsN_=std::numeric_limits::quiet_NaN(); - PFGammaCandsRadius_=NAN; - PFGammaCandsEJetalternatERatio_=NAN; - isolPFGammaCandsEJetalternatERatio_=NAN; - PFGammaCandsERatio_=NAN; - alternatLorentzVect_.SetPx(NAN); - alternatLorentzVect_.SetPy(NAN); - alternatLorentzVect_.SetPz(NAN); - alternatLorentzVect_.SetE(NAN); - ECALEtleadPFChargedHadrCandPtRatio_=NAN; - HCALEtleadPFChargedHadrCandPtRatio_=NAN; - } - virtual ~PFCombinedTauTagInfo() {}; - - //the reference to the PFJet; - const PFJetRef& pfjetRef()const{return PFJetRef_;} - void setpfjetRef(const PFJetRef x){PFJetRef_=x;} - - //the reference to the PFIsolatedTauTagInfo; - const PFIsolatedTauTagInfoRef& isolatedtautaginfoRef()const{return PFIsolatedTauTagInfoRef_;} - void setisolatedtautaginfoRef(const PFIsolatedTauTagInfoRef x) {PFIsolatedTauTagInfoRef_=x;} - - //the PF charged hadron candidates contained in the PF Jet; - const PFCandidateRefVector& PFChargedHadrCands()const{return PFChargedHadrCands_;} - void setPFChargedHadrCands(const PFCandidateRefVector& x) {PFChargedHadrCands_=x;} - - //the PF charged hadron candidates considered in the isolation strip and signal cone selections; - const PFCandidateRefVector& selectedPFChargedHadrCands()const{return selectedPFChargedHadrCands_;} - void setselectedPFChargedHadrCands(const PFCandidateRefVector& x) {selectedPFChargedHadrCands_=x;} - - //the PF charged hadron candidates inside signal cone; - const PFCandidateRefVector& signalPFChargedHadrCands()const{return signalPFChargedHadrCands_;} - void setsignalPFChargedHadrCands(const PFCandidateRefVector& x) {signalPFChargedHadrCands_=x;} - - //the PF charged hadron candidates inside isolation band; - const PFCandidateRefVector& isolPFChargedHadrCands()const{return isolPFChargedHadrCands_;} - void setisolPFChargedHadrCands(const PFCandidateRefVector& x) {isolPFChargedHadrCands_=x;} - - virtual PFCombinedTauTagInfo* clone() const{return new PFCombinedTauTagInfo(*this );} - - // float JetTag::discriminator() returns 0. if candidate did not pass PF charged hadron candidates selection, - // 1. if candidate passed PF charged hadron candidates selection and did not contain PF gamma candidate(s), - // 0<= <=1 if candidate passed PF charged hadron candidates selection, contained PF gamma candidate(s) and went through the likelihood ratio mechanism, - // NaN the values of the likelihood functions PDFs are 0 (test the result of discriminator() with bool isnan(.)); - //computed with the parameters taken from the RecoTauTag/PFCombinedTauTag/data/ .cfi files - - bool selectedByPFChargedHadrCands()const{return(candidate_selectedByPFChargedHadrCands_);} - void setselectedByPFChargedHadrCands(bool x){candidate_selectedByPFChargedHadrCands_=x;} - - bool electronTagged()const{return(electronTagged_);} // true : passed PF charged hadron candidates sel., contains 1 signal charged hadron candidate, e-identified through (ECALEtleadPFChargedHadrCandPtRatio(),HCALEtleadPFChargedHadrCandPtRatio()) space; - void setelectronTagged(bool x){electronTagged_=x;} - - bool muonTagged()const{return(muonTagged_);} // true : passed PF charged hadron candidates sel., contains 1 signal charged hadron candidate, mu-identified through (ECALEtleadPFChargedHadrCandPtRatio(),HCALEtleadPFChargedHadrCandPtRatio()) space; - void setmuonTagged(bool x){muonTagged_=x;} - - double leadPFChargedHadrCandsignedSipt()const{return (leadPFChargedHadrCandsignedSipt_);} // NaN : failure; - void setleadPFChargedHadrCandsignedSipt(double x){leadPFChargedHadrCandsignedSipt_=x;} - - double leadPFChargedHadrCandsignedSip3D()const{return(leadPFChargedHadrCandsignedSip3D_);} // NaN : failure; - void setleadPFChargedHadrCandsignedSip3D(double x){leadPFChargedHadrCandsignedSip3D_=x;} - - double signedSflightpath()const{return (signedSflightpath_);} // NaN : failure, did not build a SV.; - void setsignedSflightpath(double x){signedSflightpath_=x;} - - // Et_PFchargedhadrcands/Etjet; - double PFChargedHadrCandsEtJetEtRatio()const{return(PFChargedHadrCandsEtJetEtRatio_);} - void setPFChargedHadrCandsEtJetEtRatio(double x){PFChargedHadrCandsEtJetEtRatio_=x;} - - // PF neutral hadron candidates E sum; - double PFNeutrHadrCandsE()const{return(PFNeutrHadrCandsE_);} - void setPFNeutrHadrCandsE(double x){PFNeutrHadrCandsE_=x;} - - int PFNeutrHadrCandsN()const{return(PFNeutrHadrCandsN_);} - void setPFNeutrHadrCandsN(int x){PFNeutrHadrCandsN_=x;} - - //mean DR_PFNeutrHadrcands-lead.PFcand.; - double PFNeutrHadrCandsRadius()const{return(PFNeutrHadrCandsRadius_);} // NaN : PFNeutrHadrCandsN()=0; - void setPFNeutrHadrCandsRadius(double x){PFNeutrHadrCandsRadius_=x;} - - // PF gamma candidates E sum; - double PFGammaCandsE()const{return(PFGammaCandsE_);} - void setPFGammaCandsE(double x){PFGammaCandsE_=x;} - - // isol. band PF gamma candidates E sum; - double isolPFGammaCandsE()const{return(isolPFGammaCandsE_);} - void setisolPFGammaCandsE(double x){isolPFGammaCandsE_=x;} - - int PFGammaCandsN()const{return(PFGammaCandsN_);} - void setPFGammaCandsN(int x){PFGammaCandsN_=x;} - - //mean DR_PFgammacands-lead.PFcand.; - double PFGammaCandsRadius()const{return(PFGammaCandsRadius_);} // NaN : PFGammaCandsN()=0; - void setPFGammaCandsRadius(double x){PFGammaCandsRadius_=x;} - - // E_PFgammacands / (E_PFgammacands + E_PFchargedhadrcands); - double PFGammaCandsEJetalternatERatio()const{return(PFGammaCandsEJetalternatERatio_);} - void setPFGammaCandsEJetalternatERatio(double x){PFGammaCandsEJetalternatERatio_=x;} - - // E_PFgammacands,isol.band / (E_PFgammacands + E_PFchargedhadrcands); - double isolPFGammaCandsEJetalternatERatio()const{return(isolPFGammaCandsEJetalternatERatio_);} - void setisolPFGammaCandsEJetalternatERatio(double x){isolPFGammaCandsEJetalternatERatio_=x;} - - // E_PFgammacands,isol.band / E_PFgammacands; - double PFGammaCandsERatio()const{return(PFGammaCandsERatio_);} // NaN : PFGammaCandsN()=0; - void setPFGammaCandsERatio(double x){PFGammaCandsERatio_=x;} - - math::XYZTLorentzVector alternatLorentzVect()const{return(alternatLorentzVect_);} // rec. charged hadr. candidates + rec. gamma candidates combined; - void setalternatLorentzVect(math::XYZTLorentzVector x){alternatLorentzVect_=x;} - - // EtECAL*/Pt_lead.PFcand. *using ECAL cell hits inside a DR cone around lead. charged hadr. candidate ECAL impact point direction; - double ECALEtleadPFChargedHadrCandPtRatio()const{return(ECALEtleadPFChargedHadrCandPtRatio_);} // NaN : failure when trying to find the lead. charged hadr. candidate contact on ECAL surface point; - void setECALEtleadPFChargedHadrCandPtRatio(double x){ECALEtleadPFChargedHadrCandPtRatio_=x;} - - // EtHCAL**/Pt_lead.PFcand.; **using HCAL tower hits inside a DR cone around lead. charged hadr. candidate ECAL impact point direction; - double HCALEtleadPFChargedHadrCandPtRatio()const{return(HCALEtleadPFChargedHadrCandPtRatio_);} // NaN : failure when trying to find the lead. charged hadr. candidate contact on ECAL surface point; - void setHCALEtleadPFChargedHadrCandPtRatio(double x){HCALEtleadPFChargedHadrCandPtRatio_=x;} - private: - PFJetRef PFJetRef_; - PFIsolatedTauTagInfoRef PFIsolatedTauTagInfoRef_; - PFCandidateRefVector PFChargedHadrCands_; - PFCandidateRefVector selectedPFChargedHadrCands_; - PFCandidateRefVector signalPFChargedHadrCands_; - PFCandidateRefVector isolPFChargedHadrCands_; - bool candidate_selectedByPFChargedHadrCands_; - bool electronTagged_; - bool muonTagged_; - double leadPFChargedHadrCandsignedSipt_; - double leadPFChargedHadrCandsignedSip3D_; - double signedSflightpath_; - double PFChargedHadrCandsEtJetEtRatio_; - double PFNeutrHadrCandsE_; - int PFNeutrHadrCandsN_; - double PFNeutrHadrCandsRadius_; - double PFGammaCandsE_; - double isolPFGammaCandsE_; - int PFGammaCandsN_; - double PFGammaCandsRadius_; - double PFGammaCandsEJetalternatERatio_; - double isolPFGammaCandsEJetalternatERatio_; - double PFGammaCandsERatio_; - math::XYZTLorentzVector alternatLorentzVect_; - double ECALEtleadPFChargedHadrCandPtRatio_; - double HCALEtleadPFChargedHadrCandPtRatio_; - }; - - DECLARE_EDM_REFS( PFCombinedTauTagInfo ) - -} - -#endif // DataFormats_BTauReco_PFCombinedTauTagInfo_h diff --git a/DataFormats/BTauReco/interface/PFIsolatedTauTagInfo.h b/DataFormats/BTauReco/interface/PFIsolatedTauTagInfo.h deleted file mode 100644 index 1a279e21e2ee3..0000000000000 --- a/DataFormats/BTauReco/interface/PFIsolatedTauTagInfo.h +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef DataFormats_BTauReco_PFIsolatedTauTagInfo_h -#define DataFormats_BTauReco_PFIsolatedTauTagInfo_h - -/* class PFIsolatedTauTagInfo - * Extended object for the Particle Flow Tau Isolation algorithm, - * contains the result and the methods used in the PFConeIsolation Algorithm - * created: Apr 21 2007, - * revised: Jun 23 2007, - * authors: Simone Gennai, Ludovic Houchu - */ - -#include - -#include "DataFormats/BTauReco/interface/RefMacros.h" - -#include "Math/GenVector/PxPyPzE4D.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "DataFormats/BTauReco/interface/BaseTagInfo.h" - - - - - - -const int PFChargedHadrCand_codenumber=1; -const int PFNeutrHadrCand_codenumber=5; -const int PFGammaCand_codenumber=4; - -const int PFRecTrack_codenumber=1; -const int PFRecECALClus_codenumber=4; -const int PFRecHCALClus_codenumber=5; - -namespace reco{ - class PFIsolatedTauTagInfo : public BaseTagInfo{ - public: - PFIsolatedTauTagInfo() {} - PFIsolatedTauTagInfo(PFCandidateRefVector PFCands){ - initialPFCands_=PFCands; - PFCands_=PFCands; - for(PFCandidateRefVector::const_iterator iPFCand=PFCands_.begin();iPFCand!=PFCands_.end();iPFCand++){ - if ((**iPFCand).particleId()==PFChargedHadrCand_codenumber) initialPFChargedHadrCands_.push_back(*iPFCand); - if ((**iPFCand).particleId()==PFNeutrHadrCand_codenumber) initialPFNeutrHadrCands_.push_back(*iPFCand); - if ((**iPFCand).particleId()==PFGammaCand_codenumber) initialPFGammaCands_.push_back(*iPFCand); - } - PFChargedHadrCands_=initialPFChargedHadrCands_; - PFNeutrHadrCands_=initialPFNeutrHadrCands_; - PFGammaCands_=initialPFGammaCands_; - alternatLorentzVect_.SetPx(NAN); - alternatLorentzVect_.SetPy(NAN); - alternatLorentzVect_.SetPz(NAN); - alternatLorentzVect_.SetE(NAN); - passedtrackerisolation_=false; - passedECALisolation_=false; - } - virtual ~PFIsolatedTauTagInfo(){}; - virtual PFIsolatedTauTagInfo* clone()const{return new PFIsolatedTauTagInfo(*this);} - - //get the PFCandidates's which compose the PF jet and may be have been filtered by filterPFChargedHadrCands(.,.,.,.,.,.), filterPFNeutrHadrCands(.), filterPFGammaCands(.) member functions - const PFCandidateRefVector& PFCands() const {return PFCands_;} - const PFCandidateRefVector& PFChargedHadrCands() const {return PFChargedHadrCands_;} - const PFCandidateRefVector& PFNeutrHadrCands() const {return PFNeutrHadrCands_;} - const PFCandidateRefVector& PFGammaCands() const {return PFGammaCands_;} - - // rec. jet Lorentz-vector combining charged hadr. PFCandidate's and gamma PFCandidate's - math::XYZTLorentzVector alternatLorentzVect()const{return(alternatLorentzVect_);} - void setalternatLorentzVect(math::XYZTLorentzVector x){alternatLorentzVect_=x;} - - //the reference to the PFJet - const PFJetRef& pfjetRef()const{return PFJetRef_;} - void setpfjetRef(const PFJetRef x){PFJetRef_=x;} - - //JetTag::discriminator() computed with the parameters taken from the RecoTauTag/PFConeIsolation/data/pfConeIsolation.cfi file - - // true if a lead. PFCandidate exists and no charged hadron PFCandidate was found in an DR isolation ring around it (DR isolation ring limits defined in the RecoTauTag/PFConeIsolation/data/pfConeIsolation.cfi file - bool passedtrackerisolation()const{return passedtrackerisolation_;} - void setpassedtrackerisolation(bool x){passedtrackerisolation_=x;} - - // true if a lead. PFCandidate exists and no gamma PFCandidate was found in an DR isolation ring around it (DR isolation ring limits defined in the RecoTauTag/PFConeIsolation/data/pfConeIsolation.cfi file - bool passedECALisolation()const{return passedECALisolation_;} - void setpassedECALisolation(bool x){passedECALisolation_=x;} - - //methods to be used to recompute the isolation with a new set of parameters - double discriminatorByIsolPFCandsN(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFCandsN(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFChargedHadrCandsN(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFChargedHadrCandsN(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFNeutrHadrCandsN(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFNeutrHadrCandsN(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFGammaCandsN(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFGammaCandsN(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFCandsEtSum(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFCandsEtSum(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFChargedHadrCandsEtSum(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFChargedHadrCandsEtSum(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFNeutrHadrCandsEtSum(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFNeutrHadrCandsEtSum(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFGammaCandsEtSum(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFGammaCandsEtSum(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - - // return all PFCandidate's in a cone of size "conesize" around a direction "myVector" - const PFCandidateRefVector PFCandsInCone(const math::XYZVector myVector,const float conesize,const float minPt)const; - const PFCandidateRefVector PFChargedHadrCandsInCone(const math::XYZVector myVector,const float conesize,const float minPt)const; - const PFCandidateRefVector PFNeutrHadrCandsInCone(const math::XYZVector myVector,const float conesize,const float minPt)const; - const PFCandidateRefVector PFGammaCandsInCone(const math::XYZVector myVector,const float conesize,const float minPt)const; - - // return all PFCandidate's in a band defined by inner(size "innercone_size") and outer(size "outercone_size") cones around a direction "myVector" - const PFCandidateRefVector PFCandsInBand(const math::XYZVector myVector,const float innercone_size,const float outercone_size,const float minPt)const; - const PFCandidateRefVector PFChargedHadrCandsInBand(const math::XYZVector myVector,const float innercone_size,const float outercone_size,const float minPt)const; - const PFCandidateRefVector PFNeutrHadrCandsInBand(const math::XYZVector myVector,const float innercone_size,const float outercone_size,const float minPt)const; - const PFCandidateRefVector PFGammaCandsInBand(const math::XYZVector myVector,const float innercone_size,const float outercone_size,const float minPt)const; - - //return the leading PFCandidate in a given cone around the jet axis or a given direction - const PFCandidateRef leadPFCand(const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFCand(const math::XYZVector myVector,const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFChargedHadrCand(const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFChargedHadrCand(const math::XYZVector myVector,const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFNeutrHadrCand(const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFNeutrHadrCand(const math::XYZVector myVector,const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFGammaCand(const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFGammaCand(const math::XYZVector myVector,const float matchingcone_size, const float minPt)const; - - void filterPFChargedHadrCands(double ChargedHadrCand_tkminPt,int ChargedHadrCand_tkminPixelHitsn,int ChargedHadrCand_tkminTrackerHitsn,double ChargedHadrCand_tkmaxipt,double ChargedHadrCand_tkmaxChi2,double ChargedHadrCand_tktorefpointDZ,bool UsePVconstraint,double PVtx_Z,bool UseOnlyChargedHadr_for_LeadCand,double LeadChargedHadrCandtoJet_MatchingConeSize,double LeadChargedHadrCand_minPt); - void filterPFNeutrHadrCands(double NeutrHadrCand_HcalclusminEt); - void filterPFGammaCands(double GammaCand_EcalclusminEt); - void removefilters(); - private: - PFJetRef PFJetRef_; - PFCandidateRefVector initialPFCands_; - PFCandidateRefVector PFCands_; - PFCandidateRefVector initialPFChargedHadrCands_; - PFCandidateRefVector PFChargedHadrCands_; - PFCandidateRefVector initialPFNeutrHadrCands_; - PFCandidateRefVector PFNeutrHadrCands_; - PFCandidateRefVector initialPFGammaCands_; - PFCandidateRefVector PFGammaCands_; - math::XYZTLorentzVector alternatLorentzVect_; - bool passedtrackerisolation_; - bool passedECALisolation_; - }; - - DECLARE_EDM_REFS( PFIsolatedTauTagInfo ) - -} - -#endif // DataFormats_BTauReco_PFIsolatedTauTagInfo_h diff --git a/DataFormats/BTauReco/interface/TrackIPData.h b/DataFormats/BTauReco/interface/TrackIPData.h deleted file mode 100644 index 4ac87ce7eb346..0000000000000 --- a/DataFormats/BTauReco/interface/TrackIPData.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TrackIPData_h -#define TrackIPData_h - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/GeometryVector/interface/GlobalVector.h" -#include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h" - -#include "DataFormats/JetReco/interface/JetTracksAssociation.h" - -namespace reco { - - -struct TrackIPData -{ - Measurement1D impactParameter3D; - Measurement1D impactParameter2D; - //float decayLen; - //float decayLenError; -}; - -} -#endif - diff --git a/DataFormats/Common/interface/NewPolicy.h b/DataFormats/Common/interface/NewPolicy.h deleted file mode 100644 index d66ae410ee192..0000000000000 --- a/DataFormats/Common/interface/NewPolicy.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef DataFormats_Common_NewPolicy_h -#define DataFormats_Common_NewPolicy_h - -namespace edm { - template - struct NewPolicy{ - static T * clone(const T & t) { - return new T(t); - } - }; -} - -#endif diff --git a/DataFormats/Common/interface/OwnArray.h b/DataFormats/Common/interface/OwnArray.h deleted file mode 100644 index 73976f87bf97e..0000000000000 --- a/DataFormats/Common/interface/OwnArray.h +++ /dev/null @@ -1,506 +0,0 @@ -#ifndef DataFormats_Common_OwnArray_h -#define DataFormats_Common_OwnArray_h - -#include "DataFormats/Common/interface/CMS_CLASS_VERSION.h" -#include "DataFormats/Common/interface/ClonePolicy.h" -#include "DataFormats/Common/interface/fillPtrVector.h" -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/setPtr.h" -#include "DataFormats/Common/interface/traits.h" - -#if defined CMS_USE_DEBUGGING_ALLOCATOR -#include "DataFormats/Common/interface/debugging_allocator.h" -#endif -#include "FWCore/Utilities/interface/EDMException.h" - -#include -#include -#include -#include - -namespace edm { - class ProductID; - template > - class OwnArray { - private: - typedef OwnArray self; - typedef std::vector base; - public: - typedef unsigned int size_type; - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef T const& const_reference; - typedef P policy_type; - - class iterator; - class const_iterator { - public: - typedef T value_type; - typedef T* pointer; - typedef T const& reference; - typedef ptrdiff_t difference_type; - typedef typename base::const_iterator::iterator_category iterator_category; - const_iterator(pointer const * it) : i(it) { } - const_iterator(iterator const& it) : i(it.i) { } - const_iterator() {} - const_iterator& operator++() { ++i; return *this; } - const_iterator operator++(int) { const_iterator ci = *this; ++i; return ci; } - const_iterator& operator--() { --i; return *this; } - const_iterator operator--(int) { const_iterator ci = *this; --i; return ci; } - difference_type operator-(const_iterator const& o) const { return i - o.i; } - const_iterator operator+(difference_type n) const { return const_iterator(i + n); } - const_iterator operator-(difference_type n) const { return const_iterator(i - n); } - bool operator<(const_iterator const& o) const { return i < o.i; } - bool operator==(const_iterator const& ci) const { return i == ci.i; } - bool operator!=(const_iterator const& ci) const { return i != ci.i; } - T const& operator *() const { return **i; } - // operator T const*() const { return & **i; } - T const* operator->() const { return & (operator*()); } - const_iterator & operator +=(difference_type d) { i += d; return *this; } - const_iterator & operator -=(difference_type d) { i -= d; return *this; } - reference operator[](difference_type d) const { return *const_iterator(i+d); } // for boost::iterator_range [] - private: - pointer const * i; - }; - class iterator { - public: - typedef T value_type; - typedef T * pointer; - typedef T & reference; - typedef ptrdiff_t difference_type; - typedef typename base::iterator::iterator_category iterator_category; - iterator(pointer * it) : i(it) { } - iterator() {} - iterator& operator++() { ++i; return *this; } - iterator operator++(int) { iterator ci = *this; ++i; return ci; } - iterator& operator--() { --i; return *this; } - iterator operator--(int) { iterator ci = *this; --i; return ci; } - difference_type operator-(iterator const& o) const { return i - o.i; } - iterator operator+(difference_type n) const { return iterator(i + n); } - iterator operator-(difference_type n) const { return iterator(i - n); } - bool operator<(iterator const& o) const { return i < o.i; } - bool operator==(iterator const& ci) const { return i == ci.i; } - bool operator!=(iterator const& ci) const { return i != ci.i; } - T & operator *() const { return **i; } - // operator T *() const { return & **i; } - //T *& get() { return *i; } - T * operator->() const { return & (operator*()); } - iterator & operator +=(difference_type d) { i += d; return *this; } - iterator & operator -=(difference_type d) { i -= d; return *this; } - reference operator[](difference_type d) const { return *iterator(i+d); } // for boost::iterator_range [] - private: - pointer * i; - friend class const_iterator; - friend class OwnArray; - }; - - - OwnArray(); - OwnArray(size_type); - OwnArray(OwnArray const&); -#if defined(__GXX_EXPERIMENTAL_CXX0X__) - OwnArray(OwnArray&&); -#endif - - ~OwnArray(); - - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - size_type size() const; - bool empty() const; - reference operator[](size_type); - const_reference operator[](size_type) const; - - self& operator=(self const&); -#if defined(__GXX_EXPERIMENTAL_CXX0X__) - self& operator=(self&&); -#endif - - - void reserve(size_t){} - size_type capacity() const { return MAX_SIZE;} - template void push_back(D*& d); - template void push_back(D* const& d); - template void push_back(std::unique_ptr d); - void push_back(T const& valueToCopy); - bool is_back_safe() const; - void pop_back(); - reference back(); - const_reference back() const; - reference front(); - const_reference front() const; - pointer const * data() const; - void clear(); - iterator erase(iterator pos); - iterator erase(iterator first, iterator last); - template - void sort(S s); - void sort(); - - void swap(self& other); - - void fillView(ProductID const& id, - std::vector& pointers, - FillViewHelperVector& helpers) const; - - void setPtr(std::type_info const& toType, - unsigned long index, - void const*& ptr) const; - - void fillPtrVector(std::type_info const& toType, - std::vector const& indices, - std::vector& ptrs) const; - - - //Used by ROOT storage - CMS_CLASS_VERSION(11) - - private: - void destroy(); - template - struct Ordering { - Ordering(O const& c) : comp(c) { } - bool operator()(T const* t1, T const* t2) const { - return comp(*t1, *t2); - } - private: - O comp; - }; - template - static Ordering ordering(O const& comp) { - return Ordering(comp); - } - pointer data_[MAX_SIZE]; - size_type size_; - }; - - template - inline OwnArray::OwnArray() : data_{{0}}, size_(0) { - } - - template - inline OwnArray::OwnArray(size_type n) : data_{{0}}, size_(n) { - } - - template - inline OwnArray::OwnArray(OwnArray const& o) : size_(o.size()) { - size_type current = 0; - for (const_iterator i = o.begin(), e = o.end(); i != e; ++i,++current) - data_[current] = policy_type::clone(*i); - } - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) - template - inline OwnArray::OwnArray(OwnArray&& o) { - std::swap_ranges(data_,data_+M, o.data_); - } -#endif - - template - inline OwnArray::~OwnArray() { - destroy(); - } - - template - inline OwnArray& OwnArray::operator=(OwnArray const& o) { - OwnArray temp(o); - swap(temp); - return *this; - } - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) - template - inline OwnArray& OwnArray::operator=(OwnArray&& o) { - std::swap_ranges(data_,data_+M, o.data_); - return *this; - } -#endif - - - template - inline typename OwnArray::iterator OwnArray::begin() { - return iterator(data_); - } - - template - inline typename OwnArray::iterator OwnArray::end() { - return iterator(data_+size()); - } - - template - inline typename OwnArray::const_iterator OwnArray::begin() const { - return const_iterator(data_); - } - - template - inline typename OwnArray::const_iterator OwnArray::end() const { - return const_iterator(data_+size()); - } - - template - inline typename OwnArray::size_type OwnArray::size() const { - return size_; - } - - template - inline bool OwnArray::empty() const { - return 0==size_; - } - - template - inline typename OwnArray::reference OwnArray::operator[](size_type n) { - return *data_[n]; - } - - template - inline typename OwnArray::const_reference OwnArray::operator[](size_type n) const { - return *data_[n]; - } - - template - template - inline void OwnArray::push_back(D*& d) { - // C++ does not yet support rvalue references, so d should only be - // able to bind to an lvalue. - // This should be called only for lvalues. - data_[size_++]=d; - d = 0; - } - - template - template - inline void OwnArray::push_back(D* const& d) { - - // C++ allows d to be bound to an lvalue or rvalue. But the other - // signature should be a better match for an lvalue (because it - // does not require an lvalue->rvalue conversion). Thus this - // signature should only be chosen for rvalues. - data_[size_++]=d; - } - - - template - template - inline void OwnArray::push_back(std::unique_ptr d) { - data_[size_++]=d.release(); - } - - - template - inline void OwnArray::push_back(T const& d) { - data_[size_++]=policy_type::clone(d); - } - - - template - inline void OwnArray::pop_back() { - // We have to delete the pointed-to thing, before we squeeze it - // out of the vector... - delete data_[--size_]; - } - - template - inline bool OwnArray::is_back_safe() const { - return data_[size_-1] != 0; - } - - template - inline typename OwnArray::reference OwnArray::back() { - pointer result = data_[size_-1]; - if (result == 0) { - Exception::throwThis(errors::NullPointerError, - "In OwnArray::back() we have intercepted an attempt to dereference a null pointer\n" - "Since OwnArray is allowed to contain null pointers, you much assure that the\n" - "pointer at the end of the collection is not null before calling back()\n" - "if you wish to avoid this exception.\n" - "Consider using OwnArray::is_back_safe()\n"); - } - return *result; - } - - template - inline typename OwnArray::const_reference OwnArray::back() const { - pointer const * result = data_[size_-1]; - if (result == 0) { - Exception::throwThis(errors::NullPointerError, - "In OwnArray::back() we have intercepted an attempt to dereference a null pointer\n" - "Since OwnArray is allowed to contain null pointers, you much assure that the\n" - "pointer at the end of the collection is not null before calling back()\n" - "if you wish to avoid this exception.\n" - "Consider using OwnArray::is_back_safe()\n"); - } - return *result; - } - - template - inline typename OwnArray::reference OwnArray::front() { - return *data_[0]; - } - - template - inline typename OwnArray::const_reference OwnArray::front() const { - return *data_[0]; - } - - template - inline void OwnArray::destroy() { - pointer * b = data_, * e = data_+size(); - for(pointer * i = b; i != e; ++ i) - delete * i; - } - - template - inline typename OwnArray::pointer const * OwnArray::data() const { - return data_; - } - - template - inline void OwnArray::clear() { - destroy(); - size_=0; - } - - template - typename OwnArray::iterator OwnArray::erase(iterator pos) { - pointer * b = pos.i; - delete *b; - pointer * e = data_+size(); - for(pointer * i = b; i != e-1; ++ i) *i = *(i+1); - size_--; - return iterator(b); - } - - template - typename OwnArray::iterator OwnArray::erase(iterator first, iterator last) { - pointer * b = first.i, * e = last.i; - for(pointer * i = b; i != e; ++ i) delete * i; - pointer * l = data_+size(); - auto ib=b; - for(pointer * i = e; i != l; ++i) *(ib++) = *i; - size_ -= (e-b); - return iterator(b); - } - - template template - void OwnArray::sort(S comp) { - std::sort(data_, data_+size(), ordering(comp)); - } - - template - void OwnArray::sort() { - std::sort(data_, data_+size(), ordering(std::less())); - } - - template - inline void OwnArray::swap(OwnArray& other) { - std::swap_ranges(data_,data_+M, other.data_); - } - - template - void OwnArray::fillView(ProductID const& id, - std::vector& pointers, - FillViewHelperVector& helpers) const { - typedef Ref ref_type ; - typedef reftobase::RefHolder holder_type; - - size_type numElements = this->size(); - pointers.reserve(numElements); - helpers.reserve(numElements); - size_type key = 0; - for(typename base::const_iterator i=data_.begin(), e=data_.end(); i!=e; ++i, ++key) { - - if (*i == 0) { - Exception::throwThis(errors::NullPointerError, - "In OwnArray::fillView() we have intercepted an attempt to put a null pointer\n" - "into a View and that is not allowed. It is probably an error that the null\n" - "pointer was in the OwnArray in the first place.\n"); - } - else { - pointers.push_back(*i); - holder_type h(ref_type(id, *i, key,this)); - helpers.push_back(&h); - } - } - } - - template - inline void swap(OwnArray& a, OwnArray& b) { - a.swap(b); - } - - //---------------------------------------------------------------------- - // - // Free function template to support creation of Views. - - template - inline - void - fillView(OwnArray const& obj, - ProductID const& id, - std::vector& pointers, - FillViewHelperVector& helpers) { - obj.fillView(id, pointers, helpers); - } - - - template - struct has_fillView > { - static bool const value = true; - }; - - - // Free function templates to support the use of edm::Ptr. - - template - inline - void - OwnArray::setPtr(std::type_info const& toType, - unsigned long index, - void const*& ptr) const { - detail::reallySetPtr >(*this, toType, index, ptr); - } - - template - inline - void - setPtr(OwnArray const& obj, - std::type_info const& toType, - unsigned long index, - void const*& ptr) { - obj.setPtr(toType, index, ptr); - } - - template - inline - void - OwnArray::fillPtrVector(std::type_info const& toType, - std::vector const& indices, - std::vector& ptrs) const { - detail::reallyfillPtrVector(*this, toType, indices, ptrs); - } - - - template - inline - void - fillPtrVector(OwnArray const& obj, - std::type_info const& toType, - std::vector const& indices, - std::vector& ptrs) { - obj.fillPtrVector(toType, indices, ptrs); - } - - - template - struct has_setPtr > { - static bool const value = true; - }; - - -} - - -#endif diff --git a/DataFormats/Common/interface/TransientDataFrame.h b/DataFormats/Common/interface/TransientDataFrame.h deleted file mode 100644 index bc77c8df6cb16..0000000000000 --- a/DataFormats/Common/interface/TransientDataFrame.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef DataFormats_Common_TransientDataFrame_h -#define DataFormats_Common_TransientDataFrame_h - -#include "DataFormats/Common/interface/DataFrame.h" -#include - -namespace edm { - - /* a fixed size array of 16bit words belonging to - * a "channel" identified by an 32bit id - * - * FIXME interface to be finalized once use-cases fully identified - * - */ - template - class TransientDataFrame { - public: - - typedef DataFrame::data_type data_type; - typedef DataFrame::id_type id_type; - - TransientDataFrame() {} - TransientDataFrame( id_type i) : m_id(i) {} - TransientDataFrame(DataFrame const & iframe) : - m_id(iframe.id()) - { - data_type const * p = iframe.begin(); - std::copy(p,p+SIZE,m_data); - } - - int size() const { return SIZE;} - - data_type operator[](size_t i) const { - return m_data[i]; - } - - data_type & operator[](size_t i) { - return m_data[i]; - } - - id_type id() const { return m_id; } - - private: - id_type m_id; - data_type m_data[SIZE]; - - }; - -} - -#endif // DataFormats_Common_TransientDataFrame_h diff --git a/DataFormats/Common/interface/debugging_allocator.h b/DataFormats/Common/interface/debugging_allocator.h deleted file mode 100644 index 528386613f77b..0000000000000 --- a/DataFormats/Common/interface/debugging_allocator.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef DataFormatsCommonDebuggingAllocator -#define DataFormatsCommonDebuggingAllocator - -//--------------------------------------------------------------------- -// -// This file declares and defines an allocator class template. -// This allocator is intended for use with the memory checking tool -// valgrind. It is a minimum conformant implementation which makes sure -// not use use any unitialized memory, and so it causes no spurious error -// reports from valgrind. -// -// The intended use is in the declarations of objects from STL templates, -// e.g. -// typedef vector > vint; -// etc. -// -//--------------------------------------------------------------------- - -#include -#include - -namespace edm -{ - template - class debugging_allocator - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T* pointer; - typedef T const* const_pointer; - typedef T& reference; - typedef T const& const_reference; - typedef T value_type; - - template struct rebind { typedef debugging_allocator other; }; - - - debugging_allocator() noexcept : dummy('x') { } - - debugging_allocator(debugging_allocator const&) noexcept : dummy('c') { } - - template debugging_allocator(debugging_allocator const&) noexcept : dummy('u') { } - - ~debugging_allocator() noexcept { }; - - pointer address(reference value) const {return &value;} - - const_pointer address(const_reference value) const {return &value; } - - size_type max_size() const noexcept { return std::numeric_limits::max()/sizeof(T); } - - pointer allocate(size_type num, void const* hint = 0) - { - // allocate objects with global new - return (pointer)(::operator new(num*sizeof(T))); - } - - void construct(pointer p, T const& value) { new((void*)p)T(value); } - - void destroy(pointer p) { p->~T(); } - - void deallocate(pointer p, size_type num) { ::operator delete((void*)p); } - - private: - char dummy; - - }; - - // instances of all specializations of this allocator are equal - template - bool operator== (debugging_allocator const&, debugging_allocator const&) noexcept { return true; } - - template - bool operator!= (debugging_allocator const&, debugging_allocator const&) noexcept { return false; } - -} //namespace edm - - -#endif diff --git a/DataFormats/Common/test/OwnArray_t.cpp b/DataFormats/Common/test/OwnArray_t.cpp deleted file mode 100644 index 14afce3c5f1d7..0000000000000 --- a/DataFormats/Common/test/OwnArray_t.cpp +++ /dev/null @@ -1,188 +0,0 @@ -#include -#include -#include - -#include "DataFormats/Common/interface/OwnArray.h" -#include "FWCore/Utilities/interface/propagate_const.h" - - -struct Base -{ - virtual ~Base(); - virtual Base* clone() const = 0; -}; - -Base::~Base() {} - -struct Derived : Base -{ - explicit Derived(int n); - Derived(Derived const& other); - Derived& operator=(Derived const& other); - virtual ~Derived(); - void swap(Derived& other); - virtual Derived* clone() const; - - edm::propagate_const pointer; -}; - -Derived::Derived(int n) : pointer(new int(n)) { } - -Derived::Derived(Derived const& other) : pointer(new int(*other.pointer)) { } - -Derived& Derived::operator=(Derived const& other) -{ - Derived temp(other); - swap(temp); - return *this; -} - -void Derived::swap(Derived& other) -{ - std::swap(pointer, other.pointer); -} - -void swap(Derived& a, Derived& b) -{ - a.swap(b); -} - -Derived::~Derived() -{ - delete pointer.get(); -} - -Derived* -Derived::clone() const -{ - return new Derived(*this); -} - - - -void same_guy_twice() -{ - edm::OwnArray vec; - Base* p = new Derived(1); - - vec.push_back(p); - vec.push_back(p); -} - -void two_different_owners() -{ - edm::OwnArray v1,v2; - Base* p = new Derived(1); - v1.push_back(p); - v2.push_back(p); -} - -// void guy_on_stack() -// { -// edm::OwnArray v; -// Derived d(10); -// v.push_back(&d); -// } - -void copy_good_vec() -{ - // v1 is perfectly fine... - edm::OwnArray v1; - Base* p = new Derived(100); - v1.push_back(p); - //v1.push_back(new Derived(100)); - - // But what if we copy him? - edm::OwnArray v2(v1); -} - -void assign_to_other() -{ - edm::OwnArray v1; - Base* p = new Derived(100); - v1.push_back(p); - - edm::OwnArray v2; - v2 = v1; -} - -void assign_to_self() -{ - // Self-assignment happens, often by accident... - edm::OwnArray v1; - v1.push_back(new Derived(100)); - v1 = v1; -} - -void pop_one() -{ - edm::OwnArray v1; - v1.push_back(new Derived(100)); - v1.pop_back(); -} - -void back_with_null_pointer() -{ - edm::OwnArray v; - Base* p = 0; - v.push_back(p); - try - { - v.back(); - assert("Failed to throw a required exception in OwnArray_t"==0); - } - catch (edm::Exception& x) - { - // this is expected. - } - catch (...) - { - throw; - } -} - -void take_an_rvalue() -{ - edm::OwnArray v; - v.push_back(new Derived(101)); - Derived d(102); - v.push_back(d.clone()); -} - -void take_an_lvalue() -{ - edm::OwnArray v1; - Base* p = new Derived(100); - v1.push_back(p); - - assert(p == 0); -} - -void take_an_auto_ptr() -{ - edm::OwnArray v1; - std::unique_ptr p = std::make_unique(100); - v1.push_back(p); - assert(p.get() == 0); -} - -int main() -{ - edm::OwnArray vec; - vec.push_back(new Derived(100)); - edm::OwnArray* p = new edm::OwnArray; - p->push_back(new Derived(2)); - delete p; - // same_guy_twice(); - // two_different_owners(); - // guy_on_stack(); - copy_good_vec(); - assign_to_other(); - assign_to_self(); - pop_one(); - back_with_null_pointer(); - - take_an_rvalue(); - take_an_lvalue(); - take_an_auto_ptr(); -} diff --git a/DataFormats/Common/test/testOwnArray.cc b/DataFormats/Common/test/testOwnArray.cc deleted file mode 100644 index 498a76f77e4ad..0000000000000 --- a/DataFormats/Common/test/testOwnArray.cc +++ /dev/null @@ -1,139 +0,0 @@ -// -#include "cppunit/extensions/HelperMacros.h" -#include -#include -#include -#include "DataFormats/Common/interface/OwnArray.h" -#include "FWCore/Utilities/interface/propagate_const.h" - -class testOwnArray : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(testOwnArray); - CPPUNIT_TEST(checkAll); - CPPUNIT_TEST_SUITE_END(); -public: - void setUp() {} - void tearDown() {} - void checkAll(); -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(testOwnArray); - -namespace testOA { - struct Dummy { - Dummy(int n, bool * r) : value(n), ref(r) { } - ~Dummy() { * ref = true; } - int value; - bool operator<(const Dummy & o) const { - return value < o.value; - } - private: - edm::propagate_const ref; - }; - - struct DummyComp { - bool operator()(const Dummy& d1, const Dummy& d2) const { - return d1.value < d2.value; - } - }; - - class a { - public: - virtual ~a() {} - virtual int f() const = 0; - }; - - class ClassB : public a { - public: - ClassB(int i) : ii(i) {memset(&waste, 0, sizeof(waste));} - virtual ~ClassB() {} - virtual int f() const { return ii; } - int ii; - private: - char waste[1024*1024]; - }; - - class ss { - public: - bool operator() (const a & a1, const a & a2) const { - return (a1.f() > a2.f()); - } - }; - - inline std::ostream& operator<<(std::ostream& os, const a & aa) { - os << aa.f(); - return os; - } -} - -void testOwnArray::checkAll() { - edm::OwnArray v; - CPPUNIT_ASSERT(v.size() == 0); - CPPUNIT_ASSERT(v.empty()); - bool deleted[4] = { false, false, false, false }; - v.push_back(new testOA::Dummy(0, deleted + 0)); - v.push_back(new testOA::Dummy(1, deleted + 1)); - v.push_back(new testOA::Dummy(2, deleted + 2)); - v.push_back(new testOA::Dummy(3, deleted + 3)); - CPPUNIT_ASSERT(v.size() == 4); - auto i = v.begin(); - auto ci = i; - * ci; - v.sort(); - v.sort(testOA::DummyComp()); - CPPUNIT_ASSERT(!v.empty()); - CPPUNIT_ASSERT(v[0].value == 0); - CPPUNIT_ASSERT(v[1].value == 1); - CPPUNIT_ASSERT(v[2].value == 2); - CPPUNIT_ASSERT(v[3].value == 3); - i = v.begin() + 1; - v.erase( i ); - CPPUNIT_ASSERT(!deleted[0]); - CPPUNIT_ASSERT(deleted[1]); - CPPUNIT_ASSERT(!deleted[2]); - CPPUNIT_ASSERT(!deleted[3]); - CPPUNIT_ASSERT(v.size() == 3); - CPPUNIT_ASSERT(v[0].value == 0); - CPPUNIT_ASSERT(v[1].value == 2); - CPPUNIT_ASSERT(v[2].value == 3); - auto b = v.begin(), e = b + 1; - v.erase(b, e); - CPPUNIT_ASSERT(v.size() == 2); - CPPUNIT_ASSERT(deleted[0]); - CPPUNIT_ASSERT(deleted[1]); - CPPUNIT_ASSERT(!deleted[2]); - CPPUNIT_ASSERT(!deleted[3]); - v.clear(); - CPPUNIT_ASSERT(v.size() == 0); - CPPUNIT_ASSERT(v.empty()); - CPPUNIT_ASSERT(deleted[0]); - CPPUNIT_ASSERT(deleted[1]); - CPPUNIT_ASSERT(deleted[2]); - CPPUNIT_ASSERT(deleted[3]); - { - edm::OwnArray v; - testOA::a * aa = new testOA::ClassB(2); - v.push_back(aa); - aa = new testOA::ClassB(1); - v.push_back(aa); - aa = new testOA::ClassB(3); - v.push_back(aa); - v.sort(testOA::ss()); - std::cout << "OwnArray : dumping contents" << std::endl; - std::copy(v.begin(), - v.end(), - std::ostream_iterator(std::cout, "\t")); - - edm::Ptr ptr_v; - unsigned long index(0); - void const * data = &v[0]; - v.setPtr( typeid(testOA::a), index, data ); - testOA::a const * data_a = static_cast(data); - testOA::ClassB const * data_b = dynamic_cast(data_a); - CPPUNIT_ASSERT( data != 0); - CPPUNIT_ASSERT( data_a != 0); - CPPUNIT_ASSERT( data_b != 0); - if(data_b != 0) { // To silence Coverity - CPPUNIT_ASSERT( data_b->f() == 3); - } - } -} diff --git a/DataFormats/GeometrySurface/interface/private/extTkRotation.h b/DataFormats/GeometrySurface/interface/private/extTkRotation.h deleted file mode 100644 index f1c2aa2a67aeb..0000000000000 --- a/DataFormats/GeometrySurface/interface/private/extTkRotation.h +++ /dev/null @@ -1,366 +0,0 @@ -#ifndef Geom_newTkRotation_H -#define Geom_newTkRotation_H - -#include "DataFormats/GeometryVector/interface/Basic2DVector.h" -#include "DataFormats/GeometryVector/interface/Basic3DVector.h" -#include "DataFormats/GeometryVector/interface/GlobalVector.h" - -#include "DataFormats/Math/interface/ExtVec.h" - - -#include - -template class TkRotation; -template class TkRotation2D; - -template -std::ostream & operator<<( std::ostream& s, const TkRotation& r); -template -std::ostream & operator<<( std::ostream& s, const TkRotation2D& r); - -namespace geometryDetails { - void TkRotationErr1(); - void TkRotationErr2(); - -} - - -/** Rotaion matrix used by Surface. - */ - -template -class TkRotation { -public: - - typedef Vector3DBase< T, GlobalTag> GlobalVector; - typedef Basic3DVector BasicVector; - - TkRotation( ){} - TkRotation( Rot3 const & irot ) : rot(irot){} - - TkRotation( T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz) : - rot(xx,xy,xz, yx,yy,yz, zx, zy,zz){} - - TkRotation( const T* p) : - rot(p[0],p[1],p[2], - p[3],p[4],p[5], - p[6],p[7],p[8]) {} - - TkRotation( const GlobalVector & aX, const GlobalVector & aY) { - - GlobalVector uX = aX.unit(); - GlobalVector uY = aY.unit(); - GlobalVector uZ(uX.cross(uY)); - - rot.axis[0]= uX.basicVector().v; - rot.axis[1]= uY.basicVector().v; - rot.axis[2]= uZ.basicVector().v; - - } - - TkRotation( const BasicVector & aX, const BasicVector & aY) { - - BasicVector uX = aX.unit(); - BasicVector uY = aY.unit(); - BasicVector uZ(uX.cross(uY)); - - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - rot.axis[2]= uZ.v; - - } - - - /** Construct from global vectors of the x, y and z axes. - * The axes are assumed to be unit vectors forming - * a right-handed orthonormal basis. No checks are performed! - */ - TkRotation( const GlobalVector & uX, const GlobalVector & uY, - const GlobalVector & uZ) { - rot.axis[0]= uX.basicVector().v; - rot.axis[1]= uY.basicVector().v; - rot.axis[2]= uZ.basicVector().v; - } - - TkRotation( const BasicVector & uX, const BasicVector & uY, - const BasicVector & uZ) { - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - rot.axis[2]= uZ.v; - } - - - /** rotation around abritrary axis by the amount of phi: - * its constructed by O^-1(z<->axis) rot_z(phi) O(z<->axis) - * the frame is rotated such that the z-asis corresponds to the rotation - * axis desired. THen it's rotated round the "new" z-axis, and then - * the initial transformation is "taken back" again. - * unfortuately I'm too stupid to describe such thing directly by 3 Euler - * angles.. hence I have to construckt it this way...by brute force - */ - TkRotation( const Basic3DVector& axis, T phi) : - rot( cos(phi), sin(phi), 0, - -sin(phi), cos(phi), 0, - 0, 0, 1) { - - //rotation around the z-axis by phi - TkRotation tmpRotz ( cos(axis.phi()), sin(axis.phi()), 0., - -sin(axis.phi()), cos(axis.phi()), 0., - 0., 0., 1. ); - //rotation around y-axis by theta - TkRotation tmpRoty ( cos(axis.theta()), 0.,-sin(axis.theta()), - 0., 1., 0., - sin(axis.theta()), 0., cos(axis.theta()) ); - (*this)*=tmpRoty; - (*this)*=tmpRotz; // = this * tmpRoty * tmpRotz - - // (tmpRoty * tmpRotz)^-1 * this * tmpRoty * tmpRotz - - *this = (tmpRoty*tmpRotz).multiplyInverse(*this); - - } - /* this is the same thing...derived from the CLHEP ... it gives the - same results MODULO the sign of the rotation.... but I don't want - that... had - TkRotation (const Basic3DVector& axis, float phi) { - T cx = axis.x(); - T cy = axis.y(); - T cz = axis.z(); - - T ll = axis.mag(); - if (ll == 0) { - geometryDetails::TkRotationErr1(); - }else{ - - float cosa = cos(phi), sina = sin(phi); - cx /= ll; cy /= ll; cz /= ll; - - R11 = cosa + (1-cosa)*cx*cx; - R12 = (1-cosa)*cx*cy - sina*cz; - R13 = (1-cosa)*cx*cz + sina*cy; - - R21 = (1-cosa)*cy*cx + sina*cz; - R22 = cosa + (1-cosa)*cy*cy; - R23 = (1-cosa)*cy*cz - sina*cx; - - R31 = (1-cosa)*cz*cx - sina*cy; - R32 = (1-cosa)*cz*cy + sina*cx; - R33 = cosa + (1-cosa)*cz*cz; - - } - - } - */ - - template - TkRotation( const TkRotation& a) : - rot (a.xx(), a.xy(), a.xz(), - a.yx(), a.yy(), a.yz(), - a.zx(), a.zy(), a.zz()) {} - - TkRotation transposed() const { - return rot.transpose(); - } - - Basic3DVector rotate( const Basic3DVector& v) const { - return rot.rotate(v.v); - } - - Basic3DVector rotateBack( const Basic3DVector& v) const { - return rot.rotateBack(v.v); - } - - - Basic3DVector operator*( const Basic3DVector& v) const { - return rot.rotate(v.v); - } - - Basic3DVector multiplyInverse( const Basic3DVector& v) const { - return rot.rotateBack(v.v); - } - - template - Basic3DVector multiplyInverse( const Basic3DVector& v) const { - return Basic3DVector( xx()*v.x() + yx()*v.y() + zx()*v.z(), - xy()*v.x() + yy()*v.y() + zy()*v.z(), - xz()*v.x() + yz()*v.y() + zz()*v.z()); - } - - Basic3DVector operator*( const Basic2DVector& v) const { - return Basic3DVector( xx()*v.x() + xy()*v.y(), - yx()*v.x() + yy()*v.y(), - zx()*v.x() + zy()*v.y()); - } - Basic3DVector multiplyInverse( const Basic2DVector& v) const { - return Basic3DVector( xx()*v.x() + yx()*v.y(), - xy()*v.x() + yy()*v.y(), - xz()*v.x() + yz()*v.y()); - } - - - - TkRotation operator*( const TkRotation& b) const { - return rot*b.rot; - } - TkRotation multiplyInverse( const TkRotation& b) const { - return rot.transpose()*b.rot; - } - - TkRotation& operator*=( const TkRotation& b) { - return *this = operator * (b); - } - - // Note a *= b; <=> a = a * b; while a.transform(b); <=> a = b * a; - TkRotation& transform(const TkRotation& b) { - return *this = b.operator * (*this); - } - - TkRotation & rotateAxes(const Basic3DVector& newX, - const Basic3DVector& newY, - const Basic3DVector& newZ) { - T del = 0.001; - - if ( - - // the check for right-handedness is not needed since - // we want to change the handedness when it's left in cmsim - // - // fabs(newZ.x()-w.x()) > del || - // fabs(newZ.y()-w.y()) > del || - // fabs(newZ.z()-w.z()) > del || - fabs(newX.mag2()-1.) > del || - fabs(newY.mag2()-1.) > del || - fabs(newZ.mag2()-1.) > del || - fabs(newX.dot(newY)) > del || - fabs(newY.dot(newZ)) > del || - fabs(newZ.dot(newX)) > del) { - geometryDetails::TkRotationErr2(); - return *this; - } else { - return transform(TkRotation(newX.x(), newY.x(), newZ.x(), - newX.y(), newY.y(), newZ.y(), - newX.z(), newY.z(), newZ.z())); - } - } - - - Basic3DVector x() const { return rot.axis[0];} - Basic3DVector y() const { return rot.axis[1];} - Basic3DVector z() const { return rot.axis[2];} - - T xx() const { return rot.axis[0][0];} - T xy() const { return rot.axis[0][1];} - T xz() const { return rot.axis[0][2];} - T yx() const { return rot.axis[1][0];} - T yy() const { return rot.axis[1][1];} - T yz() const { return rot.axis[1][2];} - T zx() const { return rot.axis[2][0];} - T zy() const { return rot.axis[2][1];} - T zz() const { return rot.axis[2][2];} - -private: - - Rot3 rot; - -}; - - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - - -template -inline Basic3DVector operator*( const TkRotation& r, const Basic3DVector& v) { - return Basic3DVector( r.xx()*v.x() + r.xy()*v.y() + r.xz()*v.z(), - r.yx()*v.x() + r.yy()*v.y() + r.yz()*v.z(), - r.zx()*v.x() + r.zy()*v.y() + r.zz()*v.z()); -} - -template -inline TkRotation::Type> -operator*( const TkRotation& a, const TkRotation& b) { - typedef TkRotation::Type> RT; - return RT( a.xx()*b.xx() + a.xy()*b.yx() + a.xz()*b.zx(), - a.xx()*b.xy() + a.xy()*b.yy() + a.xz()*b.zy(), - a.xx()*b.xz() + a.xy()*b.yz() + a.xz()*b.zz(), - a.yx()*b.xx() + a.yy()*b.yx() + a.yz()*b.zx(), - a.yx()*b.xy() + a.yy()*b.yy() + a.yz()*b.zy(), - a.yx()*b.xz() + a.yy()*b.yz() + a.yz()*b.zz(), - a.zx()*b.xx() + a.zy()*b.yx() + a.zz()*b.zx(), - a.zx()*b.xy() + a.zy()*b.yy() + a.zz()*b.zy(), - a.zx()*b.xz() + a.zy()*b.yz() + a.zz()*b.zz()); -} - - -template -class TkRotation2D { -public: - - typedef Basic2DVector BasicVector; - - TkRotation2D( ){} - TkRotation2D( Rot2 const & irot ) : rot(irot){} - - TkRotation2D( T xx, T xy, T yx, T yy) : - rot(xx,xy, yx,yy){} - - TkRotation2D( const T* p) : - rot(p[0],p[1], - p[2],p[3]) {} - - TkRotation2D( const BasicVector & aX) { - - BasicVector uX = aX.unit(); - BasicVector uY(-uX.y(),uX.x()); - - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - - } - - - TkRotation2D( const BasicVector & uX, const BasicVector & uY) { - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - } - - BasicVector x() const { return rot.axis[0];} - BasicVector y() const { return rot.axis[1];} - - - TkRotation2D transposed() const { - return rot.transpose(); - } - - BasicVector rotate( const BasicVector& v) const { - return rot.rotate(v.v); - } - - BasicVector rotateBack( const BasicVector& v) const { - return rot.rotateBack(v.v); - } - - - - private: - - Rot2 rot; - -}; - - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); - - -#endif - - - - diff --git a/DataFormats/GeometrySurface/interface/private/newTkRotation.h b/DataFormats/GeometrySurface/interface/private/newTkRotation.h deleted file mode 100644 index f12a7b1ebe118..0000000000000 --- a/DataFormats/GeometrySurface/interface/private/newTkRotation.h +++ /dev/null @@ -1,366 +0,0 @@ -#ifndef Geom_newTkRotation_H -#define Geom_newTkRotation_H - -#include "DataFormats/GeometryVector/interface/Basic2DVector.h" -#include "DataFormats/GeometryVector/interface/Basic3DVector.h" -#include "DataFormats/GeometryVector/interface/GlobalVector.h" - -#include "DataFormats/Math/interface/SSERot.h" - - -#include - -template class TkRotation; -template class TkRotation2D; - -template -std::ostream & operator<<( std::ostream& s, const TkRotation& r); -template -std::ostream & operator<<( std::ostream& s, const TkRotation2D& r); - -namespace geometryDetails { - void TkRotationErr1(); - void TkRotationErr2(); - -} - - -/** Rotaion matrix used by Surface. - */ - -template -class TkRotation { -public: - - typedef Vector3DBase< T, GlobalTag> GlobalVector; - typedef Basic3DVector BasicVector; - - TkRotation( ){} - TkRotation( mathSSE::Rot3 const & irot ) : rot(irot){} - - TkRotation( T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz) : - rot(xx,xy,xz, yx,yy,yz, zx, zy,zz){} - - TkRotation( const T* p) : - rot(p[0],p[1],p[2], - p[3],p[4],p[5], - p[6],p[7],p[8]) {} - - TkRotation( const GlobalVector & aX, const GlobalVector & aY) { - - GlobalVector uX = aX.unit(); - GlobalVector uY = aY.unit(); - GlobalVector uZ(uX.cross(uY)); - - rot.axis[0]= uX.basicVector().v; - rot.axis[1]= uY.basicVector().v; - rot.axis[2]= uZ.basicVector().v; - - } - - TkRotation( const BasicVector & aX, const BasicVector & aY) { - - BasicVector uX = aX.unit(); - BasicVector uY = aY.unit(); - BasicVector uZ(uX.cross(uY)); - - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - rot.axis[2]= uZ.v; - - } - - - /** Construct from global vectors of the x, y and z axes. - * The axes are assumed to be unit vectors forming - * a right-handed orthonormal basis. No checks are performed! - */ - TkRotation( const GlobalVector & uX, const GlobalVector & uY, - const GlobalVector & uZ) { - rot.axis[0]= uX.basicVector().v; - rot.axis[1]= uY.basicVector().v; - rot.axis[2]= uZ.basicVector().v; - } - - TkRotation( const BasicVector & uX, const BasicVector & uY, - const BasicVector & uZ) { - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - rot.axis[2]= uZ.v; - } - - - /** rotation around abritrary axis by the amount of phi: - * its constructed by O^-1(z<->axis) rot_z(phi) O(z<->axis) - * the frame is rotated such that the z-asis corresponds to the rotation - * axis desired. THen it's rotated round the "new" z-axis, and then - * the initial transformation is "taken back" again. - * unfortuately I'm too stupid to describe such thing directly by 3 Euler - * angles.. hence I have to construckt it this way...by brute force - */ - TkRotation( const Basic3DVector& axis, T phi) : - rot( cos(phi), sin(phi), 0, - -sin(phi), cos(phi), 0, - 0, 0, 1) { - - //rotation around the z-axis by phi - TkRotation tmpRotz ( cos(axis.phi()), sin(axis.phi()), 0., - -sin(axis.phi()), cos(axis.phi()), 0., - 0., 0., 1. ); - //rotation around y-axis by theta - TkRotation tmpRoty ( cos(axis.theta()), 0.,-sin(axis.theta()), - 0., 1., 0., - sin(axis.theta()), 0., cos(axis.theta()) ); - (*this)*=tmpRoty; - (*this)*=tmpRotz; // = this * tmpRoty * tmpRotz - - // (tmpRoty * tmpRotz)^-1 * this * tmpRoty * tmpRotz - - *this = (tmpRoty*tmpRotz).multiplyInverse(*this); - - } - /* this is the same thing...derived from the CLHEP ... it gives the - same results MODULO the sign of the rotation.... but I don't want - that... had - TkRotation (const Basic3DVector& axis, float phi) { - T cx = axis.x(); - T cy = axis.y(); - T cz = axis.z(); - - T ll = axis.mag(); - if (ll == 0) { - geometryDetails::TkRotationErr1(); - }else{ - - float cosa = cos(phi), sina = sin(phi); - cx /= ll; cy /= ll; cz /= ll; - - R11 = cosa + (1-cosa)*cx*cx; - R12 = (1-cosa)*cx*cy - sina*cz; - R13 = (1-cosa)*cx*cz + sina*cy; - - R21 = (1-cosa)*cy*cx + sina*cz; - R22 = cosa + (1-cosa)*cy*cy; - R23 = (1-cosa)*cy*cz - sina*cx; - - R31 = (1-cosa)*cz*cx - sina*cy; - R32 = (1-cosa)*cz*cy + sina*cx; - R33 = cosa + (1-cosa)*cz*cz; - - } - - } - */ - - template - TkRotation( const TkRotation& a) : - rot (a.xx(), a.xy(), a.xz(), - a.yx(), a.yy(), a.yz(), - a.zx(), a.zy(), a.zz()) {} - - TkRotation transposed() const { - return rot.transpose(); - } - - Basic3DVector rotate( const Basic3DVector& v) const { - return rot.rotate(v.v); - } - - Basic3DVector rotateBack( const Basic3DVector& v) const { - return rot.rotateBack(v.v); - } - - - Basic3DVector operator*( const Basic3DVector& v) const { - return rot.rotate(v.v); - } - - Basic3DVector multiplyInverse( const Basic3DVector& v) const { - return rot.rotateBack(v.v); - } - - template - Basic3DVector multiplyInverse( const Basic3DVector& v) const { - return Basic3DVector( xx()*v.x() + yx()*v.y() + zx()*v.z(), - xy()*v.x() + yy()*v.y() + zy()*v.z(), - xz()*v.x() + yz()*v.y() + zz()*v.z()); - } - - Basic3DVector operator*( const Basic2DVector& v) const { - return Basic3DVector( xx()*v.x() + xy()*v.y(), - yx()*v.x() + yy()*v.y(), - zx()*v.x() + zy()*v.y()); - } - Basic3DVector multiplyInverse( const Basic2DVector& v) const { - return Basic3DVector( xx()*v.x() + yx()*v.y(), - xy()*v.x() + yy()*v.y(), - xz()*v.x() + yz()*v.y()); - } - - - - TkRotation operator*( const TkRotation& b) const { - return rot*b.rot; - } - TkRotation multiplyInverse( const TkRotation& b) const { - return rot.transpose()*b.rot; - } - - TkRotation& operator*=( const TkRotation& b) { - return *this = operator * (b); - } - - // Note a *= b; <=> a = a * b; while a.transform(b); <=> a = b * a; - TkRotation& transform(const TkRotation& b) { - return *this = b.operator * (*this); - } - - TkRotation & rotateAxes(const Basic3DVector& newX, - const Basic3DVector& newY, - const Basic3DVector& newZ) { - T del = 0.001; - - if ( - - // the check for right-handedness is not needed since - // we want to change the handedness when it's left in cmsim - // - // fabs(newZ.x()-w.x()) > del || - // fabs(newZ.y()-w.y()) > del || - // fabs(newZ.z()-w.z()) > del || - fabs(newX.mag2()-1.) > del || - fabs(newY.mag2()-1.) > del || - fabs(newZ.mag2()-1.) > del || - fabs(newX.dot(newY)) > del || - fabs(newY.dot(newZ)) > del || - fabs(newZ.dot(newX)) > del) { - geometryDetails::TkRotationErr2(); - return *this; - } else { - return transform(TkRotation(newX.x(), newY.x(), newZ.x(), - newX.y(), newY.y(), newZ.y(), - newX.z(), newY.z(), newZ.z())); - } - } - - - Basic3DVector x() const { return rot.axis[0];} - Basic3DVector y() const { return rot.axis[1];} - Basic3DVector z() const { return rot.axis[2];} - - T xx() const { return rot.axis[0].arr[0];} - T xy() const { return rot.axis[0].arr[1];} - T xz() const { return rot.axis[0].arr[2];} - T yx() const { return rot.axis[1].arr[0];} - T yy() const { return rot.axis[1].arr[1];} - T yz() const { return rot.axis[1].arr[2];} - T zx() const { return rot.axis[2].arr[0];} - T zy() const { return rot.axis[2].arr[1];} - T zz() const { return rot.axis[2].arr[2];} - -private: - - mathSSE::Rot3 rot; - -}; - - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - - -template -inline Basic3DVector operator*( const TkRotation& r, const Basic3DVector& v) { - return Basic3DVector( r.xx()*v.x() + r.xy()*v.y() + r.xz()*v.z(), - r.yx()*v.x() + r.yy()*v.y() + r.yz()*v.z(), - r.zx()*v.x() + r.zy()*v.y() + r.zz()*v.z()); -} - -template -inline TkRotation::Type> -operator*( const TkRotation& a, const TkRotation& b) { - typedef TkRotation::Type> RT; - return RT( a.xx()*b.xx() + a.xy()*b.yx() + a.xz()*b.zx(), - a.xx()*b.xy() + a.xy()*b.yy() + a.xz()*b.zy(), - a.xx()*b.xz() + a.xy()*b.yz() + a.xz()*b.zz(), - a.yx()*b.xx() + a.yy()*b.yx() + a.yz()*b.zx(), - a.yx()*b.xy() + a.yy()*b.yy() + a.yz()*b.zy(), - a.yx()*b.xz() + a.yy()*b.yz() + a.yz()*b.zz(), - a.zx()*b.xx() + a.zy()*b.yx() + a.zz()*b.zx(), - a.zx()*b.xy() + a.zy()*b.yy() + a.zz()*b.zy(), - a.zx()*b.xz() + a.zy()*b.yz() + a.zz()*b.zz()); -} - - -template -class TkRotation2D { -public: - - typedef Basic2DVector BasicVector; - - TkRotation2D( ){} - TkRotation2D( mathSSE::Rot2 const & irot ) : rot(irot){} - - TkRotation2D( T xx, T xy, T yx, T yy) : - rot(xx,xy, yx,yy){} - - TkRotation2D( const T* p) : - rot(p[0],p[1], - p[2],p[3]) {} - - TkRotation2D( const BasicVector & aX) { - - BasicVector uX = aX.unit(); - BasicVector uY(-uX.y(),uX.x()); - - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - - } - - - TkRotation2D( const BasicVector & uX, const BasicVector & uY) { - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - } - - BasicVector x() const { return rot.axis[0];} - BasicVector y() const { return rot.axis[1];} - - - TkRotation2D transposed() const { - return rot.transpose(); - } - - BasicVector rotate( const BasicVector& v) const { - return rot.rotate(v.v); - } - - BasicVector rotateBack( const BasicVector& v) const { - return rot.rotateBack(v.v); - } - - - - private: - - mathSSE::Rot2 rot; - -}; - - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); - - -#endif - - - - diff --git a/DataFormats/GeometrySurface/interface/private/oldTkRotation.h b/DataFormats/GeometrySurface/interface/private/oldTkRotation.h deleted file mode 100644 index 34f6cc63b6713..0000000000000 --- a/DataFormats/GeometrySurface/interface/private/oldTkRotation.h +++ /dev/null @@ -1,370 +0,0 @@ -#ifndef Geom_oldTkRotation_H -#define Geom_oldTkRotation_H - -#include "DataFormats/GeometryVector/interface/Basic2DVector.h" -#include "DataFormats/GeometryVector/interface/Basic3DVector.h" -#include "DataFormats/GeometryVector/interface/GlobalVector.h" -/* -#include "DataFormats/GeometrySurface/interface/GlobalError.h" -#include "DataFormats/GeometrySurface/interface/LocalError.h" -*/ -#include - -template class TkRotation; -template class TkRotation2D; - -template -std::ostream & operator<<( std::ostream& s, const TkRotation& r); -template -std::ostream & operator<<( std::ostream& s, const TkRotation2D& r); - -namespace geometryDetails { - void TkRotationErr1(); - void TkRotationErr2(); - -} - - -/** Rotaion matrix used by Surface. - */ - -template -class TkRotation { -public: - typedef Vector3DBase< T, GlobalTag> GlobalVector; - - TkRotation() : - R11( 1), R12( 0), R13( 0), - R21( 0), R22( 1), R23( 0), - R31( 0), R32( 0), R33( 1) {} - - TkRotation( T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz) : - R11(xx), R12(xy), R13(xz), - R21(yx), R22(yy), R23(yz), - R31(zx), R32(zy), R33(zz) {} - - TkRotation( const T* p) : - R11(p[0]), R12(p[1]), R13(p[2]), - R21(p[3]), R22(p[4]), R23(p[5]), - R31(p[6]), R32(p[7]), R33(p[8]) {} - - TkRotation( const GlobalVector & aX, const GlobalVector & aY) { - - GlobalVector uX = aX.unit(); - GlobalVector uY = aY.unit(); - GlobalVector uZ(uX.cross(uY)); - - R11 = uX.x(); R12 = uX.y(); R13 = uX.z(); - R21 = uY.x(); R22 = uY.y(); R23 = uY.z(); - R31 = uZ.x(); R32 = uZ.y(); R33 = uZ.z(); - - } - - /** Construct from global vectors of the x, y and z axes. - * The axes are assumed to be unit vectors forming - * a right-handed orthonormal basis. No checks are performed! - */ - TkRotation( const GlobalVector & aX, const GlobalVector & aY, - const GlobalVector & aZ) : - R11( aX.x()), R12( aX.y()), R13( aX.z()), - R21( aY.x()), R22( aY.y()), R23( aY.z()), - R31( aZ.x()), R32( aZ.y()), R33( aZ.z()) {} - - - /** rotation around abritrary axis by the amount of phi: - * its constructed by O^-1(z<->axis) rot_z(phi) O(z<->axis) - * the frame is rotated such that the z-asis corresponds to the rotation - * axis desired. THen it's rotated round the "new" z-axis, and then - * the initial transformation is "taken back" again. - * unfortuately I'm too stupid to describe such thing directly by 3 Euler - * angles.. hence I have to construckt it this way...by brute force - */ - TkRotation( const Basic3DVector& axis, T phi) : - R11( cos(phi) ), R12( sin(phi)), R13( 0), - R21( -sin(phi)), R22( cos(phi)), R23( 0), - R31( 0), R32( 0), R33( 1) { - - //rotation around the z-axis by phi - TkRotation tmpRotz ( cos(axis.phi()), sin(axis.phi()), 0., - -sin(axis.phi()), cos(axis.phi()), 0., - 0., 0., 1. ); - //rotation around y-axis by theta - TkRotation tmpRoty ( cos(axis.theta()), 0.,-sin(axis.theta()), - 0., 1., 0., - sin(axis.theta()), 0., cos(axis.theta()) ); - (*this)*=tmpRoty; - (*this)*=tmpRotz; // = this * tmpRoty * tmpRotz - - // (tmpRoty * tmpRotz)^-1 * this * tmpRoty * tmpRotz - - *this = (tmpRoty*tmpRotz).multiplyInverse(*this); - - } - /* this is the same thing...derived from the CLHEP ... it gives the - same results MODULO the sign of the rotation.... but I don't want - that... had - TkRotation (const Basic3DVector& axis, float phi) { - T cx = axis.x(); - T cy = axis.y(); - T cz = axis.z(); - - T ll = axis.mag(); - if (ll == 0) { - geometryDetails::TkRotationErr1(); - }else{ - - float cosa = cos(phi), sina = sin(phi); - cx /= ll; cy /= ll; cz /= ll; - - R11 = cosa + (1-cosa)*cx*cx; - R12 = (1-cosa)*cx*cy - sina*cz; - R13 = (1-cosa)*cx*cz + sina*cy; - - R21 = (1-cosa)*cy*cx + sina*cz; - R22 = cosa + (1-cosa)*cy*cy; - R23 = (1-cosa)*cy*cz - sina*cx; - - R31 = (1-cosa)*cz*cx - sina*cy; - R32 = (1-cosa)*cz*cy + sina*cx; - R33 = cosa + (1-cosa)*cz*cz; - - } - - } - */ - - template - TkRotation( const TkRotation& a) : - R11(a.xx()), R12(a.xy()), R13(a.xz()), - R21(a.yx()), R22(a.yy()), R23(a.yz()), - R31(a.zx()), R32(a.zy()), R33(a.zz()) {} - - TkRotation transposed() const { - return TkRotation( R11, R21, R31, - R12, R22, R32, - R13, R23, R33); - } - - Basic3DVector operator*( const Basic3DVector& v) const { - return rotate(v); - } - - Basic3DVector rotate( const Basic3DVector& v) const { - return Basic3DVector( R11*v.x() + R12*v.y() + R13*v.z(), - R21*v.x() + R22*v.y() + R23*v.z(), - R31*v.x() + R32*v.y() + R33*v.z()); - } - - Basic3DVector multiplyInverse( const Basic3DVector& v) const { - return rotateBack(v); - } - - Basic3DVector rotateBack( const Basic3DVector& v) const { - return Basic3DVector( R11*v.x() + R21*v.y() + R31*v.z(), - R12*v.x() + R22*v.y() + R32*v.z(), - R13*v.x() + R23*v.y() + R33*v.z()); - } - - - Basic3DVector operator*( const Basic2DVector& v) const { - return Basic3DVector( R11*v.x() + R12*v.y(), - R21*v.x() + R22*v.y(), - R31*v.x() + R32*v.y()); - } - Basic3DVector multiplyInverse( const Basic2DVector& v) const { - return Basic3DVector( R11*v.x() + R21*v.y(), - R12*v.x() + R22*v.y(), - R13*v.x() + R23*v.y()); - } - - - - TkRotation operator*( const TkRotation& b) const { - return TkRotation(R11*b.R11 + R12*b.R21 + R13*b.R31, - R11*b.R12 + R12*b.R22 + R13*b.R32, - R11*b.R13 + R12*b.R23 + R13*b.R33, - R21*b.R11 + R22*b.R21 + R23*b.R31, - R21*b.R12 + R22*b.R22 + R23*b.R32, - R21*b.R13 + R22*b.R23 + R23*b.R33, - R31*b.R11 + R32*b.R21 + R33*b.R31, - R31*b.R12 + R32*b.R22 + R33*b.R32, - R31*b.R13 + R32*b.R23 + R33*b.R33); - } - - TkRotation multiplyInverse( const TkRotation& b) const { - return TkRotation(R11*b.R11 + R21*b.R21 + R31*b.R31, - R11*b.R12 + R21*b.R22 + R31*b.R32, - R11*b.R13 + R21*b.R23 + R31*b.R33, - R12*b.R11 + R22*b.R21 + R32*b.R31, - R12*b.R12 + R22*b.R22 + R32*b.R32, - R12*b.R13 + R22*b.R23 + R32*b.R33, - R13*b.R11 + R23*b.R21 + R33*b.R31, - R13*b.R12 + R23*b.R22 + R33*b.R32, - R13*b.R13 + R23*b.R23 + R33*b.R33); - } - - TkRotation& operator*=( const TkRotation& b) { - return *this = operator * (b); - } - - // Note a *= b; <=> a = a * b; while a.transform(b); <=> a = b * a; - TkRotation& transform(const TkRotation& b) { - return *this = b.operator * (*this); - } - - TkRotation & rotateAxes(const Basic3DVector& newX, - const Basic3DVector& newY, - const Basic3DVector& newZ) { - T del = 0.001; - - if ( - - // the check for right-handedness is not needed since - // we want to change the handedness when it's left in cmsim - // - // fabs(newZ.x()-w.x()) > del || - // fabs(newZ.y()-w.y()) > del || - // fabs(newZ.z()-w.z()) > del || - fabs(newX.mag2()-1.) > del || - fabs(newY.mag2()-1.) > del || - fabs(newZ.mag2()-1.) > del || - fabs(newX.dot(newY)) > del || - fabs(newY.dot(newZ)) > del || - fabs(newZ.dot(newX)) > del) { - geometryDetails::TkRotationErr2(); - return *this; - } else { - return transform(TkRotation(newX.x(), newY.x(), newZ.x(), - newX.y(), newY.y(), newZ.y(), - newX.z(), newY.z(), newZ.z())); - } - } - - Basic3DVector x() const { return Basic3DVector(xx(),xy(),xz());} - Basic3DVector y() const { return Basic3DVector(yx(),yy(),yz());} - Basic3DVector z() const { return Basic3DVector(zx(),zy(),zz());} - - - T const &xx() const { return R11;} - T const &xy() const { return R12;} - T const &xz() const { return R13;} - T const &yx() const { return R21;} - T const &yy() const { return R22;} - T const &yz() const { return R23;} - T const &zx() const { return R31;} - T const &zy() const { return R32;} - T const &zz() const { return R33;} - -private: - - T R11, R12, R13; - T R21, R22, R23; - T R31, R32, R33; -}; - - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - - -template -inline Basic3DVector operator*( const TkRotation& r, const Basic3DVector& v) { - return Basic3DVector( r.xx()*v.x() + r.xy()*v.y() + r.xz()*v.z(), - r.yx()*v.x() + r.yy()*v.y() + r.yz()*v.z(), - r.zx()*v.x() + r.zy()*v.y() + r.zz()*v.z()); -} - -template -inline TkRotation::Type> -operator*( const TkRotation& a, const TkRotation& b) { - typedef TkRotation::Type> RT; - return RT( a.xx()*b.xx() + a.xy()*b.yx() + a.xz()*b.zx(), - a.xx()*b.xy() + a.xy()*b.yy() + a.xz()*b.zy(), - a.xx()*b.xz() + a.xy()*b.yz() + a.xz()*b.zz(), - a.yx()*b.xx() + a.yy()*b.yx() + a.yz()*b.zx(), - a.yx()*b.xy() + a.yy()*b.yy() + a.yz()*b.zy(), - a.yx()*b.xz() + a.yy()*b.yz() + a.yz()*b.zz(), - a.zx()*b.xx() + a.zy()*b.yx() + a.zz()*b.zx(), - a.zx()*b.xy() + a.zy()*b.yy() + a.zz()*b.zy(), - a.zx()*b.xz() + a.zy()*b.yz() + a.zz()*b.zz()); -} - - -template -class TkRotation2D { -public: - - typedef Basic2DVector BasicVector; - - - - TkRotation2D( ){} - - TkRotation2D( T xx, T xy, T yx, T yy) { - axis[0] = BasicVector(xx,xy); - axis[1] =BasicVector(yx, yy); - } - - TkRotation2D( const T* p) { - axis[0] = BasicVector(p[0],p[1]); - axis[1] = BasicVector(p[2],p[3]); - } - - TkRotation2D( const BasicVector & aX) { - - BasicVector uX = aX.unit(); - BasicVector uY(-uX.y(),uX.x()); - - axis[0]= uX; - axis[1]= uY; - - } - - - TkRotation2D( const BasicVector & uX, const BasicVector & uY) { - axis[0]= uX; - axis[1]= uY; - } - - BasicVector x() const { return axis[0];} - BasicVector y() const { return axis[1];} - - - TkRotation2D transposed() const { - return TkRotation2D(axis[0][0], axis[1][0], - axis[0][1], axis[1][1] - ); - } - - BasicVector rotate( const BasicVector& v) const { - return transposed().rotateBack(v); - } - - BasicVector rotateBack( const BasicVector& v) const { - return v[0]*axis[0] + v[1]*axis[1]; - } - - - - private: - - BasicVector axis[2]; - -}; - - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); - - -#endif - - - - diff --git a/DataFormats/GeometryVector/interface/OnePiRange.h b/DataFormats/GeometryVector/interface/OnePiRange.h deleted file mode 100644 index 1983da64af506..0000000000000 --- a/DataFormats/GeometryVector/interface/OnePiRange.h +++ /dev/null @@ -1,133 +0,0 @@ -#ifndef GeometryVector_Geom_OnePiRange_h -#define GeometryVector_Geom_OnePiRange_h - -#include -#include - -namespace Geom { - -/** \class OnePiRange - * A class for polar angle represantation. - * The use of OnePiRange is tranparant due to the implicit conversion to T - * Constructs like cos(theta) work as with float or double. - * The difference with respect to built-in types is that - * OnePiRange is kept in the range [0, pi], and this is consistently - * implemented in aritmetic operations. In other words, OnePiRange implements - * "modulo(pi)" arithmetics. - */ - - template - class OnePiRange { - public: - - /// Default constructor does not initialise - just as double. - OnePiRange() {} - - /// Constructor from T, does not provide automatic conversion. - explicit OnePiRange( const T& val) : theValue(val) { normalize(); } - - /// conversion operator makes transparent use possible. - operator T() const { return theValue;} - - /// Template argument conversion - template operator OnePiRange() { return OnePiRange(theValue);} - - /// Explicit access to value in case implicit conversion not OK - T value() const { return theValue;} - - // Standard arithmetics - OnePiRange& operator+=(const T& a) {theValue+=a; normalize(); return *this;} - OnePiRange& operator+=(const OnePiRange& a) {return operator+=(a.value());} - - OnePiRange& operator-=(const T& a) {theValue-=a; normalize(); return *this;} - OnePiRange& operator-=(const OnePiRange& a) {return operator-=(a.value());} - - OnePiRange& operator*=(const T& a) {theValue*=a; normalize(); return *this;} - - OnePiRange& operator/=(const T& a) {theValue/=a; normalize(); return *this;} - - T degrees() const { return theValue*180./pi();} - - /// Return the pseudorapidity. - // No need to handle 0 or pi; in this case "inf" is returned. - T eta() const { return -log(tan(theValue/2.)); } - - - private: - - T theValue; - - void normalize() { - if( theValue > (T) pi() || theValue < 0) { - theValue = fmod( theValue, (T) pi()); - } - if (theValue < 0.) theValue += pi(); - } - - }; - - /// - operator - template - inline OnePiRange operator-(const OnePiRange& a) {return OnePiRange(-a.value());} - - - /// Addition - template - inline OnePiRange operator+(const OnePiRange& a, const OnePiRange& b) { - return OnePiRange(a) += b; - } - /// Addition with scalar, does not change the precision - template - inline OnePiRange operator+(const OnePiRange& a, const Scalar& b) { - return OnePiRange(a) += b; - } - /// Addition with scalar, does not change the precision - template - inline OnePiRange operator+(const Scalar& a, const OnePiRange& b) { - return OnePiRange(b) += a; - } - - /// Subtraction - template - inline OnePiRange operator-(const OnePiRange& a, const OnePiRange& b) { - return OnePiRange(a) -= b; - } - - /// Subtraction with scalar, does not change the precision - template - inline OnePiRange operator-(const OnePiRange& a, const Scalar& b) { - return OnePiRange(a) -= b; - } - - /// Subtraction with scalar, does not change the precision - template - inline OnePiRange operator-(const Scalar& a, const OnePiRange& b) { - return OnePiRange(a - b.value()); // use of unary operators would normalize twice - } - - /// Multiplication with scalar, does not change the precision - template - inline OnePiRange operator*(const OnePiRange& a, const Scalar& b) { - return OnePiRange(a) *= b; - } - - /// Multiplication with scalar - template - inline OnePiRange operator*(double a, const OnePiRange& b) { - return OnePiRange(b) *= a; - } - - /// Division - template - inline T operator/(const OnePiRange& a, const OnePiRange& b) { - return a.value() / b.value(); - } - - /// Division by scalar - template - inline OnePiRange operator/(const OnePiRange& a, double b) { - return OnePiRange(a) /= b; - } - -} -#endif diff --git a/DataFormats/GeometryVector/interface/private/extBasic2DVector.h b/DataFormats/GeometryVector/interface/private/extBasic2DVector.h deleted file mode 100644 index 7d6a871576de7..0000000000000 --- a/DataFormats/GeometryVector/interface/private/extBasic2DVector.h +++ /dev/null @@ -1,264 +0,0 @@ -#ifndef GeometryVector_newBasic2DVector_h -#define GeometryVector_newBasic2DVector_h - -#include "DataFormats/GeometryVector/interface/Phi.h" -#include "DataFormats/GeometryVector/interface/PreciseFloatType.h" -#include "DataFormats/GeometryVector/interface/CoordinateSets.h" -#include "DataFormats/Math/interface/ExtVec.h" - - -#include -#include - - -template < class T> -class Basic2DVector { -public: - - typedef T ScalarType; - typedef Vec2 VectorType; - typedef Vec2 MathVector; - typedef Geom::Polar2Cartesian Polar; - - /** default constructor uses default constructor of T to initialize the - * components. For built-in floating-point types this means initialization - * to zero - */ - Basic2DVector() : v{0,0} {} - - /// Copy constructor from same type. Should not be needed but for gcc bug 12685 - Basic2DVector( const Basic2DVector & p) : v(p.v) {} - - template - Basic2DVector( const Basic2DVector & p) : v{T(p.v[0]),T(p.v[1])} {} - - - /** Explicit constructor from other (possibly unrelated) vector classes - * The only constraint on the argument type is that it has methods - * x() and y(), and that these methods return a type convertible to T. - * Examples of use are - *
construction from a Basic2DVector with different precision - *
construction from a coordinate system converter - */ - template - explicit Basic2DVector( const Other& p) : v{T(p.x()),T(p.y())} {} - - /// construct from cartesian coordinates - Basic2DVector( const T& x, const T& y) : v{x,y} {} - - // constructor from Vec2 or vec4 - Basic2DVector(MathVector const& iv) : v(iv){} - template - Basic2DVector(Vec2 const& iv) : v{iv[0],iv[1]}{} - template - Basic2DVector(Vec4 const& iv) : v{iv[0],iv[1]}{} - - MathVector const & mathVector() const { return v;} - MathVector & mathVector() { return v;} - - T operator[](int i) const { return v[i];} - T & operator[](int i) { return v[i];} - - - /// Cartesian x coordinate - T x() const { return v[0];} - - /// Cartesian y coordinate - T y() const { return v[1];} - - /// The vector magnitude squared. Equivalent to vec.dot(vec) - T mag2() const { return ::dot(v,v);} - - /// The vector magnitude. Equivalent to sqrt(vec.mag2()) - T mag() const { return std::sqrt( mag2());} - - /// Radius, same as mag() - T r() const { return mag();} - - /** Azimuthal angle. The value is returned in radians, in the range (-pi,pi]. - * Same precision as the system atan2(x,y) function. - * The return type is Geom::Phi, see it's documentation. - */ - T barePhi() const {return std::atan2(y(),x());} - Geom::Phi phi() const {return Geom::Phi(atan2(y(),x()));} - - /** Unit vector parallel to this. - * If mag() is zero, a zero vector is returned. - */ - Basic2DVector unit() const { - T my_mag = mag(); - return my_mag == 0 ? *this : *this / my_mag; - } - - /** Operator += with a Basic2DVector of possibly different precision. - */ - template - Basic2DVector& operator+= ( const Basic2DVector& p) { - v = v + p.v; - return *this; - } - - /** Operator -= with a Basic2DVector of possibly different precision. - */ - template - Basic2DVector& operator-= ( const Basic2DVector& p) { - v = v - p.v; - return *this; - } - - /// Unary minus, returns a vector with components (-x(),-y(),-z()) - Basic2DVector operator-() const { return Basic2DVector(-v);} - - /// Scaling by a scalar value (multiplication) - Basic2DVector& operator*= ( T t) { - v = v*t; - return *this; - } - - /// Scaling by a scalar value (division) - Basic2DVector& operator/= ( T t) { - t = T(1)/t; - v = v*t; - return *this; - } - - /// Scalar product, or "dot" product, with a vector of same type. - T dot( const Basic2DVector& lh) const { return ::dot(v,lh.v);} - - /** Scalar (or dot) product with a vector of different precision. - * The product is computed without loss of precision. The type - * of the returned scalar is the more precise of the scalar types - * of the two vectors. - */ - template - typename PreciseFloatType::Type dot( const Basic2DVector& lh) const { - return Basic2DVector::Type>(*this) - .dot(Basic2DVector::Type>(lh)); - } - - /// Vector product, or "cross" product, with a vector of same type. - T cross( const Basic2DVector& lh) const { return ::cross2(v,lh.v);} - - /** Vector (or cross) product with a vector of different precision. - * The product is computed without loss of precision. The type - * of the returned scalar is the more precise of the scalar types - * of the two vectors. - */ - template - typename PreciseFloatType::Type cross( const Basic2DVector& lh) const { - return Basic2DVector::Type>(*this) - .cross(Basic2DVector::Type>(lh)); - } - - -public: - - Vec2 v; - -}; - - -namespace geometryDetails { - std::ostream & print2D(std::ostream& s, double x, double y); - -} - -/// simple text output to standard streams -template -inline std::ostream & operator<<( std::ostream& s, const Basic2DVector& v) { - return geometryDetails::print2D(s, v.x(),v.y()); -} - - -/// vector sum and subtraction of vectors of possibly different precision -template -inline Basic2DVector -operator+( const Basic2DVector& a, const Basic2DVector& b) { - return a.v+b.v; -} -template -inline Basic2DVector -operator-( const Basic2DVector& a, const Basic2DVector& b) { - return a.v-b.v; -} - -template -inline Basic2DVector::Type> -operator+( const Basic2DVector& a, const Basic2DVector& b) { - typedef Basic2DVector::Type> RT; - return RT(a) + RT(b); -} - -template -inline Basic2DVector::Type> -operator-( const Basic2DVector& a, const Basic2DVector& b) { - typedef Basic2DVector::Type> RT; - return RT(a)-RT(b); -} - - - - -// scalar product of vectors of same precision -template -inline T operator*( const Basic2DVector& v1, const Basic2DVector& v2) { - return v1.dot(v2); -} - -/// scalar product of vectors of different precision -template -inline typename PreciseFloatType::Type operator*( const Basic2DVector& v1, - const Basic2DVector& v2) { - return v1.dot(v2); -} - - -/** Multiplication by scalar, does not change the precision of the vector. - * The return type is the same as the type of the vector argument. - */ -template -inline Basic2DVector operator*( const Basic2DVector& v, T t) { - return v.v*t; -} - -/// Same as operator*( Vector, Scalar) -template -inline Basic2DVector operator*(T t, const Basic2DVector& v) { - return v.v*t; -} - - - -template -inline Basic2DVector operator*( const Basic2DVector& v, const Scalar& s) { - T t = static_cast(s); - return v*t; -} - -/// Same as operator*( Vector, Scalar) -template -inline Basic2DVector operator*( const Scalar& s, const Basic2DVector& v) { - T t = static_cast(s); - return v*t; -} - -/** Division by scalar, does not change the precision of the vector. - * The return type is the same as the type of the vector argument. - */ -template -inline Basic2DVector operator/(const Basic2DVector& v, T t) { - return v.v/t; -} - -template -inline Basic2DVector operator/( const Basic2DVector& v, const Scalar& s) { - // T t = static_cast(Scalar(1)/s); return v*t; - T t = static_cast(s); - return v/t; -} - -typedef Basic2DVector Basic2DVectorF; -typedef Basic2DVector Basic2DVectorD; - - -#endif // GeometryVector_Basic2DVector_h diff --git a/DataFormats/GeometryVector/interface/private/oldBasic2DVector.h b/DataFormats/GeometryVector/interface/private/oldBasic2DVector.h deleted file mode 100644 index 543200c609a96..0000000000000 --- a/DataFormats/GeometryVector/interface/private/oldBasic2DVector.h +++ /dev/null @@ -1,241 +0,0 @@ -#ifndef GeometryVector_oldBasic2DVector_h -#define GeometryVector_oldBasic2DVector_h - -#include "DataFormats/GeometryVector/interface/Phi.h" -#include "DataFormats/GeometryVector/interface/PreciseFloatType.h" -#include "DataFormats/GeometryVector/interface/CoordinateSets.h" -#if (!defined(__CLING__)) -#include "DataFormats/Math/interface/SIMDVec.h" -#endif - - -#include -#include - - -template < class T> -class Basic2DVector { -public: - typedef Basic2DVector MathVector; - - typedef T ScalarType; - typedef Geom::Polar2Cartesian Polar; - - /** default constructor uses default constructor of T to initialize the - * components. For built-in floating-point types this means initialization - * to zero - */ - Basic2DVector() : theX(0), theY(0) {} - - /// Copy constructor from same type. Should not be needed but for gcc bug 12685 - Basic2DVector( const Basic2DVector & p) : - theX(p.x()), theY(p.y()) {} - - /** Explicit constructor from other (possibly unrelated) vector classes - * The only constraint on the argument type is that it has methods - * x() and y(), and that these methods return a type convertible to T. - * Examples of use are - *
construction from a Basic2DVector with different precision - *
construction from a coordinate system converter - */ - template - explicit Basic2DVector( const Other& p) : theX(p.x()), theY(p.y()) {} - - /// construct from cartesian coordinates - Basic2DVector( const T& x, const T& y) : theX(x), theY(y) {} - - -#if defined(USE_EXTVECT) - // constructor from Vec2 or vec4 - template - Basic2DVector(Vec2 const& iv) : - theX(iv[0]), theY(iv[1]) {} - template - Basic2DVector(Vec4 const& iv) : - theX(iv.arr[0]), theY(iv.arr[1]) {} -#elif defined(USE_SSEVECT) - // constructor from Vec2 or vec4 - template - Basic2DVector(mathSSE::Vec2 const& iv) : - theX(iv.arr[0]), theY(iv.arr[1]) {} - template - Basic2DVector(mathSSE::Vec4 const& iv) : - theX(iv.arr[0]), theY(iv.arr[1]) {} -#endif - - T operator[](int i) const { return i==0 ? theX : theY ;} - T & operator[](int i) { return i==0 ? theX : theY ;} - - /// Cartesian x coordinate - T x() const { return theX;} - - /// Cartesian y coordinate - T y() const { return theY;} - - /// The vector magnitude squared. Equivalent to vec.dot(vec) - T mag2() const { return theX*theX + theY*theY;} - - /// The vector magnitude. Equivalent to sqrt(vec.mag2()) - T mag() const { return std::sqrt( mag2());} - - /// Radius, same as mag() - T r() const { return mag();} - - /** Azimuthal angle. The value is returned in radians, in the range (-pi,pi]. - * Same precision as the system atan2(x,y) function. - * The return type is Geom::Phi, see it's documentation. - */ - T barePhi() const {return std::atan2(theY,theX);} - Geom::Phi phi() const {return Geom::Phi(atan2(theY,theX));} - - /** Unit vector parallel to this. - * If mag() is zero, a zero vector is returned. - */ - Basic2DVector unit() const { - T my_mag = mag(); - return my_mag == 0 ? *this : *this / my_mag; - } - - /** Operator += with a Basic2DVector of possibly different precision. - */ - template - Basic2DVector& operator+= ( const Basic2DVector& p) { - theX += p.x(); - theY += p.y(); - return *this; - } - - /** Operator -= with a Basic2DVector of possibly different precision. - */ - template - Basic2DVector& operator-= ( const Basic2DVector& p) { - theX -= p.x(); - theY -= p.y(); - return *this; - } - - /// Unary minus, returns a vector with components (-x(),-y(),-z()) - Basic2DVector operator-() const { return Basic2DVector(-x(),-y());} - - /// Scaling by a scalar value (multiplication) - Basic2DVector& operator*= ( const T& t) { - theX *= t; - theY *= t; - return *this; - } - - /// Scaling by a scalar value (division) - Basic2DVector& operator/= ( const T& t) { - theX /= t; - theY /= t; - return *this; - } - - /// Scalar product, or "dot" product, with a vector of same type. - T dot( const Basic2DVector& v) const { return x()*v.x() + y()*v.y();} - - /** Scalar (or dot) product with a vector of different precision. - * The product is computed without loss of precision. The type - * of the returned scalar is the more precise of the scalar types - * of the two vectors. - */ - template - typename PreciseFloatType::Type dot( const Basic2DVector& v) const { - return x()*v.x() + y()*v.y(); - } - - - - /// Vector product, or "cross" product, with a vector of same type. - T cross( const Basic2DVector& v) const { return x()*v.y() - y()*v.x();} - - /** Vector (or cross) product with a vector of different precision. - * The product is computed without loss of precision. The type - * of the returned scalar is the more precise of the scalar types - * of the two vectors. - */ - template - typename PreciseFloatType::Type cross( const Basic2DVector& v) const { - return x()*v.y() - y()*v.x(); - } - - -private: - T theX; - T theY; -}; - - -namespace geometryDetails { - std::ostream & print2D(std::ostream& s, double x, double y); - -} - -/// simple text output to standard streams -template -inline std::ostream & operator<<( std::ostream& s, const Basic2DVector& v) { - return geometryDetails::print2D(s, v.x(),v.y()); -} - - -/// vector sum and subtraction of vectors of possibly different precision -template -inline Basic2DVector::Type> -operator+( const Basic2DVector& a, const Basic2DVector& b) { - typedef Basic2DVector::Type> RT; - return RT(a.x()+b.x(), a.y()+b.y()); -} - -template -inline Basic2DVector::Type> -operator-( const Basic2DVector& a, const Basic2DVector& b) { - typedef Basic2DVector::Type> RT; - return RT(a.x()-b.x(), a.y()-b.y()); -} - - - - -// scalar product of vectors of same precision -template -inline T operator*( const Basic2DVector& v1, const Basic2DVector& v2) { - return v1.dot(v2); -} - -/// scalar product of vectors of different precision -template -inline typename PreciseFloatType::Type operator*( const Basic2DVector& v1, - const Basic2DVector& v2) { - return v1.x()*v2.x() + v1.y()*v2.y(); -} - -/** Multiplication by scalar, does not change the precision of the vector. - * The return type is the same as the type of the vector argument. - */ -template -inline Basic2DVector operator*( const Basic2DVector& v, const Scalar& s) { - T t = static_cast(s); - return Basic2DVector(v.x()*t, v.y()*t); -} - -/// Same as operator*( Vector, Scalar) -template -inline Basic2DVector operator*( const Scalar& s, const Basic2DVector& v) { - T t = static_cast(s); - return Basic2DVector(v.x()*t, v.y()*t); -} - -/** Division by scalar, does not change the precision of the vector. - * The return type is the same as the type of the vector argument. - */ -template -inline Basic2DVector operator/( const Basic2DVector& v, const Scalar& s) { - T t = static_cast(s); - return Basic2DVector(v.x()/t, v.y()/t); -} - - -typedef Basic2DVector Basic2DVectorF; -typedef Basic2DVector Basic2DVectorD; - -#endif // GeometryVector_Basic2DVector_h diff --git a/DataFormats/GeometryVector/interface/private/oldBasic3DVector.h b/DataFormats/GeometryVector/interface/private/oldBasic3DVector.h deleted file mode 100644 index 8505b6aa09979..0000000000000 --- a/DataFormats/GeometryVector/interface/private/oldBasic3DVector.h +++ /dev/null @@ -1,352 +0,0 @@ -#ifndef GeometryVector_oldBasic3DVector_h -#define GeometryVector_oldBasic3DVector_h -#if ( defined(__CLING__) || defined(__CINT__) ) && !defined(__REFLEX__) -#define __REFLEX__ -#endif -#include "DataFormats/GeometryVector/interface/Basic2DVector.h" -#include "DataFormats/GeometryVector/interface/Theta.h" -#include "DataFormats/GeometryVector/interface/Phi.h" -#include "DataFormats/GeometryVector/interface/PreciseFloatType.h" -#include "DataFormats/GeometryVector/interface/CoordinateSets.h" -#ifndef __REFLEX__ -#include "DataFormats/Math/interface/SIMDVec.h" -#endif -#include -#include - - -namespace detailsBasic3DVector { - inline float __attribute__((always_inline)) __attribute__ ((pure)) - eta(float x, float y, float z) { float t(z/std::sqrt(x*x+y*y)); return ::asinhf(t);} - inline double __attribute__((always_inline)) __attribute__ ((pure)) - eta(double x, double y, double z) { double t(z/std::sqrt(x*x+y*y)); return ::asinh(t);} - inline long double __attribute__((always_inline)) __attribute__ ((pure)) - eta(long double x, long double y, long double z) { long double t(z/std::sqrt(x*x+y*y)); return ::asinhl(t);} -} - - -template < typename T> -class Basic3DVector { -public: - typedef Basic3DVector MathVector; - - - typedef T ScalarType; - typedef Geom::Cylindrical2Cartesian Cylindrical; - typedef Geom::Spherical2Cartesian Spherical; - typedef Spherical Polar; // synonym - - /** default constructor uses default constructor of T to initialize the - * components. For built-in floating-point types this means initialization - * to zero??? (force init to 0) - */ - Basic3DVector() : theX(0), theY(0), theZ(0), theW(0) {} - - /// Copy constructor from same type. Should not be needed but for gcc bug 12685 - Basic3DVector( const Basic3DVector & p) : - theX(p.x()), theY(p.y()), theZ(p.z()), theW(p.w()) {} - - /// Copy constructor and implicit conversion from Basic3DVector of different precision - template - Basic3DVector( const Basic3DVector & p) : - theX(p.x()), theY(p.y()), theZ(p.z()), theW(p.w()) {} - - /// constructor from 2D vector (X and Y from 2D vector, z set to zero) - Basic3DVector( const Basic2DVector & p) : - theX(p.x()), theY(p.y()), theZ(0), theW(0) {} - - /** Explicit constructor from other (possibly unrelated) vector classes - * The only constraint on the argument type is that it has methods - * x(), y() and z(), and that these methods return a type convertible to T. - * Examples of use are - *
construction from a Basic3DVector with different precision - *
construction from a Hep3Vector - *
construction from a coordinate system converter - */ - template - explicit Basic3DVector( const OtherPoint& p) : - theX(p.x()), theY(p.y()), theZ(p.z()), theW(0) {} - - -#if defined(USE_EXTVECT) - template - Basic3DVector(Vec4 const& iv) : - theX(iv[0]), theY(iv[1]), theZ(iv[2]), theW(0) {} -#elif defined(USE_SSEVECT) - // constructor from Vec4 - template - Basic3DVector(mathSSE::Vec4 const& iv) : - theX(iv.arr[0]), theY(iv.arr[1]), theZ(iv.arr[2]), theW(0) {} -#endif - -#ifndef __REFLEX__ - /// construct from cartesian coordinates - Basic3DVector( const T& x, const T& y, const T& z, const T& w=0) : - theX(x), theY(y), theZ(z), theW(w) {} -#else - /// construct from cartesian coordinates - Basic3DVector( const T& x, const T& y, const T& z) : - theX(x), theY(y), theZ(z), theW(0) {} - Basic3DVector( const T& x, const T& y, const T& z, const T& w) : - theX(x), theY(y), theZ(z), theW(w) {} -#endif - - - - /** Deprecated construct from polar coordinates, use - *
Basic3DVector( Basic3DVector::Polar( theta, phi, r)) - * instead. - */ - template - Basic3DVector( const Geom::Theta& theta, - const Geom::Phi& phi, const T& r) { - Polar p( theta.value(), phi.value(), r); - theX = p.x(); theY = p.y(); theZ = p.z(); - } - - - T operator[](int i) const { return *((&theX)+i) ;} - T & operator[](int i) { return *((&theX)+i);} - - - - /// Cartesian x coordinate - T x() const { return theX;} - - /// Cartesian y coordinate - T y() const { return theY;} - - /// Cartesian z coordinate - T z() const { return theZ;} - - T w() const { return theW;} - - - Basic2DVector xy() const { return Basic2DVector(theX,theY);} - - - // equality - bool operator==(const Basic3DVector& rh) const { - return x()==rh.x() && y()==rh.y() && z()==rh.z(); - } - - /// The vector magnitude squared. Equivalent to vec.dot(vec) - T mag2() const { return x()*x() + y()*y()+z()*z();} - - /// The vector magnitude. Equivalent to sqrt(vec.mag2()) - T mag() const { return std::sqrt( mag2());} - - /// Squared magnitude of transverse component - T perp2() const { return x()*x() + y()*y();} - - /// Magnitude of transverse component - T perp() const { return std::sqrt( perp2());} - - /// Another name for perp() - T transverse() const { return perp();} - - /** Azimuthal angle. The value is returned in radians, in the range (-pi,pi]. - * Same precision as the system atan2(x,y) function. - * The return type is Geom::Phi, see it's documentation. - */ - T barePhi() const {return std::atan2(y(),x());} - Geom::Phi phi() const {return Geom::Phi(barePhi());} - - /** Polar angle. The value is returned in radians, in the range [0,pi] - * Same precision as the system atan2(x,y) function. - * The return type is Geom::Phi, see it's documentation. - */ - T bareTheta() const {return std::atan2(perp(),z());} - Geom::Theta theta() const {return Geom::Theta(std::atan2(perp(),z()));} - - /** Pseudorapidity. - * Does not check for zero transverse component; in this case the behavior - * is as for divide-by zero, i.e. system-dependent. - */ - // T eta() const { return -log( tan( theta()/2.));} - T eta() const { return detailsBasic3DVector::eta(x(),y(),z());} // correct - - /** Unit vector parallel to this. - * If mag() is zero, a zero vector is returned. - */ - Basic3DVector unit() const { - T my_mag = mag2(); - if (my_mag==0) return *this; - my_mag = T(1)/std::sqrt(my_mag); - return *this * my_mag; - } - - /** Operator += with a Basic3DVector of possibly different precision. - */ - template - Basic3DVector& operator+= ( const Basic3DVector& p) { - theX += p.x(); - theY += p.y(); - theZ += p.z(); - theW += p.w(); - return *this; - } - - /** Operator -= with a Basic3DVector of possibly different precision. - */ - template - Basic3DVector& operator-= ( const Basic3DVector& p) { - theX -= p.x(); - theY -= p.y(); - theZ -= p.z(); - theW -= p.w(); - return *this; - } - - /// Unary minus, returns a vector with components (-x(),-y(),-z()) - Basic3DVector operator-() const { return Basic3DVector(-x(),-y(),-z());} - - /// Scaling by a scalar value (multiplication) - Basic3DVector& operator*= ( T t) { - theX *= t; - theY *= t; - theZ *= t; - theW *= t;; - return *this; - } - - /// Scaling by a scalar value (division) - Basic3DVector& operator/= ( T t) { - t = T(1)/t; - theX *= t; - theY *= t; - theZ *= t; - theW *= t;; - return *this; - } - - /// Scalar product, or "dot" product, with a vector of same type. - T dot( const Basic3DVector& v) const { - return x()*v.x() + y()*v.y() + z()*v.z(); - } - - /** Scalar (or dot) product with a vector of different precision. - * The product is computed without loss of precision. The type - * of the returned scalar is the more precise of the scalar types - * of the two vectors. - */ - template - typename PreciseFloatType::Type dot( const Basic3DVector& v) const { - return x()*v.x() + y()*v.y() + z()*v.z(); - } - - /// Vector product, or "cross" product, with a vector of same type. - Basic3DVector cross( const Basic3DVector& v) const { - return Basic3DVector( y()*v.z() - v.y()*z(), - z()*v.x() - v.z()*x(), - x()*v.y() - v.x()*y()); - } - - - /** Vector (or cross) product with a vector of different precision. - * The product is computed without loss of precision. The type - * of the returned vector is the more precise of the types - * of the two vectors. - */ - template - Basic3DVector::Type> - cross( const Basic3DVector& v) const { - return Basic3DVector::Type>( y()*v.z() - v.y()*z(), - z()*v.x() - v.z()*x(), - x()*v.y() - v.x()*y()); - } - -private: - T theX; - T theY; - T theZ; - T theW; -} -#ifndef __CINT__ -__attribute__ ((aligned (16))) -#endif -; - - -namespace geometryDetails { - std::ostream & print3D(std::ostream& s, double x, double y, double z); -} - -/// simple text output to standard streams -template -inline std::ostream & operator<<( std::ostream& s, const Basic3DVector& v) { - return geometryDetails::print3D(s, v.x(),v.y(), v.z()); -} - - -/// vector sum and subtraction of vectors of possibly different precision -template -inline Basic3DVector::Type> -operator+( const Basic3DVector& a, const Basic3DVector& b) { - typedef Basic3DVector::Type> RT; - return RT(a.x()+b.x(), a.y()+b.y(), a.z()+b.z(), a.w()+b.w()); -} - -template -inline Basic3DVector::Type> -operator-( const Basic3DVector& a, const Basic3DVector& b) { - typedef Basic3DVector::Type> RT; - return RT(a.x()-b.x(), a.y()-b.y(), a.z()-b.z(), a.w()-b.w()); -} - -/// scalar product of vectors of same precision -template -inline T operator*( const Basic3DVector& v1, const Basic3DVector& v2) { - return v1.dot(v2); -} - -/// scalar product of vectors of different precision -template -inline typename PreciseFloatType::Type operator*( const Basic3DVector& v1, - const Basic3DVector& v2) { - return v1.x()*v2.x() + v1.y()*v2.y() + v1.z()*v2.z(); -} - -/** Multiplication by scalar, does not change the precision of the vector. - * The return type is the same as the type of the vector argument. - */ -template -inline Basic3DVector operator*( const Basic3DVector& v, T t) { - return Basic3DVector(v.x()*t, v.y()*t, v.z()*t, v.w()*t); -} - -/// Same as operator*( Vector, Scalar) -template -inline Basic3DVector operator*(T t, const Basic3DVector& v) { - return Basic3DVector(v.x()*t, v.y()*t, v.z()*t, v.w()*t); -} - -template -inline Basic3DVector operator*(S t, const Basic3DVector& v) { - return static_cast(t)*v; -} - -template -inline Basic3DVector operator*(const Basic3DVector& v, S t) { - return static_cast(t)*v; -} - - -/** Division by scalar, does not change the precision of the vector. - * The return type is the same as the type of the vector argument. - */ -template -inline Basic3DVector operator/( const Basic3DVector& v, S s) { - T t = T(1)/s; - return v*t; -} - - -typedef Basic3DVector Basic3DVectorF; -typedef Basic3DVector Basic3DVectorD; -typedef Basic3DVector Basic3DVectorLD; - - -#endif // GeometryVector_Basic3DVector_h - - diff --git a/DataFormats/METReco/interface/PFClusterMETCollection.h b/DataFormats/METReco/interface/PFClusterMETCollection.h deleted file mode 100644 index 1a02b783450ae..0000000000000 --- a/DataFormats/METReco/interface/PFClusterMETCollection.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef METRECO_PFClusterMETCOLLECTION_H -#define METRECO_PFClusterMETCOLLECTION_H - -/** \class PFClusterMETCollection - * - * \short Collection of PFCluster MET - * - * PFClusterMETCollection is a collection of PFClusterMET objects - * - * \author Salvatore Rappoccio, JHU - * - * \version 1st Version Dec, 2010 - * - ************************************************************/ - -#include -#include "DataFormats/METReco/interface/PFClusterMETFwd.h" - -namespace reco -{ - typedef std::vector PFClusterMETCollection; -} -#endif // METRECO_PFClusterMETCOLLECTION_H diff --git a/DataFormats/Math/interface/SSEArray.h b/DataFormats/Math/interface/SSEArray.h deleted file mode 100644 index 778100e291007..0000000000000 --- a/DataFormats/Math/interface/SSEArray.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef DataFormat_Math_SSEArray_H -#define DataFormat_Math_SSEArray_H - - -#include "DataFormats/Math/interface/SSEVec.h" -#include - -#ifdef CMS_USE_SSE -namespace mathSSE { - -// "vertical array" - template - struct ArrayTraits { - }; - - template - struct ArrayMask { - }; - - //FIXME avoid punning... - template <> - struct ArrayMask { - static inline Vec4 value() { - Vec4 v; v.setMask(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); - return v; - } - }; - template <> - struct ArrayMask { - static inline Vec4 value() { - Vec4 v; v.setMask(0xffffffff, 0x0, 0x0, 0x0); - return v; - } - }; - template <> - struct ArrayMask { - static inline Vec4 value() { - Vec4 v; v.setMask(0xffffffff, 0xffffffff, 0x0, 0x0); - return v; - } - }; - template <> - struct ArrayMask { - static inline Vec4 value() { - Vec4 v; v.setMask(0xffffffff, 0xffffffff, 0xffffffff, 0x0); - return v; - } - }; - - template <> - struct ArrayMask { - static inline Vec2 value() { - Vec2 v; v.setMask(0xffffffffffffffffLL, 0xffffffffffffffffLL); - return v; - } - }; - template <> - struct ArrayMask { - static inline Vec2 value() { - Vec2 v; v.setMask(0xffffffffffffffffLL, 0x0LL); - return v; - } - }; - - - template - struct ArrayTraits { - typedef float Scalar; - typedef Vec4 Vec; - static const size_t size = S; - static const size_t ssesize = (S+3)/4; - static const size_t arrsize = 4*ssesize; - static inline Vec maskLast() { return ArrayMask::value(); } - static inline Vec __attribute__((__always_inline__)) mask(Vec v, size_t i) { - return (i==ssesize-1) ? maskLast()&v : v; - } - template - static void loop(F f) { - for (size_t i=0; i!=ssesize-1;++i) - f(i, ArrayMask::value()); - f(ssesize-1,maskLast()); - } - }; - - template - struct ArrayTraits { - typedef double Scalar; - typedef Vec2 Vec; - static const size_t size = S; - static const size_t ssesize = (S+1)/2; - static const size_t arrsize = 2*ssesize; - static inline Vec maskLast() { return ArrayMask::value();} - }; - - template - union Array { - typedef ArrayTraits Traits; - typedef typename Traits::Vec Vec; - typename Vec::nativeType vec[Traits::ssesize]; - T __attribute__ ((aligned(16))) arr[Traits::arrsize]; - - Vec operator[]( size_t i) { return vec[i];} - Vec const & operator[]( size_t i) const{ return reinterpret_cast(vec[i]);} - - }; - - -} - -#endif // CMS_USE_SSE -#endif // DataFormat_Math_SSEArray_H diff --git a/DataFormats/Math/interface/private/AVXVec.h b/DataFormats/Math/interface/private/AVXVec.h deleted file mode 100644 index 9fe33e8c3d1fd..0000000000000 --- a/DataFormats/Math/interface/private/AVXVec.h +++ /dev/null @@ -1,187 +0,0 @@ -#ifndef DataFormat_Math_AVXVec_H -#define DataFormat_Math_AVXVec_H - -// in principle it should not be used alone -// only as part of SSEVec -namespace mathSSE { - - template<> - union Vec4 { - typedef __m256d nativeType; - __m256d vec; - double __attribute__ ((aligned(32))) arr[4]; - OldVec o; - - Vec4(__m256d ivec) : vec(ivec) {} - - Vec4(OldVec const & ivec) : o(ivec) {} - - Vec4() { - vec = _mm256_setzero_pd(); - } - - - inline Vec4(Vec4 ivec) { - vec = _mm256_cvtps_pd(ivec.vec); - } - - explicit Vec4(double f1) { - set1(f1); - } - - Vec4(double f1, double f2, double f3, double f4=0) { - arr[0] = f1; arr[1] = f2; arr[2] = f3; arr[3]=f4; - } - - - Vec4( Vec2 ivec0, Vec2 ivec1) { - vec = _mm256_insertf128_pd(vec,ivec0.vec,0); - vec = _mm256_insertf128_pd(vec,ivec1.vec,1); - - } - - Vec4( Vec2 ivec0, double f3, double f4=0) { - vec = _mm256_insertf128_pd(vec,ivec0.vec,0); - arr[2] = f3; arr[3] = f4; - } - - Vec4( Vec2 ivec0) { - vec = _mm256_setzero_pd(); - vec = _mm256_insertf128_pd(vec,ivec0.vec,0); - } - - - // for masking - void setMask(unsigned int m1, unsigned int m2, unsigned int m3, unsigned int m4) { - Mask4 mask(m1,m2,m3,m4); vec=mask.vec; - } - - void set(double f1, double f2, double f3, double f4=0) { - vec = _mm256_set_pd(f4, f3, f2, f1); - } - - void set1(double f1) { - vec = _mm256_set1_pd(f1); - } - - template - Vec4 get1() const { - return _mm256_set1_pd(arr[N]); //FIXME - } - /* - Vec4 get1(unsigned int n) const { - return _mm256_set1_pd(arr[n]); //FIXME - } - */ - double & operator[](unsigned int n) { - return arr[n]; - } - - double operator[](unsigned int n) const { - return arr[n]; - } - - Vec2 xy() const { return Vec2(_mm256_castpd256_pd128(vec));} - Vec2 zw() const { return Vec2(_mm256_castpd256_pd128(_mm256_permute2f128_pd(vec,vec,1)));} - - }; - - inline Vec4::Vec4(Vec4 ivec) { - vec = _mm256_cvtpd_ps(ivec.vec); - } -} // namespace mathSSE - - - -inline bool operator==(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_movemask_pd(_mm256_cmp_pd(a.vec,b.vec,_CMP_EQ_OS))==0xf; -} - -inline mathSSE::Vec4 cmpeq(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_cmp_pd(a.vec,b.vec,_CMP_EQ_OS); -} - -inline mathSSE::Vec4 cmpgt(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_cmp_pd(a.vec,b.vec,_CMP_GT_OS); -} - -inline mathSSE::Vec4 hadd(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_hadd_pd(a.vec,b.vec); -} - - - -inline mathSSE::Vec4 operator-(mathSSE::Vec4 a) { - const __m256d neg = _mm256_set_pd ( -0.0 , -0.0 , -0.0, -0.0); - return _mm256_xor_pd(a.vec,neg); -} - -inline mathSSE::Vec4 operator&(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_and_pd(a.vec,b.vec); -} -inline mathSSE::Vec4 operator|(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_or_pd(a.vec,b.vec); -} -inline mathSSE::Vec4 operator^(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_xor_pd(a.vec,b.vec); -} -inline mathSSE::Vec4 andnot(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_andnot_pd(a.vec,b.vec); -} - - -inline mathSSE::Vec4 operator+(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_add_pd(a.vec,b.vec); -} - -inline mathSSE::Vec4 operator-(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_sub_pd(a.vec,b.vec); -} - -inline mathSSE::Vec4 operator*(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_mul_pd(a.vec,b.vec); -} - -inline mathSSE::Vec4 operator/(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_div_pd(a.vec,b.vec); -} - -inline mathSSE::Vec4 operator*(double a, mathSSE::Vec4 b) { - return _mm256_mul_pd(_mm256_set1_pd(a),b.vec); -} - -inline mathSSE::Vec4 operator*(mathSSE::Vec4 b,double a) { - return _mm256_mul_pd(_mm256_set1_pd(a),b.vec); -} - -inline mathSSE::Vec4 operator/(mathSSE::Vec4 b,double a) { - return _mm256_div_pd(b.vec,_mm256_set1_pd(a)); -} - - -inline double -__attribute__((always_inline)) __attribute__ ((pure)) -dot(mathSSE::Vec4 a, mathSSE::Vec4 b) { - using mathSSE::_mm256_dot_pd; - mathSSE::Vec4 ret; - ret.vec = _mm256_dot_pd(a.vec,b.vec); - return ret.arr[0]; -} - -inline mathSSE::Vec4 -__attribute__((always_inline)) __attribute__ ((pure)) -cross(mathSSE::Vec4 a, mathSSE::Vec4 b) { - using mathSSE::_mm256_cross_pd; - return _mm256_cross_pd(a.vec,b.vec); -} - -inline double -__attribute__((always_inline)) __attribute__ ((pure)) -dotxy(mathSSE::Vec4 a, mathSSE::Vec4 b) { - mathSSE::Vec4 mul = a*b; - mul = hadd(mul,mul); - return mul.arr[0]; -} - - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFBlockElementFwd.h b/DataFormats/ParticleFlowReco/interface/PFBlockElementFwd.h deleted file mode 100644 index 1ec4e68460ee2..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFBlockElementFwd.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef DataFormats_ParticleFlowReco_PFBlockElementFwd_h -#define DataFormats_ParticleFlowReco_PFBlockElementFwd_h - -/* #include */ - -/* #include "DataFormats/Common/interface/RefProd.h" */ -/* #include "DataFormats/Common/interface/RefVector.h" */ - -namespace reco { - class PFBlockElement; - class PFBlockElementCluster; - class PFBlockElementTrack; -} // namespace reco - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFBlockElementSuperClusterFwd.h b/DataFormats/ParticleFlowReco/interface/PFBlockElementSuperClusterFwd.h deleted file mode 100644 index f185ddc2b8f96..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFBlockElementSuperClusterFwd.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef PFBlockElementSuperClusterFwd_H -#define PFBlockElementSuperClusterFwd_H -#include -#include "DataFormats/Common/interface/Ref.h" -namespace reco { - class PFBlockElementSuperCluster; - typedef std::vector PFBlockElementSuperClusterCollection; - typedef edm::Ref PFBlockElementSuperClusterRef; -} // namespace reco - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFClusterShapeAssociation.h b/DataFormats/ParticleFlowReco/interface/PFClusterShapeAssociation.h deleted file mode 100644 index d6dccf9c9c476..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFClusterShapeAssociation.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ParticleFlowReco_PFClusterShapeAssociation_h_ -#define ParticleFlowReco_PFClusterShapeAssociation_h_ -// \class PFClusterShapeAssociation -// -// \association of ClusterShape to PFCluster -// -// -// -#include "DataFormats/EgammaReco/interface/ClusterShapeFwd.h" -#include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h" -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/AssociationMap.h" -#include - -namespace reco -{ - typedef - edm::AssociationMap > - PFClusterShapeAssociationCollection; - typedef - PFClusterShapeAssociationCollection::value_type PFClusterShapeAssociation; - typedef - edm::Ref PFClusterShapeAssociationRef; - typedef - edm::RefProd PFClusterShapeAssociationRefProd; - typedef - edm::RefVector PFClusterShapeAssociationRefVector; -} - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFParticleFwd.h b/DataFormats/ParticleFlowReco/interface/PFParticleFwd.h deleted file mode 100644 index ae63ca1682f2b..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFParticleFwd.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef DataFormats_ParticleFlowReco_PFParticleFwd_h -#define DataFormats_ParticleFlowReco_PFParticleFwd_h -#include -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/RefProd.h" - -namespace reco { - class PFParticle; - - /// collection of PFParticle objects - typedef std::vector PFParticleCollection; - - /// persistent reference to PFParticle objects - typedef edm::Ref PFParticleRef; - - /// reference to PFParticle collection - typedef edm::RefProd PFParticleRefProd; - - /// vector of references to PFParticle objects all in the same collection - typedef edm::RefVector PFParticleRefVector; - - /// iterator over a vector of references to PFParticle objects - typedef PFParticleRefVector::iterator pfParticle_iterator; -} - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFSuperClusterFwd.h b/DataFormats/ParticleFlowReco/interface/PFSuperClusterFwd.h deleted file mode 100644 index 4710147743e4e..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFSuperClusterFwd.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ParticleFlowReco_PFSuperClusterFwd_h -#define ParticleFlowReco_PFSuperClusterFwd_h -#include -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/RefProd.h" - -namespace reco { - class PFSuperCluster; - - /// collection of PFSuperCluster objects - typedef std::vector PFSuperClusterCollection; - - /// persistent reference to PFSuperCluster objects - typedef edm::Ref PFSuperClusterRef; - - /// reference to PFSuperCluster collection - typedef edm::RefProd PFSuperClusterRefProd; - - /// vector of references to PFSuperCluster objects all in the same collection - typedef edm::RefVector PFSuperClusterRefVector; - - /// iterator over a vector of references to PFSuperCluster objects - typedef PFSuperClusterRefVector::iterator PFSuperCluster_iterator; -} - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFTrajectoryPointFwd.h b/DataFormats/ParticleFlowReco/interface/PFTrajectoryPointFwd.h deleted file mode 100644 index fa2645f21f5df..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFTrajectoryPointFwd.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef DataFormats_ParticleFlowReco_PFTrajectoryPointFwd_h -#define DataFormats_ParticleFlowReco_PFTrajectoryPointFwd_h -#include -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/RefProd.h" - -namespace reco { - class PFTrajectoryPoint; - - /// collection of PFTrajectoryPoint objects - typedef std::vector PFTrajectoryPointCollection; - - /// persistent reference to PFTrajectoryPoint objects - typedef edm::Ref PFTrajectoryPointRef; - - /// reference to PFTrajectoryPoint collection - typedef edm::RefProd PFTrajectoryPointRefProd; - - /// vector of references to PFTrajectoryPoint objects all in the same collection - typedef edm::RefVector PFTrajectoryPointRefVector; - - /// iterator over a vector of references to PFTrajectoryPoint objects - typedef PFTrajectoryPointRefVector::iterator trajectoryPoint_iterator; -} - -#endif diff --git a/DataFormats/Provenance/interface/BranchDescriptionIndex.h b/DataFormats/Provenance/interface/BranchDescriptionIndex.h deleted file mode 100644 index 23a6da64024b2..0000000000000 --- a/DataFormats/Provenance/interface/BranchDescriptionIndex.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef DataFormats_Provenance_BranchDescriptionIndex_h -#define DataFormats_Provenance_BranchDescriptionIndex_h -// -*- C++ -*- -// -// Package: Provenance -// Class : BranchDescriptionIndex -// -/**\class BranchDescriptionIndex BranchDescriptionIndex.h DataFormats/Provenance/interface/BranchDescriptionIndex.h - - Description: Index into BranchDescription vector - - Usage: - Internally used by ProductRegistry and by Principal to quickly find data - -*/ -// -// Original Author: Chris Jones -// Created: Thu Apr 30 15:46:09 CDT 2009 -// - -// system include files - -// user include files - -// forward declarations - -namespace edm { - typedef unsigned int BranchDescriptionIndex; -} - -#endif diff --git a/DataFormats/Provenance/interface/TypeInBranchType.h b/DataFormats/Provenance/interface/TypeInBranchType.h deleted file mode 100644 index 8dd5c6a262e52..0000000000000 --- a/DataFormats/Provenance/interface/TypeInBranchType.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef DataFormats_Provenance_TypeInBranchType_h -#define DataFormats_Provenance_TypeInBranchType_h -// -*- C++ -*- -// -// Package: Provenance -// Class : TypeInBranchType -// -/**\class TypeInBranchType TypeInBranchType.h DataFormats/Provenance/interface/TypeInBranchType.h - - Description: Pairs C++ class type and edm::BranchType - - Usage: - Used internally to ProductRegistry and for quickly finding data in Principals - -*/ -// -// Original Author: Chris Jones -// Created: Thu Apr 30 15:50:17 CDT 2009 -// - -// system include files - -// user include files -#include "DataFormats/Provenance/interface/BranchType.h" -#include "FWCore/Utilities/interface/TypeID.h" - -// forward declarations - -namespace edm { - class TypeInBranchType { - - public: - TypeInBranchType(TypeID const& iID, - BranchType const& iBranch) : - id_(iID), - branch_(iBranch) {} - - TypeID const& typeID() const { - return id_; - } - - BranchType const& branchType() const { - return branch_; - } - - bool operator<(TypeInBranchType const& iRHS) const { - if(branch_ < iRHS.branch_) { - return true; - } - if(iRHS.branch_ < branch_) { - return false; - } - return id_ < iRHS.id_; - } - private: - TypeID id_; - BranchType branch_; - }; - -} - -#endif diff --git a/DataFormats/RPCDigi/interface/RPCDigiL1Linkfwd.h b/DataFormats/RPCDigi/interface/RPCDigiL1Linkfwd.h deleted file mode 100644 index 429c7ab205921..0000000000000 --- a/DataFormats/RPCDigi/interface/RPCDigiL1Linkfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef RPCOBJECTS_RPCDIGIL1LINKFWD_H -#define RPCOBJECTS_RPCDIGIL1LINKFWD_H -class RPCDigiL1Link; -#endif // RPCOBJECTS_RPCDIGIL1LINKFWD_H diff --git a/DataFormats/SiPixelDigi/interface/PixelDigiCollectionfwd.h b/DataFormats/SiPixelDigi/interface/PixelDigiCollectionfwd.h deleted file mode 100644 index 9e5062017f007..0000000000000 --- a/DataFormats/SiPixelDigi/interface/PixelDigiCollectionfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TRACKINGOBJECTS_PIXELDIGICOLLECTIONFWD_H -#define TRACKINGOBJECTS_PIXELDIGICOLLECTIONFWD_H -class PixelDigiCollection; -#endif // TRACKINGOBJECTS_PIXELDIGICOLLECTIONFWD_H diff --git a/DataFormats/SiStripCluster/interface/SiStripClusterfwd.h b/DataFormats/SiStripCluster/interface/SiStripClusterfwd.h deleted file mode 100644 index 31f1ca1a32b87..0000000000000 --- a/DataFormats/SiStripCluster/interface/SiStripClusterfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DATAFORMATS_SISTRIPCLUSTERFWD_H -#define DATAFORMATS_SISTRIPCLUSTERFWD_H -class SiStripCluster; -#endif // DATAFORMATS_SISTRIPCLUSTERFWD_H diff --git a/DataFormats/SiStripCommon/interface/ConstantsForSummaryPlots.h b/DataFormats/SiStripCommon/interface/ConstantsForSummaryPlots.h deleted file mode 100644 index 7a0bd46627698..0000000000000 --- a/DataFormats/SiStripCommon/interface/ConstantsForSummaryPlots.h +++ /dev/null @@ -1,10 +0,0 @@ - -#ifndef DataFormats_SiStripCommon_ConstantsForSummaryPlots_H -#define DataFormats_SiStripCommon_ConstantsForSummaryPlots_H - -#include "DataFormats/SiStripCommon/interface/ConstantsForMonitorable.h" -#include "DataFormats/SiStripCommon/interface/ConstantsForPresentation.h" - -#endif // DataFormats_SiStripCommon_ConstantsForSummaryPlots_H - - diff --git a/DataFormats/SiStripDigi/interface/SiStripDigifwd.h b/DataFormats/SiStripDigi/interface/SiStripDigifwd.h deleted file mode 100644 index 5287a400d6d3b..0000000000000 --- a/DataFormats/SiStripDigi/interface/SiStripDigifwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TRACKINGOBJECTS_SISTRIPDIGIFWD_H -#define TRACKINGOBJECTS_SISTRIPDIGIFWD_H -class SiStripDigi; -#endif // TRACKINGOBJECTS_SISTRIPDIGIFWD_H diff --git a/DataFormats/TrackerRecHit2D/interface/SiPixelRecHitfwd.h b/DataFormats/TrackerRecHit2D/interface/SiPixelRecHitfwd.h deleted file mode 100644 index 1e5b57c035863..0000000000000 --- a/DataFormats/TrackerRecHit2D/interface/SiPixelRecHitfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DataFormats_SiPixelRecHitFWD_H -#define DataFormats_SiPixelRecHitFWD_H -class SiPixelRecHit; -#endif // diff --git a/DataFormats/TrajectorySeed/interface/BasicTrajectorySeed.h b/DataFormats/TrajectorySeed/interface/BasicTrajectorySeed.h deleted file mode 100644 index 12c0a9bf9db97..0000000000000 --- a/DataFormats/TrajectorySeed/interface/BasicTrajectorySeed.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DATAFORMATS_TRAJECTORYSEED_BASICTRAJECTORYSEED_h -#define DATAFORMATS_TRAJECTORYSEED_BASICTRAJECTORYSEED_h - - -#include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h" -typedef TrajectorySeed BasicTrajectorySeed; - - -#endif diff --git a/ElectroWeakAnalysis/WENu/interface/GenPurposeSkimmer.h b/ElectroWeakAnalysis/WENu/interface/GenPurposeSkimmer.h deleted file mode 100644 index 51465aed473b4..0000000000000 --- a/ElectroWeakAnalysis/WENu/interface/GenPurposeSkimmer.h +++ /dev/null @@ -1,199 +0,0 @@ -#ifndef GenPurposeSkimmer_H -#define GenPurposeSkimmer_H - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -// other files -// root + maths -#include "TFile.h" -#include "TBranch.h" -#include "TTree.h" -#include "TVector.h" -#include "TString.h" -#include "TMath.h" -// -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -// -#include "DataFormats/Common/interface/TriggerResults.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h" -#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" -#include "DataFormats/HLTReco/interface/TriggerRefsCollections.h" -#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "DataFormats/HLTReco/interface/TriggerObject.h" - -// -#include "DataFormats/Common/interface/ValueMap.h" -#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "DataFormats/METReco/interface/CaloMETFwd.h" -#include "DataFormats/METReco/interface/PFMET.h" -#include "DataFormats/METReco/interface/PFMETFwd.h" -#include "DataFormats/METReco/interface/GenMET.h" -#include "DataFormats/METReco/interface/GenMETFwd.h" - -#include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h" -// -#include "DataFormats/HepMCCandidate/interface/GenParticle.h" -#include "DataFormats/RecoCandidate/interface/IsoDeposit.h" -#include "DataFormats/RecoCandidate/interface/IsoDepositFwd.h" -#include "DataFormats/Common/interface/ValueMap.h" - -#include "DataFormats/PatCandidates/interface/Electron.h" -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/Math/interface/deltaR.h" -// -// class decleration -// - -class GenPurposeSkimmer : public edm::EDAnalyzer { -public: - explicit GenPurposeSkimmer(const edm::ParameterSet&); - ~GenPurposeSkimmer(); - -private: - virtual void beginJob(const edm::EventSetup&); - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob(); - - // ----------member data --------------------------- - - std::string outputFile_; - int tree_fills_; - - edm::InputTag ElectronCollection_; - edm::InputTag MCCollection_; - edm::InputTag MetCollectionTag_; - edm::InputTag tcMetCollectionTag_; - edm::InputTag pfMetCollectionTag_; - edm::InputTag t1MetCollectionTag_; - edm::InputTag t1MetCollectionTagTwiki_; - edm::InputTag genMetCollectionTag_; - // - edm::InputTag HLTCollectionE29_; - edm::InputTag HLTCollectionE31_; - edm::InputTag HLTTriggerResultsE29_; - edm::InputTag HLTTriggerResultsE31_; - edm::InputTag HLTFilterType_[25]; - std::string HLTPath_[25]; - - TTree* probe_tree; - TFile* histofile; - // - - //probe SC variables - double probe_sc_eta_for_tree[4]; - double probe_sc_phi_for_tree[4]; - double probe_sc_et_for_tree[4]; - int probe_sc_pass_fiducial_cut[4]; - int probe_sc_pass_et_cut[4]; - - //probe electron variables - double probe_ele_eta_for_tree[4]; - double probe_ele_phi_for_tree[4]; - double probe_ele_et_for_tree[4]; - double probe_ele_Xvertex_for_tree[4]; - double probe_ele_Yvertex_for_tree[4]; - double probe_ele_Zvertex_for_tree[4]; - double probe_ele_tip[4]; - int probe_charge_for_tree[4]; - int probe_index_for_tree[4]; - - //efficiency cuts - int probe_ele_pass_fiducial_cut[4]; - int probe_ele_pass_et_cut[4]; - int probe_pass_recoEle_cut[4]; - int probe_pass_iso_cut[4]; - // - double probe_isolation_value[4]; - double probe_iso_user[4]; - // - double probe_ecal_isolation_value[4]; - double probe_ecal_iso_user[4]; - - double probe_hcal_isolation_value[4]; - double probe_hcal_iso_user[4]; - // - int probe_classification_index_for_tree[4]; - int probe_pass_tip_cut[4]; - // - int probe_pass_id_robust_loose[4]; - int probe_pass_id_robust_tight[4]; - int probe_pass_id_loose[4]; - int probe_pass_id_tight[4]; - double probe_ele_hoe[4]; - double probe_ele_shh[4]; - double probe_ele_sihih[4]; - double probe_ele_dhi[4]; - double probe_ele_dfi[4]; - double probe_ele_eop[4]; - double probe_ele_pin[4]; - double probe_ele_pout[4]; - double probe_ele_e5x5[4]; - double probe_ele_e2x5[4]; - double probe_ele_e1x5[4]; - - // - int probe_pass_trigger_cut[4][25]; - double probe_hlt_matched_dr[4]; - // - double MCMatch_Deta_; - double MCMatch_Dphi_; - int probe_mc_matched[4]; - double probe_mc_matched_deta[4]; - double probe_mc_matched_dphi[4]; - double probe_mc_matched_denergy[4]; - int probe_mc_matched_mother[4]; - - //event variables - int numberOfHLTFilterObjects[25]; - - int event_HLTPath[25]; - - double BarrelMaxEta; - double EndcapMinEta; - double EndcapMaxEta; - - double ProbeSCMinEt; - double ProbeRecoEleSCMaxDE; - - double ProbeHLTObjMaxDR; - double RecoEleSeedBCMaxDE; - double GsfTrackMinInnerPt; - - int elec_number_in_event; - int elec_1_duplicate_removal; - - double event_MET, event_MET_sig; - // double event_MET_eta; - double event_MET_phi; - double event_tcMET, event_tcMET_sig, event_tcMET_phi; - double event_pfMET, event_pfMET_sig; - // double event_pfMET_eta; - double event_pfMET_phi; - double event_genMET, event_genMET_sig; - // double event_genMET_eta; - double event_genMET_phi; - // - double event_t1MET, event_t1MET_phi, event_t1MET_sig; - double event_twikiT1MET, event_twikiT1MET_phi, event_twikiT1MET_sig; -}; - -#endif diff --git a/ElectroWeakAnalysis/WENu/interface/GenPurposeSkimmerAcceptance.h b/ElectroWeakAnalysis/WENu/interface/GenPurposeSkimmerAcceptance.h deleted file mode 100644 index 273707984db38..0000000000000 --- a/ElectroWeakAnalysis/WENu/interface/GenPurposeSkimmerAcceptance.h +++ /dev/null @@ -1,221 +0,0 @@ -#ifndef GenPurposeSkimmerAcceptance_H -#define GenPurposeSkimmerAcceptance_H - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -// other files -// root + maths -#include "TFile.h" -#include "TBranch.h" -#include "TTree.h" -#include "TVector.h" -#include "TString.h" -#include "TMath.h" -// -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -// -#include "DataFormats/Common/interface/TriggerResults.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h" -#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" -#include "DataFormats/HLTReco/interface/TriggerRefsCollections.h" -#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "DataFormats/HLTReco/interface/TriggerObject.h" - -// -#include "DataFormats/Common/interface/ValueMap.h" -#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "DataFormats/METReco/interface/CaloMETFwd.h" -#include "DataFormats/METReco/interface/PFMET.h" -#include "DataFormats/METReco/interface/PFMETFwd.h" -#include "DataFormats/METReco/interface/GenMET.h" -#include "DataFormats/METReco/interface/GenMETFwd.h" - -#include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h" -// -#include "DataFormats/HepMCCandidate/interface/GenParticle.h" -#include "DataFormats/RecoCandidate/interface/IsoDeposit.h" -#include "DataFormats/RecoCandidate/interface/IsoDepositFwd.h" -#include "DataFormats/Common/interface/ValueMap.h" - -#include "DataFormats/PatCandidates/interface/Electron.h" -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/Math/interface/deltaR.h" -// -// class decleration -// - -class GenPurposeSkimmerAcceptance : public edm::EDAnalyzer { -public: - explicit GenPurposeSkimmerAcceptance(const edm::ParameterSet&); - ~GenPurposeSkimmerAcceptance(); - -private: - virtual void beginJob(const edm::EventSetup&); - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob(); - - // ----------member data --------------------------- - - std::string outputFile_; - int tree_fills_; - - edm::InputTag ElectronCollection_; - edm::InputTag MCCollection_; - edm::InputTag MetCollectionTag_; - edm::InputTag tcMetCollectionTag_; - edm::InputTag pfMetCollectionTag_; - edm::InputTag t1MetCollectionTag_; - edm::InputTag t1MetCollectionTagTwiki_; - edm::InputTag genMetCollectionTag_; - // - edm::InputTag HLTCollectionE29_; - edm::InputTag HLTCollectionE31_; - edm::InputTag HLTTriggerResultsE29_; - edm::InputTag HLTTriggerResultsE31_; - edm::InputTag HLTFilterType_[25]; - std::string HLTPath_[25]; - - TTree* probe_tree; - TFile* histofile; - // - - //probe SC variables - double probe_sc_eta_for_tree[4]; - double probe_sc_phi_for_tree[4]; - double probe_sc_et_for_tree[4]; - int probe_sc_pass_fiducial_cut[4]; - int probe_sc_pass_et_cut[4]; - - //probe electron variables - double probe_ele_eta_for_tree[4]; - double probe_ele_phi_for_tree[4]; - double probe_ele_et_for_tree[4]; - double probe_ele_Xvertex_for_tree[4]; - double probe_ele_Yvertex_for_tree[4]; - double probe_ele_Zvertex_for_tree[4]; - double probe_ele_tip[4]; - int probe_charge_for_tree[4]; - int probe_index_for_tree[4]; - - //efficiency cuts - int probe_ele_pass_fiducial_cut[4]; - int probe_ele_pass_et_cut[4]; - int probe_pass_recoEle_cut[4]; - int probe_pass_iso_cut[4]; - // - double probe_isolation_value[4]; - double probe_iso_user[4]; - // - double probe_ecal_isolation_value[4]; - double probe_ecal_iso_user[4]; - - double probe_hcal_isolation_value[4]; - double probe_hcal_iso_user[4]; - // - int probe_classification_index_for_tree[4]; - int probe_pass_tip_cut[4]; - // - int probe_pass_id_robust_loose[4]; - int probe_pass_id_robust_tight[4]; - int probe_pass_id_loose[4]; - int probe_pass_id_tight[4]; - double probe_ele_hoe[4]; - double probe_ele_shh[4]; - double probe_ele_sihih[4]; - double probe_ele_dhi[4]; - double probe_ele_dfi[4]; - double probe_ele_eop[4]; - double probe_ele_pin[4]; - double probe_ele_pout[4]; - double probe_ele_e5x5[4]; - double probe_ele_e2x5[4]; - double probe_ele_e1x5[4]; - - // - int probe_pass_trigger_cut[4][25]; - double probe_hlt_matched_dr[4]; - // - double MCMatch_Deta_; - double MCMatch_Dphi_; - int probe_mc_matched[4]; - double probe_mc_matched_deta[4]; - double probe_mc_matched_dphi[4]; - double probe_mc_matched_denergy[4]; - int probe_mc_matched_mother[4]; - - //event variables - int numberOfHLTFilterObjects[25]; - - int event_HLTPath[25]; - - double BarrelMaxEta; - double EndcapMinEta; - double EndcapMaxEta; - - double ProbeSCMinEt; - double ProbeRecoEleSCMaxDE; - - double ProbeHLTObjMaxDR; - double RecoEleSeedBCMaxDE; - double GsfTrackMinInnerPt; - - int elec_number_in_event; - int elec_1_duplicate_removal; - - double event_MET, event_MET_sig; - // double event_MET_eta; - double event_MET_phi; - double event_tcMET, event_tcMET_sig, event_tcMET_phi; - double event_pfMET, event_pfMET_sig; - // double event_pfMET_eta; - double event_pfMET_phi; - double event_genMET, event_genMET_sig; - // double event_genMET_eta; - double event_genMET_phi; - // - double event_t1MET, event_t1MET_phi, event_t1MET_sig; - double event_twikiT1MET, event_twikiT1MET_phi, event_twikiT1MET_sig; - // - // - // acceptance and t&p specific - double mc_ele_eta[10]; - double mc_ele_phi[10]; - double mc_ele_et[10]; - double mc_ele_vertex_x[10]; - double mc_ele_vertex_y[10]; - double mc_ele_vertex_z[10]; - int mc_ele_mother[10]; - int mc_ele_charge[10]; - int mc_ele_status[10]; - // - // for the sc collections - // double sc0_eta[8], sc0_phi[8], sc0_et[8]; - double sc1_eta[8], sc1_phi[8], sc1_et[8]; - double sc2_eta[8], sc2_phi[8], sc2_et[8]; - double sc3_eta[8], sc3_phi[8], sc3_et[8]; - double sc4_eta[8], sc4_phi[8], sc4_et[8]; - double sc5_eta[8], sc5_phi[8], sc5_et[8]; - // double sc6_eta[8], sc6_phi[8], sc6_et[8]; - // double sc7_eta[8], sc7_phi[8], sc7_et[8]; -}; - -#endif diff --git a/ElectroWeakAnalysis/ZEE/interface/AnalysisErsatz.h b/ElectroWeakAnalysis/ZEE/interface/AnalysisErsatz.h deleted file mode 100644 index f837e61689dce..0000000000000 --- a/ElectroWeakAnalysis/ZEE/interface/AnalysisErsatz.h +++ /dev/null @@ -1,139 +0,0 @@ -// -*- C++ -*- -// -// Package: AnalysisErsatz -// Class: AnalysisErsatz -// -/**\class AnalysisErsatz AnalysisErsatz.cc ElectroWeakAnalysis/AnalysisErsatz/src/AnalysisErsatz.cc - - Description: - - Implementation: - -*/ -// -// Original Author: David Wardrope -// Created: Fri Nov 14 15:00:43 GMT 2008 -// -// - - -// system include files -#include -//Framework -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" -//Random Number Generator -#include "FWCore/Utilities/interface/RandomNumberGenerator.h" -#include "CLHEP/Random/RandFlat.h" -//Egamma -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" -//OtherObjects -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/HepMCCandidate/interface/GenParticle.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "DataFormats/METReco/interface/CaloMETFwd.h" -#include "DataFormats/METReco/interface/GenMET.h" -#include "DataFormats/METReco/interface/GenMETFwd.h" -#include "DataFormats/METReco/interface/PFMET.h" -#include "DataFormats/METReco/interface/PFMETFwd.h" -#include "DataFormats/METReco/interface/MET.h" -#include "DataFormats/METReco/interface/METFwd.h" -//PhysicsTools -//#include "PhysicsTools/Utilities/interface/deltaR.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "CommonTools/CandUtils/interface/CenterOfMassBooster.h" -#include "Math/GenVector/Boost.h" - -//Helper Functions -#include "ElectroWeakAnalysis/ZEE/interface/UniqueElectrons.h" -#include "ElectroWeakAnalysis/ZEE/interface/ElectronSelector.h" -#include "ElectroWeakAnalysis/ZEE/interface/CaloVectors.h" -//ROOT -#include "TTree.h" - -#define nEntries_arr_ 4 -// -// class declaration -// - -//namespace CLHEP{ -// class RandFlat; -//} - -class AnalysisErsatz : public edm::EDAnalyzer { - public: - explicit AnalysisErsatz(const edm::ParameterSet&); - ~AnalysisErsatz(); - - - private: - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - // ----------member data --------------------------- - edm::EDGetTokenT MCTruthCollection_; - edm::EDGetTokenT ElectronCollection_; - edm::EDGetTokenT CaloMEtCollection_; - edm::EDGetTokenT T1MEtCollection_; - edm::EDGetTokenT PfMEtCollection_; - edm::EDGetTokenT TcMEtCollection_; - edm::EDGetTokenT GenMEtCollection_; - bool ErsatzEvent_, C_Fiducial_; - enum cut_index_t { EtCut_, EB_sIhIh_, EB_dEtaIn_, EB_dPhiIn_, EB_TrckIso_, EB_EcalIso_, EB_HcalIso_, - EE_sIhIh_, EE_dEtaIn_, EE_dPhiIn_, EE_TrckIso_, EE_EcalIso_, EE_HcalIso_}; - std::vector CutVector_; - double mW_, mZ_; - edm::EDGetTokenT TriggerEvent_; - edm::EDGetTokenT TriggerResults_; - TriggerPath_; - std::string TriggerName_; - - TTree* t_; - double Boson_pt_, Boson_y_, Boson_m_, Boson_mt_; - double Boson_phi_; - double McElec3_pt_[nEntries_arr_], McElec3_eta_[nEntries_arr_]; - double McElec1_pt_[nEntries_arr_], McElec1_eta_[nEntries_arr_]; - int RndmInt_; - double RndmMcElec_pt_, RndmMcElec_eta_, RndmMcElec_phi_; - double RndmMcElec_Rescaled_pt_, RndmMcElec_Rescaled_eta_, RndmMcElec_Rescaled_phi_; - double RndmMcElecTRIG_pt_, RndmMcElecTRIG_eta_, RndmMcElecRECO_pt_, RndmMcElecRECO_eta_; - double OthrMcElec_pt_, OthrMcElec_eta_, OthrMcElec_phi_; - double OthrMcElecTRIG_pt_, OthrMcElecTRIG_eta_, OthrMcElecRECO_pt_, OthrMcElecRECO_eta_; - double OthrMcElec_Rescaled_pt_, OthrMcElec_Rescaled_eta_, OthrMcElec_Rescaled_phi_; - int RndmTrig_, RndmReco_, OthrTrig_, OthrReco_; - double McNu_pt_, McNu_eta_, McNu_phi_, McNu_ECALeta_; - double McNu_vx_, McNu_vy_, McNu_vz_; - double McLeptons_dPhi_, McLeptons_dEta_, McLeptons_dR_; - - double elec_q_[nEntries_arr_]; - double elec_pt_[nEntries_arr_], elec_eta_[nEntries_arr_], elec_phi_[nEntries_arr_]; - double elec_pt25_, elec_eta25_, elec_phi25_; - double elec_sIhIh_[nEntries_arr_], elec_dPhiIn_[nEntries_arr_], elec_dEtaIn_[nEntries_arr_]; - double elec_trckIso_[nEntries_arr_], elec_ecalIso_[nEntries_arr_], elec_hcalIso_[nEntries_arr_]; - double elec_e5x5_[nEntries_arr_], elec_e2x5Max_[nEntries_arr_], elec_e1x5Max_[nEntries_arr_]; - double elec_hoe_[nEntries_arr_], elec_eop_[nEntries_arr_], elec_pin_[nEntries_arr_], elec_pout_[nEntries_arr_]; - - double Selected_nuPt_[nEntries_arr_], Selected_nuEta_[nEntries_arr_], Selected_nuPhi_[nEntries_arr_]; - double caloMEt_, caloSumEt_, caloUESumEt_; - double t1MEt_, t1MEtPhi_, t1SumEt_; - double pfMEt_, pfMEtPhi_, pfSumEt_; - double tcMEt_, tcMEtPhi_, tcSumEt_; - double caloMEt25_, caloMEt30_; - double caloMEtECAL25_, caloMEtECAL30_;//using ECAL eta to restrict neutrino - double caloMEtPhi_, caloMEtPhi25_, caloMEtPhi30_; - double caloMEtPhiECAL25_, caloMEtPhiECAL30_;//using ECAL eta to restrict neutrino - double caloMt_[nEntries_arr_], caloMt25_[nEntries_arr_], caloMt30_[nEntries_arr_]; - double genMEt_, genMt_[nEntries_arr_], genUESumEt_, genMEt25_; - int nHltObj_, nSelElecs_; - double HltObj_pt_[nEntries_arr_], HltObj_eta_[nEntries_arr_]; -}; - diff --git a/ElectroWeakAnalysis/ZMuMu/bin/csa08IsoBkg.cpp b/ElectroWeakAnalysis/ZMuMu/bin/csa08IsoBkg.cpp deleted file mode 100644 index 5f8ab8d826306..0000000000000 --- a/ElectroWeakAnalysis/ZMuMu/bin/csa08IsoBkg.cpp +++ /dev/null @@ -1,288 +0,0 @@ -#include "PhysicsTools/Utilities/interface/Parameter.h" -#include "PhysicsTools/Utilities/interface/ZLineShape.h" -#include "PhysicsTools/Utilities/interface/Gaussian.h" -#include "PhysicsTools/Utilities/interface/Numerical.h" -#include "PhysicsTools/Utilities/interface/Exponential.h" -#include "PhysicsTools/Utilities/interface/Polynomial.h" -#include "PhysicsTools/Utilities/interface/Constant.h" -#include "PhysicsTools/Utilities/interface/Convolution.h" -#include "PhysicsTools/Utilities/interface/Operations.h" -#include "PhysicsTools/Utilities/interface/Integral.h" -#include "PhysicsTools/Utilities/interface/MultiHistoChiSquare.h" -#include "PhysicsTools/Utilities/interface/RootMinuit.h" -#include "PhysicsTools/Utilities/interface/RootMinuitCommands.h" -#include "PhysicsTools/Utilities/interface/FunctClone.h" -#include "PhysicsTools/Utilities/interface/rootPlot.h" -#include "TROOT.h" -#include "TH1.h" -#include "TFile.h" -#include -using namespace boost; -namespace po = boost::program_options; - -#include -#include -#include -#include -#include -#include -using namespace std; - -// A helper function to simplify the main part. -template -ostream& operator<<(ostream& os, const vector& v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); - return os; -} - -//A function that sets istogram contents to 0 -//if they are too small -void fix(TH1* histo) { - for(int i = 1; i <= histo->GetNbinsX(); ++i) { - if(histo->GetBinContent(i) < 0.1) { - histo->SetBinContent(i, 0.0); - histo->SetBinError(i, 0.0); - } - } -} - -typedef funct::GaussIntegrator IntegratorConv; -typedef funct::GaussIntegrator IntegratorNorm; - -typedef funct::Product::type>::type ZPeak; - -typedef funct::Master SigPeak; -typedef funct::Slave SigPeakClone; -typedef funct::Product::type Sig1; -typedef funct::Product::type Sig2; - -typedef funct::Product< - funct::Exponential, - funct::Polynomial<2> >::type ExpPoly; - -NUMERICAL_FUNCT_INTEGRAL(ExpPoly, GaussIntegrator); - -typedef funct::DefIntegral ExpPolyNormFactor; -typedef funct::Ratio::type ExpPolyNorm; - -typedef funct::Product< - funct::Parameter, - funct::Difference< - funct::Ratio< - funct::Numerical<2>, - funct::Parameter>::type, - funct::Numerical<2> >::type>::type Coeff1; - -typedef funct::Product::type Bkg1; - -typedef funct::Product< - funct::Parameter, - funct::Square< - funct::Difference< - funct::Ratio< - funct::Numerical<1>, - funct::Parameter>::type, - funct::Numerical<1> >::type>::type>::type Coeff2; - -typedef funct::Product::type Bkg2; - -NUMERICAL_FUNCT_INTEGRAL(Bkg1, GaussIntegrator); -NUMERICAL_FUNCT_INTEGRAL(Bkg2, GaussIntegrator); - -typedef funct::Sum::type Fun1; -typedef funct::Sum::type Fun2; -typedef fit::MultiHistoChiSquare ChiSquared; - -int main(int ac, char *av[]) { - gROOT->SetStyle("Plain"); - try { - double fMin, fMax; - string ext; - po::options_description desc("Allowed options"); - desc.add_options() - ("help,h", "produce help message") - ("input-file,i", po::value< vector >(), "input file") - ("min,m", po::value(&fMin)->default_value(60), "minimum value for fit range") - ("max,M", po::value(&fMax)->default_value(120), "maximum value for fit range") - ("plot-format,p", po::value(&ext)->default_value("ps"), - "output plot format") - ; - - po::positional_options_description p; - p.add("input-file", -1); - - po::variables_map vm; - po::store(po::command_line_parser(ac, av). - options(desc).positional(p).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - cout << "Usage: options_description [options]\n"; - cout << desc; - return 0; - } - - fit::RootMinuitCommands commands("csa08IsoBkg.txt"); - - if (vm.count("input-file")) { - cout << "Input files are: " - << vm["input-file"].as< vector >() << "\n"; - vector v_file = vm["input-file"].as< vector >(); - for(vector::const_iterator it = v_file.begin(); - it != v_file.end(); ++it) { - TFile * root_file = new TFile(it->c_str(),"read"); - - TH1D * histo1 = (TH1D*) root_file->Get("oneNonIsolatedZToMuMuPlots/zMass"); - fix(histo1); - TH1D * histo2 = (TH1D*) root_file->Get("twoNonIsolatedZToMuMuPlots/zMass"); - fix(histo2); - - cout << ">>> histogram loaded\n"; - string f_string = *it; - replace(f_string.begin(), f_string.end(), '.', '_'); - replace(f_string.begin(), f_string.end(), '/', '_'); - string plot_string = f_string + "." + ext; - cout << ">>> Input files loaded\n"; - - const char * kYieldZMuMu1 = "YieldZMuMu1"; - const char * kYieldZMuMu2 = "YieldZMuMu2"; - const char * kYieldBkg = "YieldBkg"; - const char * kEffBkg = "EffBkg"; - const char * kLambdaZMuMu = "LambdaZMuMu"; - const char * kMass = "Mass"; - const char * kGamma = "Gamma"; - const char * kPhotonFactorZMuMu = "PhotonFactorZMuMu"; - const char * kInterferenceFactorZMuMu = "InterferenceFactorZMuMu"; - const char * kMeanZMuMu = "MeanZMuMu"; - const char * kSigmaZMuMu = "SigmaZMuMu"; - const char * kAlpha = "Alpha"; - const char * kA0 = "A0"; - const char * kA1 = "A1"; - const char * kA2 = "A2"; - - funct::Parameter lambdaZMuMu(kLambdaZMuMu, commands.par(kLambdaZMuMu)); - funct::Parameter mass(kMass, commands.par(kMass)); - funct::Parameter gamma(kGamma, commands.par(kGamma)); - funct::Parameter photonFactorZMuMu(kPhotonFactorZMuMu, commands.par(kPhotonFactorZMuMu)); - funct::Parameter interferenceFactorZMuMu(kInterferenceFactorZMuMu, commands.par(kInterferenceFactorZMuMu)); - funct::Parameter yieldZMuMu1(kYieldZMuMu1, commands.par(kYieldZMuMu1)); - funct::Parameter yieldZMuMu2(kYieldZMuMu2, commands.par(kYieldZMuMu2)); - funct::Parameter yieldBkg(kYieldBkg, commands.par(kYieldBkg)); - funct::Parameter effBkg(kEffBkg, commands.par(kEffBkg)); - funct::Parameter meanZMuMu(kMeanZMuMu, commands.par(kMeanZMuMu)); - funct::Parameter sigmaZMuMu(kSigmaZMuMu, commands.par(kSigmaZMuMu)); - funct::Parameter alpha(kAlpha, commands.par(kAlpha)); - funct::Parameter a0(kA0, commands.par(kA0)); - funct::Parameter a1(kA1, commands.par(kA1)); - funct::Parameter a2(kA2, commands.par(kA2)); - funct::Constant cFMin(fMin), cFMax(fMax); - - IntegratorConv integratorConv(1.e-4); - IntegratorNorm integratorNorm(1.e-4); - - ZPeak zPeak = funct::Exponential(lambdaZMuMu) * - funct::conv(funct::ZLineShape(mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu), - funct::Gaussian(meanZMuMu, sigmaZMuMu), - -3*sigmaZMuMu.value(), 3*sigmaZMuMu.value(), integratorConv); - SigPeak sp = funct::master(zPeak); - SigPeakClone spc = funct::slave(sp); - Sig1 sig1 = yieldZMuMu1 * sp; - Sig2 sig2 = yieldZMuMu2 * spc; - funct::Numerical<1> _1; - funct::Numerical<2> _2; - ExpPoly ep = funct::Exponential(alpha) * funct::Polynomial<2>(a0, a1, a2); - ExpPolyNorm epn = ep / ExpPolyNormFactor(ep, cFMin, cFMax, integratorNorm); - Coeff1 c1 = yieldBkg * (_2 / effBkg - _2); - Bkg1 bkg1 = c1 * epn; - Coeff2 c2 = yieldBkg * ((_1 /effBkg - _1) ^ _2); - Bkg2 bkg2 = c2 * epn; - Fun1 f1 = sig1 + bkg1; - Fun2 f2 = sig2 + bkg2; - - ChiSquared chi2(f1, histo1, f2, histo2, fMin, fMax); - cout << "N. deg. of freedom: " << chi2.degreesOfFreedom() << endl; - fit::RootMinuit minuit(chi2, true); - commands.add(minuit, yieldZMuMu1); - commands.add(minuit, yieldZMuMu2); - commands.add(minuit, yieldBkg); - commands.add(minuit, effBkg); - commands.add(minuit, lambdaZMuMu); - commands.add(minuit, mass); - commands.add(minuit, gamma); - commands.add(minuit, photonFactorZMuMu); - commands.add(minuit, interferenceFactorZMuMu); - commands.add(minuit, meanZMuMu); - commands.add(minuit, sigmaZMuMu); - commands.add(minuit, alpha); - commands.add(minuit, a0); - commands.add(minuit, a1); - commands.add(minuit, a2); - commands.run(minuit); - const unsigned int nPar = 15;//WARNIG: this must be updated manually for now - ROOT::Math::SMatrix > err; - minuit.getErrorMatrix(err); - std::cout << "error matrix:" << std::endl; - for(unsigned int i = 0; i < nPar; ++i) { - for(unsigned int j = 0; j < nPar; ++j) { - std::cout << err(i, j) << "\t"; - } - std::cout << std::endl; - } - minuit.printFitResults(); - - funct::GaussIntegrator integrator(1.e-6); - double nbkg1 = funct::integral_f(bkg1, fMin, fMax, integrator); - double nbkg2 = funct::integral_f(bkg2, fMin, fMax, integrator); - std::cout << "Background yields in [" << fMin <<", " << fMax << "]: " - << nbkg1 <<", " <Integral(int(fMin), int(fMax)); - double i2 = histo2->Integral(int(fMin), int(fMax)); - std::cout << "Histogram integrals in [" << fMin <<", " << fMax << "]: " - << i1 <<", " << i2 << std::endl; - double s; - s = 0; - for(int i = 1; i <= histo1->GetNbinsX(); ++i) - s += histo1->GetBinContent(i); - histo1->SetEntries(s); - s = 0; - for(int i = 1; i <= histo2->GetNbinsX(); ++i) - s += histo2->GetBinContent(i); - histo2->SetEntries(s); - - double extrap = nbkg1*nbkg1 / nbkg2 /4; - cout << "extrapolated background with no isolated muons:" << extrap << endl; - - string Plot1 = "OneIsolated_" + plot_string; - root::plot(Plot1.c_str(), *histo1, f1, fMin, fMax, - yieldZMuMu1, lambdaZMuMu, mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu, - meanZMuMu, sigmaZMuMu, yieldBkg, effBkg, alpha, a0, a1, a2, - kRed, 2, kDashed, 100, - "Z -> #mu #mu mass", "#mu #mu invariant mass (GeV/c^{2})", - "Events"); - string Plot2 = "TwoIsolated_" + plot_string; - root::plot(Plot2.c_str(), *histo2, f2, fMin, fMax, - yieldZMuMu2, lambdaZMuMu, mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu, - meanZMuMu, sigmaZMuMu, yieldBkg, effBkg, alpha, a0, a1, a2, - kRed, 2, kDashed, 100, - "Z -> #mu #mu mass", "#mu #mu invariant mass (GeV/c^{2})", - "Events"); - } - } - - } - catch(exception& e) { - cerr << "error: " << e.what() << "\n"; - return 1; - } - catch(...) { - cerr << "Exception of unknown type!\n"; - } - return 0; -} - - - diff --git a/ElectroWeakAnalysis/ZMuMu/bin/csa08ZFit.cpp b/ElectroWeakAnalysis/ZMuMu/bin/csa08ZFit.cpp deleted file mode 100644 index 7ae7f02213133..0000000000000 --- a/ElectroWeakAnalysis/ZMuMu/bin/csa08ZFit.cpp +++ /dev/null @@ -1,384 +0,0 @@ -#include "PhysicsTools/Utilities/interface/Parameter.h" -#include "PhysicsTools/Utilities/interface/ZLineShape.h" -#include "PhysicsTools/Utilities/interface/Gaussian.h" -#include "PhysicsTools/Utilities/interface/Numerical.h" -#include "PhysicsTools/Utilities/interface/Exponential.h" -#include "PhysicsTools/Utilities/interface/Polynomial.h" -#include "PhysicsTools/Utilities/interface/Constant.h" -#include "PhysicsTools/Utilities/interface/Convolution.h" -#include "PhysicsTools/Utilities/interface/Operations.h" -#include "PhysicsTools/Utilities/interface/Integral.h" -#include "PhysicsTools/Utilities/interface/MultiHistoChiSquare.h" -#include "PhysicsTools/Utilities/interface/RootMinuit.h" -#include "PhysicsTools/Utilities/interface/RootMinuitCommands.h" -#include "PhysicsTools/Utilities/interface/FunctClone.h" -#include "PhysicsTools/Utilities/interface/rootPlot.h" -#include "TROOT.h" -#include "TH1.h" -#include "TFile.h" -#include -using namespace boost; -namespace po = boost::program_options; - -#include -#include -#include -#include -#include -#include -using namespace std; - -// A helper function to simplify the main part. -template -ostream& operator<<(ostream& os, const vector& v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); - return os; -} - -//A function that sets istogram contents to 0 -//if they are too small -void fix(TH1* histo) { - for(int i = 1; i <= histo->GetNbinsX(); ++i) { - if(histo->GetBinContent(i) < 0.1) { - histo->SetBinContent(i, 0.0); - histo->SetBinError(i, 0.0); - } - } -} - -typedef funct::GaussIntegrator IntegratorConv; -typedef funct::GaussIntegrator IntegratorNorm; -//typedef funct::TrapezoidIntegrator IntegratorConv; -//typedef funct::TrapezoidIntegrator IntegratorNorm; - -typedef funct::Product::type>::type ZPeakNoNorm; - -NUMERICAL_FUNCT_INTEGRAL(ZPeakNoNorm, IntegratorNorm); - -typedef funct::DefIntegral ZPeakNormFactor; -typedef funct::Ratio::type ZPeak; - -int main(int ac, char *av[]) { - gROOT->SetStyle("Plain"); - try { - typedef funct::Power >::type IsoefficiencytermSQ; - typedef funct::Master::type> ZMuMuFun; - typedef funct::Slave::type> ZMuMuFunClone; - typedef funct::Product >::type, - funct::Power >::type >::type, - IsoefficiencytermSQ >::type ZMuMuEfficiencyTerm; - typedef funct::Product::type ZMuMuSig; - - - typedef funct::Product >::type, - funct::Power >::type >::type, - funct::Difference, IsoefficiencytermSQ >::type>::type ZMuMuNoIsoEfficiencyTerm; - - typedef funct::Product::type ZMuMuNoIsoSig; - - typedef funct::Product, - funct::Product >::type, - funct::Product, funct::Parameter>::type - >::type - >::type - >::type, IsoefficiencytermSQ >::type ZMuTkEfficiencyTerm; - - - - typedef funct::Product::type ZMuTkSig; - typedef funct::Product >::type >::type ZMuTkBkg; - typedef funct::Product::type ZMuTkBkgScaled;//bgtrack rescaled - typedef ZMuTkBkg ZMuMuNoIsoBkg; - typedef ZMuTkBkgScaled ZMuMuNoIsoBkgScaled ;//bgZmmNotIso rescaled - typedef ZMuTkEfficiencyTerm ZMuSaEfficiencyTerm; - typedef funct::Product::type>::type ZMuSaSig; - typedef funct::Product::type ZMuSaBkg; - - // typedef ZMuTkBkg ZMuMuNoIsoBkg; - typedef funct::Product::type>::type ZMuMuNoIso;//3 - typedef funct::Product::type ZMuMu; - typedef funct::Product::type>::type ZMuTk; - typedef funct::Product::type>::type ZMuSa; - typedef fit::MultiHistoChiSquare ChiSquared; - - double fMin, fMax; - string ext; - po::options_description desc("Allowed options"); - desc.add_options() - ("help,h", "produce help message") - ("input-file,i", po::value< vector >(), "input file") - ("min,m", po::value(&fMin)->default_value(60), "minimum value for fit range") - ("max,M", po::value(&fMax)->default_value(120), "maximum value for fit range") - ("plot-format,p", po::value(&ext)->default_value("ps"), - "output plot format") - ; - - po::positional_options_description p; - p.add("input-file", -1); - - po::variables_map vm; - po::store(po::command_line_parser(ac, av). - options(desc).positional(p).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - cout << "Usage: options_description [options]\n"; - cout << desc; - return 0; - } - - fit::RootMinuitCommands commands("csa08ZFit.txt"); - - const int rebinMuMuNoIso = 2,rebinMuMu = 1, rebinMuTk = 2, rebinMuSa = 8; - // assume that the bin size is 1 GeV!!! - funct::Constant rebinMuMuNoIsoConst(rebinMuMuNoIso),rebinMuMuConst(rebinMuMu), rebinMuTkConst(rebinMuTk), rebinMuSaConst(rebinMuSa); - - if (vm.count("input-file")) { - cout << "Input files are: " - << vm["input-file"].as< vector >() << "\n"; - vector v_file = vm["input-file"].as< vector >(); - for(vector::const_iterator it = v_file.begin(); - it != v_file.end(); ++it) { - TFile * root_file = new TFile(it->c_str(),"read"); - - TH1D * histoZMuMuNoIso = (TH1D*) root_file->Get("nonIsolatedZToMuMuPlots/zMass"); - histoZMuMuNoIso->Rebin(rebinMuMuNoIso); - fix(histoZMuMuNoIso); - - TH1D * histoZMuMu = (TH1D*) root_file->Get("goodZToMuMuPlots/zMass"); - histoZMuMu->Rebin(rebinMuMu); - fix(histoZMuMu); - - TH1D * histoZMuTk = (TH1D*) root_file->Get("goodZToMuMuOneTrackPlots/zMass"); - histoZMuTk->Rebin(rebinMuTk); - fix(histoZMuTk); - - TH1D * histoZMuSa = (TH1D*) root_file->Get("goodZToMuMuOneStandAloneMuonPlots/zMass"); - histoZMuSa->Rebin(rebinMuSa); - fix(histoZMuSa); - - cout << ">>> histogram loaded\n"; - string f_string = *it; - replace(f_string.begin(), f_string.end(), '.', '_'); - replace(f_string.begin(), f_string.end(), '/', '_'); - string plot_string = f_string + "." + ext; - cout << ">>> Input files loaded\n"; - - const char * kYieldZMuMu = "YieldZMuMu"; - const char * kEfficiencyTk = "EfficiencyTk"; - const char * kEfficiencySa = "EfficiencySa"; - const char * kEfficiencyIso = "EfficiencyIso"; - const char * kYieldBkgZMuTk = "YieldBkgZMuTk"; - const char * kYieldBkgZMuSa = "YieldBkgZMuSa"; - const char * kYieldBkgZMuMuNotIso = "YieldBkgZMuMuNotIso"; - const char * kLambdaZMuMu = "LambdaZMuMu"; - const char * kMass = "Mass"; - const char * kGamma = "Gamma"; - const char * kPhotonFactorZMuMu = "PhotonFactorZMuMu"; - const char * kInterferenceFactorZMuMu = "InterferenceFactorZMuMu"; - const char * kMeanZMuMu = "MeanZMuMu"; - const char * kSigmaZMuMu = "SigmaZMuMu"; - const char * kAlpha = "Alpha"; - const char * kB0 = "B0"; - const char * kB1 = "B1"; - const char * kB2 = "B2"; - const char * kLambda = "Lambda"; - const char * kA0 = "A0"; - const char * kA1 = "A1"; - const char * kA2 = "A2"; - const char * kBeta = "Beta"; - const char * kSigmaZMuSa = "SigmaZMuSa"; - - funct::Parameter lambdaZMuMu(kLambdaZMuMu, commands.par(kLambdaZMuMu)); - funct::Parameter mass(kMass, commands.par(kMass)); - funct::Parameter gamma(kGamma, commands.par(kGamma)); - funct::Parameter photonFactorZMuMu(kPhotonFactorZMuMu, commands.par(kPhotonFactorZMuMu)); - funct::Parameter interferenceFactorZMuMu(kInterferenceFactorZMuMu, commands.par(kInterferenceFactorZMuMu)); - funct::Parameter yieldZMuMu(kYieldZMuMu, commands.par(kYieldZMuMu)); - funct::Parameter efficiencyTk(kEfficiencyTk, commands.par(kEfficiencyTk)); - funct::Parameter efficiencySa(kEfficiencySa, commands.par(kEfficiencySa)); - funct::Parameter efficiencyIso(kEfficiencyIso, commands.par(kEfficiencyIso)); - funct::Parameter yieldBkgZMuTk(kYieldBkgZMuTk, commands.par(kYieldBkgZMuTk)); - funct::Parameter yieldBkgZMuSa(kYieldBkgZMuSa, commands.par(kYieldBkgZMuSa)); - funct::Parameter yieldBkgZMuMuNotIso(kYieldBkgZMuMuNotIso, commands.par(kYieldBkgZMuMuNotIso)); - funct::Parameter meanZMuMu(kMeanZMuMu, commands.par(kMeanZMuMu)); - funct::Parameter sigmaZMuMu(kSigmaZMuMu, commands.par(kSigmaZMuMu)); - funct::Parameter sigmaZMuSa(kSigmaZMuSa, commands.par(kSigmaZMuSa)); - funct::Parameter lambda(kLambda, commands.par(kLambda)); - funct::Parameter alpha(kAlpha, commands.par(kAlpha)); - funct::Parameter beta(kBeta, commands.par(kBeta)); - funct::Parameter b0(kB0, commands.par(kB0)); - funct::Parameter b1(kB1, commands.par(kB1)); - funct::Parameter b2(kB2, commands.par(kB2)); - funct::Parameter a0(kA0, commands.par(kA0)); - funct::Parameter a1(kA1, commands.par(kA1)); - funct::Parameter a2(kA2, commands.par(kA2)); - funct::Constant cFMin(fMin), cFMax(fMax); - - //IntegratorConv integratorConv(20); - //IntegratorNorm integratorNorm(20); - IntegratorConv integratorConv(1.e-4); - IntegratorNorm integratorNorm(1.e-4); - - ZPeakNoNorm zPeakNN = funct::Exponential(lambdaZMuMu) * - funct::conv(funct::ZLineShape(mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu), - funct::Gaussian(meanZMuMu, sigmaZMuMu), - -3*sigmaZMuMu.value(), 3*sigmaZMuMu.value(), integratorConv); - ZPeak zPeak = zPeakNN / ZPeakNormFactor(zPeakNN, cFMin, cFMax, integratorNorm); - ZMuMuFun zMuMuFun = funct::master(yieldZMuMu * zPeak); - ZMuMuFunClone zMuMuFunClone = funct::slave(zMuMuFun); - IsoefficiencytermSQ efficiencyIsoSquare = (efficiencyIso ^ funct::Numerical<2>(2)); //efficienza Isolamento al quadrato - ZMuMuEfficiencyTerm zMuMuEfficiencyTerm = ((efficiencyTk ^ funct::Numerical<2>(2)) * - (efficiencySa ^ funct::Numerical<2>(2))) * efficiencyIsoSquare; - ZMuMuNoIsoEfficiencyTerm zMuMuNoIsoEfficiencyTerm = ((efficiencyTk ^ funct::Numerical<2>(2)) * - (efficiencySa ^ funct::Numerical<2>(2))) * (funct::Numerical<1>(1) - efficiencyIsoSquare); - ZMuMu zMuMu = rebinMuMuConst * (zMuMuEfficiencyTerm * zMuMuFun); - - ZMuTkBkg zMuTkBkg = yieldBkgZMuTk * (funct::Exponential(lambda) * funct::Polynomial<2>(a0, a1, a2)); - ZMuTkBkgScaled zMuTkBkgScaled = rebinMuTkConst * zMuTkBkg; - ZMuTkEfficiencyTerm zMuTkEfficiencyTerm = funct::Numerical<2>(2) * - ((efficiencyTk ^ funct::Numerical<2>(2)) * (efficiencySa * (funct::Numerical<1>(1) - efficiencySa))) * efficiencyIsoSquare; - ZMuTk zMuTk = rebinMuTkConst*(zMuTkEfficiencyTerm * zMuMuFunClone + zMuTkBkg); - - ZMuMuNoIsoBkg zMuMuNoIsoBkg = yieldBkgZMuMuNotIso * (funct::Exponential(alpha) * funct::Polynomial<2>(b0, b1, b2)); - ZMuMuNoIsoBkgScaled zMuMuNoIsoBkgScaled = rebinMuMuNoIsoConst * zMuMuNoIsoBkg; - ZMuMuNoIso zMuMuNoIso = rebinMuMuNoIsoConst * ((zMuMuNoIsoEfficiencyTerm * zMuMuFunClone) + zMuMuNoIsoBkg); - - ZMuSaEfficiencyTerm zMuSaEfficiencyTerm = funct::Numerical<2>(2) * - ((efficiencySa ^ funct::Numerical<2>()) * (efficiencyTk * (funct::Numerical<1>() - efficiencyTk)))* efficiencyIsoSquare ; - ZMuSa zMuSa = rebinMuSaConst *(zMuSaEfficiencyTerm * (yieldZMuMu * funct::Gaussian(mass, sigmaZMuSa)) - + (yieldBkgZMuSa * funct::Exponential(beta))); - - ChiSquared chi2(zMuMu, histoZMuMu, - zMuTk, histoZMuTk, - zMuSa, histoZMuSa, - zMuMuNoIso,histoZMuMuNoIso, - fMin, fMax);//WARNING attento all'ordine in cui hai definito il ch2 - cout << "N. deg. of freedom: " << chi2.numberOfBins() << endl; - fit::RootMinuit minuit(chi2, true); - commands.add(minuit, yieldZMuMu); - commands.add(minuit, efficiencyTk); - commands.add(minuit, efficiencySa); - commands.add(minuit, efficiencyIso); - commands.add(minuit, yieldBkgZMuTk); - commands.add(minuit, yieldBkgZMuSa); - commands.add(minuit, yieldBkgZMuMuNotIso); - commands.add(minuit, lambdaZMuMu); - commands.add(minuit, mass); - commands.add(minuit, gamma); - commands.add(minuit, photonFactorZMuMu); - commands.add(minuit, interferenceFactorZMuMu); - commands.add(minuit, meanZMuMu); - commands.add(minuit, sigmaZMuMu); - commands.add(minuit, sigmaZMuSa); - commands.add(minuit, lambda); - commands.add(minuit, alpha); - commands.add(minuit, beta); - commands.add(minuit, a0); - commands.add(minuit, a1); - commands.add(minuit, a2); - commands.add(minuit, b0); - commands.add(minuit, b1); - commands.add(minuit, b2); - commands.run(minuit); - const unsigned int nPar = 24;//WARNIG: this must be updated manually for now - ROOT::Math::SMatrix > err; - minuit.getErrorMatrix(err); - std::cout << "error matrix:" << std::endl; - for(unsigned int i = 0; i < nPar; ++i) { - for(unsigned int j = 0; j < nPar; ++j) { - std::cout << err(i, j) << "\t"; - } - std::cout << std::endl; - } - minuit.printFitResults(); - - double s; - s = 0; - for(int i = 1; i <= histoZMuMuNoIso->GetNbinsX(); ++i) - s += histoZMuMuNoIso->GetBinContent(i); - histoZMuMuNoIso->SetEntries(s); - for(int i = 1; i <= histoZMuMu->GetNbinsX(); ++i) - s += histoZMuMu->GetBinContent(i); - histoZMuMu->SetEntries(s); - s = 0; - for(int i = 1; i <= histoZMuTk->GetNbinsX(); ++i) - s += histoZMuTk->GetBinContent(i); - histoZMuTk->SetEntries(s); - s = 0; - for(int i = 1; i <= histoZMuSa->GetNbinsX(); ++i) - s += histoZMuSa->GetBinContent(i); - histoZMuSa->SetEntries(s); - string ZMuMuPlot = "ZMuMuFit_" + plot_string; - root::plot(ZMuMuPlot.c_str(), *histoZMuMu, zMuMu, fMin, fMax, - efficiencyTk, efficiencySa, efficiencyIso, - yieldZMuMu, lambdaZMuMu, mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu, - meanZMuMu, sigmaZMuMu, - kRed, 2, kDashed, 100, - "Z -> #mu #mu mass", "#mu #mu invariant mass (GeV/c^{2})", - "Events"); - - string ZMuMuNoIsoPlot = "ZMuMuNoIsoFit_" + plot_string; - root::plot(ZMuMuNoIsoPlot.c_str(), *histoZMuMuNoIso, zMuMuNoIso, fMin, fMax, - efficiencyTk, efficiencySa, efficiencyIso, - yieldZMuMu, lambdaZMuMu, mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu, - meanZMuMu, sigmaZMuMu, - kRed, 2, kDashed, 100, - "Z -> #mu #mu Not Iso mass", "#mu #mu invariant mass (GeV/c^{2})", - "Events"); - - string ZMuTkPlot = "ZMuTkFit_" + plot_string; - TF1 funZMuTk = root::tf1("ZMuTkFunction", zMuTk, fMin, fMax, - efficiencyTk, efficiencySa,efficiencyIso, - yieldZMuMu, lambdaZMuMu, mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu, - meanZMuMu, sigmaZMuMu, - yieldBkgZMuTk, lambda, a0, a1, a2); - funZMuTk.SetLineColor(kRed); - funZMuTk.SetLineWidth(2); - funZMuTk.SetLineStyle(kDashed); - funZMuTk.SetNpx(10000); - TF1 funZMuTkBkg = root::tf1("ZMuTkBack", zMuTkBkgScaled, fMin, fMax, - yieldBkgZMuTk, lambda, a0, a1, a2); - funZMuTkBkg.SetLineColor(kGreen); - funZMuTkBkg.SetLineWidth(2); - funZMuTkBkg.SetLineStyle(kDashed); - funZMuTkBkg.SetNpx(10000); - histoZMuTk->SetTitle("Z -> #mu + (unmatched) track mass"); - histoZMuTk->SetXTitle("#mu + (unmatched) track invariant mass (GeV/c^{2})"); - histoZMuTk->SetYTitle("Events"); - TCanvas *canvas = new TCanvas("canvas"); - histoZMuTk->Draw("e"); - funZMuTk.Draw("same"); - funZMuTkBkg.Draw("same"); - canvas->SaveAs(ZMuTkPlot.c_str()); - canvas->SetLogy(); - string logZMuTkPlot = "log_" + ZMuTkPlot; - canvas->SaveAs(logZMuTkPlot.c_str()); - string ZMuSaPlot = "ZMuSaFit_" + plot_string; - root::plot(ZMuSaPlot.c_str(), *histoZMuSa, zMuSa, fMin, fMax, - efficiencySa, efficiencyTk, efficiencyIso, - yieldZMuMu, mass, sigmaZMuSa, yieldBkgZMuSa, - kRed, 2, kDashed, 10000, - "Z -> #mu + (unmatched) standalone mass", - "#mu + (unmatched) standalone invariant mass (GeV/c^{2})", - "Events"); - } - } - - } - catch(std::exception& e) { - cerr << "error: " << e.what() << "\n"; - return 1; - } - catch(...) { - cerr << "Exception of unknown type!\n"; - } - return 0; -} - - - diff --git a/ElectroWeakAnalysis/ZMuMu/bin/zMassFit.cpp b/ElectroWeakAnalysis/ZMuMu/bin/zMassFit.cpp deleted file mode 100644 index 7e3dc41a3f2ab..0000000000000 --- a/ElectroWeakAnalysis/ZMuMu/bin/zMassFit.cpp +++ /dev/null @@ -1,1040 +0,0 @@ -#include "PhysicsTools/Utilities/interface/Parameter.h" -#include "PhysicsTools/Utilities/interface/BreitWigner.h" -#include "PhysicsTools/Utilities/interface/Constant.h" -#include "PhysicsTools/Utilities/interface/Number.h" -#include "PhysicsTools/Utilities/interface/Product.h" -#include "PhysicsTools/Utilities/interface/Sum.h" -#include "PhysicsTools/Utilities/interface/Difference.h" -#include "PhysicsTools/Utilities/interface/Gaussian.h" -#include "PhysicsTools/Utilities/interface/ZLineShape.h" -#include "PhysicsTools/Utilities/interface/Convolution.h" -#include "PhysicsTools/Utilities/interface/HistoChiSquare.h" -#include "PhysicsTools/Utilities/interface/RootMinuit.h" -#include "PhysicsTools/Utilities/interface/RootFunctionAdapter.h" -#include "PhysicsTools/Utilities/interface/rootPlot.h" -#include "TFile.h" -#include "TH1.h" -#include "TF1.h" -#include "TMath.h" -#include "TCanvas.h" -#include "TROOT.h" -//#include "TStyle.h" - -#include -#include -#include -#include -#include -#include -#include -using namespace std; -using namespace boost; -namespace po = boost::program_options; - -// A helper function to simplify the main part. -template -ostream &operator<<(ostream &os, const vector &v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); - return os; -} - -typedef funct::GaussIntegrator IntegratorConv; - -int main(int ac, char *av[]) { - try { - double fMin, fMax; - string ext; - po::options_description desc("Allowed options"); - desc.add_options()("help", "produce help message")("include-path,I", po::value >(), "include path")( - "input-file", po::value >(), "input file")( - "min,m", po::value(&fMin)->default_value(80), "minimum value for fit range")( - "max,M", po::value(&fMax)->default_value(120), "maximum value for fit range")( - "breitwigner", "fit to a breit-wigner")("gauss", "fit to a gaussian")( - "bwinter", "fit to the breit-wigner plus interference term")( - "bwintgam", "fit to the breit-wigner plus interference term and gamma propagator")( - "convbwg", "fit to the convolution between a breit-wigner and a gaussian")( - "convbwinterg", "fit to the convolution between a breit-wigner plus interference term and a gaussian")( - "convbwintgamg", - "fit to the convolution of a breit-wigner plus interference term and gamma propagator and a gaussian")( - "convbw2gf", "fit to the convolution between a breit-wigner and a linear combination of fixed gaussians")( - "convbwf2g", "fit to the convolution between a fixed breit-wigner and a linear combination of gaussians")( - "convbwint2gf", - "fit to the convolution between the breit-wigner plus interference term and a linear combination of fixed " - "gaussians")("convbwintf2g", - "fit to the convolution between the fixed breit-wigner plus interference term and a linear " - "combination of gaussians")("convbwintgam2gf", - "fit to the convolution of the breit-wigner plus interference term " - "and gamma propagator with a linear combination of fixed gaussians")( - "convbwintgamf2g", - "fit to the convolution of the fixed breit-wigner plus interference term and gamma propagator with a linear " - "combination of gaussians")( - "output-file,O", po::value(&ext)->default_value(".ps"), "output file format"); - - po::positional_options_description p; - p.add("input-file", -1); - - po::variables_map vm; - po::store(po::command_line_parser(ac, av).options(desc).positional(p).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - cout << "Usage: options_description [options]\n"; - cout << desc; - return 0; - } - - if (vm.count("include-path")) { - cout << "Include paths are: " << vm["include-path"].as >() << "\n"; - } - - vector v_file; - vector v_ZMassHistos; - vector v_eps; - - if (vm.count("input-file")) { - cout << "Input files are: " << vm["input-file"].as >() << "\n"; - v_file = vm["input-file"].as >(); - for (vector::const_iterator it = v_file.begin(); it != v_file.end(); ++it) { - TFile *root_file = new TFile(it->c_str(), "read"); - TDirectory *Histos = (TDirectory *)root_file->GetDirectory("ZHisto"); - TDirectory *RecoHistos = (TDirectory *)Histos->GetDirectory("ZRecoHisto"); - TH1D *zMass = (TH1D *)RecoHistos->Get("ZMass"); - zMass->Rebin(4); //remember... - zMass->GetXaxis()->SetTitle("#mu #mu invariant mass (GeV/c^{2})"); - v_ZMassHistos.push_back(zMass); - gROOT->SetStyle("Plain"); - //gStyle->SetOptFit(1111); - string f_string = *it; - replace(f_string.begin(), f_string.end(), '.', '_'); - string eps_string = f_string + ext; - v_eps.push_back(eps_string); - cout << ">>> histogram loaded\n"; - } - cout << v_file.size() << ", " << v_ZMassHistos.size() << ", " << v_eps.size() << endl; - cout << ">>> Input files loaded\n"; - } - - IntegratorConv integratorConv(1.e-5); - - //PDG values for Z mass and width - funct::Parameter mass("Mass", 91.1876); - funct::Parameter gamma("Gamma", 2.4952); - //Parameters for Z Line Shape - funct::Parameter f_gamma("Photon factor", 0); - funct::Parameter f_int("Interference factor", 0.001); - //Parameters for fits with gaussians - funct::Parameter yield("Yield", 482000); - funct::Parameter alpha("Alpha", 0.771); - funct::Parameter mean("Mean", 0); //0.229 - funct::Parameter sigma1("Sigma 1", 1.027); - funct::Parameter sigma2("Sigma 2", 2.94); - funct::Constant c_yield(yield), c_alpha(alpha); - funct::Number _1(1); - - if (vm.count("breitwigner")) { - cout << "Fitting histograms in input file to a Breit-Wigner\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - cout << ">>> load histogram\n"; - TH1D *zMass = v_ZMassHistos[i]; - cout << ">>> histogram loaded\n"; - funct::BreitWigner bw(mass, gamma); - funct::Constant c_yield(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c_yield * bw; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, yield, mass, gamma); - fun.SetParNames(yield.name().c_str(), mass.name().c_str(), gamma.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitBW_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitBW_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("gauss")) { - cout << "Fitting histograms in input files to a Gaussian\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mean << endl; - cout << sigma1 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::Gaussian gaus(mean, sigma1); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * gaus; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mean, 0.001, 80, 100); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, yield, mean, sigma1); - fun.SetParNames(yield.name().c_str(), mean.name().c_str(), sigma1.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("bwinter")) { - cout << "Fitting histograms in input files to the Breit-Wigner plus Z/photon interference term\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * zls; - cout << "set functions" << endl; - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.fixParameter(f_gamma.name()); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitBwIn_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitBwIn_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("bwint")) { - cout << "Fitting histograms in input files to the Breit-Wigner plus Z/photon interference term and gamma " - "propagator\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * zls; - cout << "set functions" << endl; - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitBwInGam_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitBwInGam_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("bwintgam")) { - cout << "Fitting histograms in input files to the Breit-Wigner plus Z/photon interference term and gamma " - "propagator\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * zls; - cout << "set functions" << endl; - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitBwInGam_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitBwInGam_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convbwg")) { - cout << "Fitting histograms in input files to the convolution between a Breit Wigner and a Gaussian\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << mean << endl; - cout << sigma1 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::BreitWigner bw(mass, gamma); - funct::Gaussian gauss(mean, sigma1); - double range = 3 * sigma1.value(); - funct::Convolution::type cbg( - bw, gauss, -range, range, integratorConv); - funct::Constant c(yield); - typedef funct::Product::type>::type - FitFunction; - FitFunction f = c * cbg; - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames( - yield.name().c_str(), mass.name().c_str(), gamma.name().c_str(), mean.name().c_str(), sigma1.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convbwinterg")) { - cout << "Fitting histograms in input files to the convolution between the Breit-Wigner plus Z/photon " - "interference and a Gaussian\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma1 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Gaussian gauss(mean, sigma1); - double range = 3 * sigma1.value(); - funct::Convolution::type czg( - zls, gauss, -range, range, integratorConv); - funct::Constant c(yield); - typedef funct::Product::type>::type - FitFunction; - FitFunction f = c * czg; - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.fixParameter(f_gamma.name()); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwInG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwInG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - if (vm.count("convbwintgamg")) { - cout << "Fitting histograms in input files to the convolution of the Breit-Wigner plus Z/photon interference and " - "photon propagator with a Gaussian\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma1 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Gaussian gauss(mean, sigma1); - double range = 3 * sigma1.value(); - funct::Convolution::type czg( - zls, gauss, -range, range, integratorConv); - funct::Constant c(yield); - typedef funct::Product::type>::type - FitFunction; - FitFunction f = c * czg; - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str()); - fun.SetLineColor(kRed); - fun.SetNpx(100000); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwInGaG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwInGaG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convbw2gf")) { - cout << "Fitting histograms in input files to the convolution between the Z Breit-Wigner and a linear " - "combination of fixed Gaussians\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << alpha << endl; - cout << mass << endl; - cout << gamma << endl; - cout << mean << endl; - cout << sigma1 << endl; - cout << sigma2 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::BreitWigner bw(mass, gamma); - funct::Gaussian gaus1(mean, sigma1); - funct::Gaussian gaus2(mean, sigma2); - typedef funct::Product::type G1; - typedef funct::Product::type, funct::Gaussian>::type G2; - typedef funct::Product::type>::type GaussComb; - GaussComb gc = c_yield * (c_alpha * gaus1 + (_1 - c_alpha) * gaus2); - typedef funct::Convolution::type FitFunction; - double range = 3 * max(sigma1.value(), sigma2.value()); - FitFunction f(bw, gc, -range, range, 1000); - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - //minuit.fixParameter(0); - minuit.addParameter(alpha, 0.1, -1., 1.); - //minuit.fixParameter(1); - minuit.addParameter(mass, .1, 70., 110); - //minuit.fixParameter(2); - minuit.addParameter(gamma, 1, 1, 10); - //minuit.fixParameter(3); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma1, 0.1, -5., 5.); - //minuit.fixParameter(5); - minuit.addParameter(sigma2, 0.1, -5., 5.); - //minuit.fixParameter(6); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - pars.push_back(sigma2.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str(), - sigma2.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwGGf_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwGGf_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convbwf2g")) { - cout << "Fitting histograms in input files to the convolution between the fixed Z Breit-Wigner and a linear " - "combination of Gaussians\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << alpha << endl; - cout << mass << endl; - cout << gamma << endl; - cout << mean << endl; - cout << sigma1 << endl; - cout << sigma2 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::BreitWigner bw(mass, gamma); - funct::Gaussian gaus1(mean, sigma1); - funct::Gaussian gaus2(mean, sigma2); - typedef funct::Product::type G1; - typedef funct::Product::type, funct::Gaussian>::type G2; - typedef funct::Product::type>::type GaussComb; - GaussComb gc = c_yield * (c_alpha * gaus1 + (_1 - c_alpha) * gaus2); - typedef funct::Convolution::type FitFunction; - double range = 3 * max(sigma1.value(), sigma2.value()); - FitFunction f(bw, gc, -range, range, 1000); - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - //minuit.fixParameter(0); - minuit.addParameter(alpha, 0.1, -1., 1.); - //minuit.fixParameter(1); - minuit.addParameter(mass, .1, 70., 110); - minuit.fixParameter(mass.name()); - minuit.addParameter(gamma, 1, 1, 10); - minuit.fixParameter(gamma.name()); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - //minuit.fixParameter(4); - minuit.addParameter(sigma1, 0.1, -5., 5.); - //minuit.fixParameter(5); - minuit.addParameter(sigma2, 0.1, -10., 10.); - //minuit.fixParameter(6); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - pars.push_back(sigma2.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str(), - sigma2.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwfGG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwfGG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convbwint2gf")) { - cout << "Fitting histograms in input files to the convolution between the Breit-Wigner plus Z/photon " - "interference and a linear combination of fixed Gaussians\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << alpha << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma1 << endl; - cout << sigma2 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Gaussian gaus1(mean, sigma1); - funct::Gaussian gaus2(mean, sigma2); - typedef funct::Product::type G1; - typedef funct::Product::type, funct::Gaussian>::type G2; - typedef funct::Product::type>::type GaussComb; - GaussComb gc = c_yield * (c_alpha * gaus1 + (_1 - c_alpha) * gaus2); - typedef funct::Convolution::type FitFunction; - double range = 3 * max(sigma1.value(), sigma2.value()); - FitFunction f(zls, gc, -range, range, integratorConv); - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - //minuit.fixParameter(0); - minuit.addParameter(alpha, 0.1, -1., 1.); - //minuit.fixParameter(1); - minuit.addParameter(mass, .1, 70., 110); - //minuit.fixParameter(2); - minuit.addParameter(gamma, 1, 1, 10); - //minuit.fixParameter(3); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.fixParameter(f_gamma.name()); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - //minuit.fixParameter(5); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma1, 0.1, -5., 5.); - //minuit.fixParameter(7); - minuit.addParameter(sigma2, 0.1, -5., 5.); - //minuit.fixParameter(8); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - pars.push_back(sigma2.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str(), - sigma2.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwInGGf_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwInGGf_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convbwintf2g")) { - cout << "Fitting histograms in input files to the convolution between the fixed Breit-Wigner plus Z/photon " - "interference and a linear combination of Gaussians\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << alpha << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma1 << endl; - cout << sigma2 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Gaussian gaus1(mean, sigma1); - funct::Gaussian gaus2(mean, sigma2); - typedef funct::Product::type G1; - typedef funct::Product::type, funct::Gaussian>::type G2; - typedef funct::Product::type>::type GaussComb; - GaussComb gc = c_yield * (c_alpha * gaus1 + (_1 - c_alpha) * gaus2); - typedef funct::Convolution::type FitFunction; - double range = 3 * max(sigma1.value(), sigma2.value()); - FitFunction f(zls, gc, -range, range, integratorConv); - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - //minuit.fixParameter(0); - minuit.addParameter(alpha, 0.1, -1., 1.); - //minuit.fixParameter(1); - minuit.addParameter(mass, .1, 70., 110); - minuit.fixParameter(mass.name()); - minuit.addParameter(gamma, 1, 1, 10); - minuit.fixParameter(gamma.name()); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.fixParameter(f_gamma.name()); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - //minuit.fixParameter(5); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - //minuit.fixParameter(6); - minuit.addParameter(sigma1, 0.1, -5., 5.); - //minuit.fixParameter(7); - minuit.addParameter(sigma2, 0.1, -10., 10.); - //minuit.fixParameter(8); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - pars.push_back(sigma2.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str(), - sigma2.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwInfGG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwInfGG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convbwintgam2gf")) { - cout << "Fitting histograms in input files to the convolution of the Breit-Wigner plus Z/photon interference and " - "photon propagator with a linear combination of fixed Gaussians\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << alpha << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma1 << endl; - cout << sigma2 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Gaussian gaus1(mean, sigma1); - funct::Gaussian gaus2(mean, sigma2); - typedef funct::Product::type G1; - typedef funct::Product::type, funct::Gaussian>::type G2; - typedef funct::Product::type>::type GaussComb; - GaussComb gc = c_yield * (c_alpha * gaus1 + (_1 - c_alpha) * gaus2); - typedef funct::Convolution::type FitFunction; - double range = 3 * max(sigma1.value(), sigma2.value()); - FitFunction f(zls, gc, -range, range, integratorConv); - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - //minuit.fixParameter(0); - minuit.addParameter(alpha, 0.1, -1., 1.); - //minuit.fixParameter(1); - minuit.addParameter(mass, .1, 70., 110); - //minuit.fixParameter(2); - minuit.addParameter(gamma, 1, 1, 10); - //minuit.fixParameter(3); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - //minuit.fixParameter(4); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - //minuit.fixParameter(5); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma1, 0.1, -5., 5.); - // minuit.fixParameter(7); - minuit.addParameter(sigma2, 0.1, -5., 5.); - // minuit.fixParameter(8); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - pars.push_back(sigma2.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str(), - sigma2.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwInGaGGf_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwInGaGGf_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convbwintgamf2g")) { - cout << "Fitting histograms in input files to the convolution of the fixed Breit-Wigner plus Z/photon " - "interference and photon propagator with a linear combination of Gaussians\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << alpha << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma1 << endl; - cout << sigma2 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Gaussian gaus1(mean, sigma1); - funct::Gaussian gaus2(mean, sigma2); - typedef funct::Product::type G1; - typedef funct::Product::type, funct::Gaussian>::type G2; - typedef funct::Product::type>::type GaussComb; - GaussComb gc = c_yield * (c_alpha * gaus1 + (_1 - c_alpha) * gaus2); - typedef funct::Convolution::type FitFunction; - double range = 3 * max(sigma1.value(), sigma2.value()); - FitFunction f(zls, gc, -range, range, integratorConv); - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - //minuit.fixParameter(0); - minuit.addParameter(alpha, 0.1, -1., 1.); - //minuit.fixParameter(1); - minuit.addParameter(mass, .1, 70., 110); - minuit.fixParameter(mass.name()); - minuit.addParameter(gamma, 1, 1, 10); - minuit.fixParameter(gamma.name()); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - //minuit.fixParameter(4); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - //minuit.fixParameter(5); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - //minuit.fixParameter(6); - minuit.addParameter(sigma1, 0.1, -5., 5.); - //minuit.fixParameter(7); - minuit.addParameter(sigma2, 0.1, -10., 10.); - //minuit.fixParameter(8); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - pars.push_back(sigma2.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str(), - sigma2.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwInGafGG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwInGafGG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - cout << "It works!\n"; - } catch (std::exception &e) { - cerr << "error: " << e.what() << "\n"; - return 1; - } catch (...) { - cerr << "Exception of unknown type!\n"; - } - return 0; -} diff --git a/ElectroWeakAnalysis/ZMuMu/bin/zMassHSFit.cpp b/ElectroWeakAnalysis/ZMuMu/bin/zMassHSFit.cpp deleted file mode 100644 index 5abc1d2ac8887..0000000000000 --- a/ElectroWeakAnalysis/ZMuMu/bin/zMassHSFit.cpp +++ /dev/null @@ -1,353 +0,0 @@ -#include "PhysicsTools/Utilities/interface/Parameter.h" -#include "PhysicsTools/Utilities/interface/BreitWigner.h" -#include "PhysicsTools/Utilities/interface/Constant.h" -#include "PhysicsTools/Utilities/interface/Number.h" -#include "PhysicsTools/Utilities/interface/Product.h" -#include "PhysicsTools/Utilities/interface/Sum.h" -#include "PhysicsTools/Utilities/interface/Difference.h" -#include "PhysicsTools/Utilities/interface/Gaussian.h" -#include "PhysicsTools/Utilities/interface/ZLineShape.h" -#include "PhysicsTools/Utilities/interface/Exponential.h" -#include "PhysicsTools/Utilities/interface/Convolution.h" -#include "PhysicsTools/Utilities/interface/HistoChiSquare.h" -#include "PhysicsTools/Utilities/interface/RootMinuit.h" -#include "PhysicsTools/Utilities/interface/RootFunctionAdapter.h" -#include "PhysicsTools/Utilities/interface/rootPlot.h" -#include "TFile.h" -#include "TH1.h" -#include "TF1.h" -#include "TMath.h" -#include "TCanvas.h" -#include "TROOT.h" - -#include -#include -#include -#include -#include -#include -#include -using namespace boost; -namespace po = boost::program_options; -using namespace std; - -typedef funct::GaussIntegrator IntegratorConv; - -// A helper function to simplify the main part. -template -ostream &operator<<(ostream &os, const vector &v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); - return os; -} - -int main(int ac, char *av[]) { - try { - double fMin, fMax; - string ext; - po::options_description desc("Allowed options"); - desc.add_options()("help", "produce help message")("include-path,I", po::value >(), "include path")( - "input-file", po::value >(), "input file")( - "min,m", po::value(&fMin)->default_value(60), "minimum value for fit range")( - "max,M", po::value(&fMax)->default_value(120), "maximum value for fit range")( - "convbwintgamg", - "fit to the convolution of a breit-wigner plus interference term and gamma propagator and a gaussian")( - "convexpbwintgamg", - "fit to the convolution of the product between an exponential and a breit-wigner plus interference term and " - "gamma propagator with a gaussian")("convbwintgam2gf", - "fit to the convolution of the breit-wigner plus interference term and " - "gamma propagator with a linear combination of fixed gaussians")( - "output-file,O", po::value(&ext)->default_value(".ps"), "output file format"); - - po::positional_options_description p; - p.add("input-file", -1); - - po::variables_map vm; - po::store(po::command_line_parser(ac, av).options(desc).positional(p).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - cout << "Usage: options_description [options]\n"; - cout << desc; - return 0; - } - - if (vm.count("include-path")) { - cout << "Include paths are: " << vm["include-path"].as >() << "\n"; - } - - vector v_file; - vector v_ZMassHistos; - vector v_eps; - - if (vm.count("input-file")) { - cout << "Input files are: " << vm["input-file"].as >() << "\n"; - v_file = vm["input-file"].as >(); - for (vector::const_iterator it = v_file.begin(); it != v_file.end(); ++it) { - TFile *root_file = new TFile(it->c_str(), "read"); - TDirectory *Histos = (TDirectory *)root_file->GetDirectory("ZHisto"); - TDirectory *RecoHistos = (TDirectory *)Histos->GetDirectory("ZRecoHisto"); - TH1D *zMass = (TH1D *)RecoHistos->Get("ZMass"); - zMass->Rebin(4); //remember... - zMass->GetXaxis()->SetTitle("#mu #mu invariant mass (GeV/c^{2})"); - v_ZMassHistos.push_back(zMass); - gROOT->SetStyle("Plain"); - //gStyle->SetOptFit(1111); - string f_string = *it; - replace(f_string.begin(), f_string.end(), '.', '_'); - string eps_string = f_string + ext; - v_eps.push_back(eps_string); - cout << ">>> histogram loaded\n"; - } - cout << v_file.size() << ", " << v_ZMassHistos.size() << ", " << v_eps.size() << endl; - cout << ">>> Input files loaded\n"; - } - - IntegratorConv integratorConv(1.e-5); - //Values for Z mass and width - funct::Parameter mass("Mass", 91.364); - funct::Parameter gamma("Gamma", 4.11); - //Parameters for Z Line Shape - funct::Parameter f_gamma("Photon factor", 0.838); - funct::Parameter f_int("Interference factor", -0.00197); - //Parameters for fits with gaussians - funct::Parameter yield("Yield", 283000); - funct::Parameter alpha("Alpha", 0.771); //the first gaussian is narrow - funct::Parameter mean("Mean", 0); //0.229 - funct::Parameter sigma1("Sigma 1", 0.76); - funct::Parameter sigma2("Sigma 2", 2.94); - //Parameter for exponential - funct::Parameter lambda("Lambda", 0); - - if (vm.count("convbwintgamg")) { - cout << "Fitting histograms in input files to the convolution of the Breit-Wigner plus Z/photon interference and " - "photon propagator with a Gaussian\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma1 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Gaussian gauss(mean, sigma1); - double range = 3 * sigma1.value(); - funct::Convolution::type czg( - zls, gauss, -range, range, integratorConv); - funct::Constant c(yield); - typedef funct::Product::type>::type - FitFunction; - FitFunction f = c * czg; - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str()); - fun.SetLineColor(kRed); - fun.SetNpx(100000); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwInGaG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwInGaG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convexpbwintgamg")) { - cout << "Fitting histograms in input files to the convolution of the product between an exponential and a " - "breit-wigner plus interference term and gamma propagator with a gaussian" - << endl; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << lambda << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma1 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::Exponential expo(lambda); - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Gaussian gauss(mean, sigma1); - typedef funct::Product::type ExpZLS; - ExpZLS expz = expo * zls; - double range = 3 * sigma1.value(); - funct::Convolution::type cezg( - expz, gauss, -range, range, integratorConv); - funct::Constant c(yield); - typedef funct::Product::type>::type - FitFunction; - FitFunction f = c * cezg; - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(lambda, 0.1, -100, 100); - minuit.fixParameter(lambda.name()); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - minuit.releaseParameter(lambda.name()); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(lambda.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - lambda.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str()); - fun.SetLineColor(kRed); - fun.SetNpx(100000); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoExBwInGaG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoExBwInGaG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("convbwintgam2gf")) { - cout << "Fitting histograms in input files to the convolution of the Breit-Wigner plus Z/photon interference and " - "photon propagator with a linear combination of fixed Gaussians\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << alpha << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma1 << endl; - cout << sigma2 << endl; - for (unsigned int i = 0; i < v_ZMassHistos.size(); ++i) { - TH1D *zMass = v_ZMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Gaussian gaus1(mean, sigma1); - funct::Gaussian gaus2(mean, sigma2); - funct::Number _1(1); - typedef funct::Product::type G1; - typedef funct::Product::type, funct::Gaussian>::type G2; - typedef funct::Product::type>::type GaussComb; - funct::Constant c_alpha(alpha), c_yield(yield); - GaussComb gc = c_yield * (c_alpha * gaus1 + (_1 - c_alpha) * gaus2); - typedef funct::Convolution::type FitFunction; - double range = 3 * max(sigma1.value(), sigma2.value()); - FitFunction f(zls, gc, -range, range, integratorConv); - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(alpha, 0.1, -1., 1.); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.addParameter(mean, 0.001, -0.5, 0.5); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.addParameter(sigma2, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - pars.push_back(sigma2.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str(), - sigma2.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassFitCoBwInGaGGf_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassFitCoBwInGaGGf_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - cout << "It works!\n"; - } catch (std::exception &e) { - cerr << "error: " << e.what() << "\n"; - return 1; - } catch (...) { - cerr << "Exception of unknown type!\n"; - } - return 0; -} diff --git a/ElectroWeakAnalysis/ZMuMu/bin/zMassMCFit.cpp b/ElectroWeakAnalysis/ZMuMu/bin/zMassMCFit.cpp deleted file mode 100644 index 91cd65815fbe0..0000000000000 --- a/ElectroWeakAnalysis/ZMuMu/bin/zMassMCFit.cpp +++ /dev/null @@ -1,355 +0,0 @@ -#include "PhysicsTools/Utilities/interface/Parameter.h" -#include "PhysicsTools/Utilities/interface/BreitWigner.h" -#include "PhysicsTools/Utilities/interface/Constant.h" -#include "PhysicsTools/Utilities/interface/Product.h" -#include "PhysicsTools/Utilities/interface/Exponential.h" -#include "PhysicsTools/Utilities/interface/Gaussian.h" -#include "PhysicsTools/Utilities/interface/ZLineShape.h" -#include "PhysicsTools/Utilities/interface/HistoChiSquare.h" -#include "PhysicsTools/Utilities/interface/RootMinuit.h" -#include "PhysicsTools/Utilities/interface/RootFunctionAdapter.h" -#include "PhysicsTools/Utilities/interface/rootPlot.h" -#include "TFile.h" -#include "TH1.h" -#include "TF1.h" -#include "TMath.h" -#include "TCanvas.h" -#include "TROOT.h" -#include "TMath.h" - -#include -#include -#include -#include -#include -#include -using namespace boost; -namespace po = boost::program_options; -using namespace std; - -// A helper function to simplify the main part. -template -ostream &operator<<(ostream &os, const vector &v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); - return os; -} - -int main(int ac, char *av[]) { - try { - double fMin, fMax; - string ext; - po::options_description desc("Allowed options"); - desc.add_options()("help", "produce help message")("include-path,I", po::value >(), "include path")( - "input-file", po::value >(), "input file")( - "min,m", po::value(&fMin)->default_value(80), "minimum value for fit range")( - "max,M", po::value(&fMax)->default_value(120), "maximum value for fit range")( - "breitwigner", "fit to a breit-wigner")("gauss", "fit to a gaussian")( - "bwinter", "fit to a breit-wigner plus Z/photon interference term")( - "bwintgam", "fit to a breit-wigner plus Z/photon interference term and photon propagator")( - "expbwintgam", - "fit to the product of an exponential with a breit-wigner plus Z/photon interference term and photon " - "propagator")("output-file,O", po::value(&ext)->default_value(".ps"), "output file format"); - - po::positional_options_description p; - p.add("input-file", -1); - - po::variables_map vm; - po::store(po::command_line_parser(ac, av).options(desc).positional(p).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - cout << "Usage: options_description [options]\n"; - cout << desc; - return 0; - } - - if (vm.count("include-path")) { - cout << "Include paths are: " << vm["include-path"].as >() << "\n"; - } - - vector v_file; - vector v_ZMCMassHistos; - vector v_eps; - - if (vm.count("input-file")) { - cout << "Input files are: " << vm["input-file"].as >() << "\n"; - v_file = vm["input-file"].as >(); - for (vector::const_iterator it = v_file.begin(); it != v_file.end(); ++it) { - TFile *root_file = new TFile(it->c_str(), "read"); - TDirectory *Histos = (TDirectory *)root_file->GetDirectory("ZHisto"); - TDirectory *MCHistos = (TDirectory *)Histos->GetDirectory("ZMCHisto"); - TH1D *zMass = (TH1D *)MCHistos->Get("ZMCMass"); - zMass->Rebin(4); //remember... - zMass->GetXaxis()->SetTitle("Mass (GeV/c^{2})"); - v_ZMCMassHistos.push_back(zMass); - gROOT->SetStyle("Plain"); - string f_string = *it; - replace(f_string.begin(), f_string.end(), '.', '_'); - string eps_string = f_string + ext; - v_eps.push_back(eps_string); - cout << ">>> histogram loaded\n"; - } - cout << v_file.size() << ", " << v_ZMCMassHistos.size() << ", " << v_eps.size() << endl; - cout << ">>> Input files loaded\n"; - } - //PDG values for Z mass and width - funct::Parameter mass("Mass", 91.1876); - funct::Parameter gamma("Gamma", 2.4952); - //Parameters for Z Line Shape - funct::Parameter f_gamma("Photon factor", 0); - funct::Parameter f_int("Interference factor", 0.001); - //Parameters for fits with one gaussian - funct::Parameter yield("Yield", 1000); - funct::Parameter mean("Mean", 90); - funct::Parameter sigma("Sigma", 1.); - //Parameters for fit with an exponential - funct::Parameter lambda("Lambda", 0); - - if (vm.count("breitwigner")) { - cout << "Fitting histograms in input file to a Breit-Wigner\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - cout << ">>> load histogram\n"; - TH1D *zMass = v_ZMCMassHistos[i]; - cout << ">>> histogram loaded\n"; - funct::BreitWigner bw(mass, gamma); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * bw; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, yield, mass, gamma); - fun.SetParNames(yield.name().c_str(), mass.name().c_str(), gamma.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassMCFitBW_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassMCFitBW_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("gauss")) { - cout << "Fitting histograms in input files to a Gaussian\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mean << endl; - cout << sigma << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - TH1D *zMass = v_ZMCMassHistos[i]; - funct::Gaussian gaus(mean, sigma); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * gaus; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mean, 0.001, 80, 100); - minuit.addParameter(sigma, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, yield, mean, sigma); - fun.SetParNames(yield.name().c_str(), mean.name().c_str(), sigma.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassMCFitG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassMCFitG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("bwinter")) { - cout << "Fitting histograms in input files to the Breit-Wigner plus Z/photon interference term\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - TH1D *zMass = v_ZMCMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * zls; - cout << "set functions" << endl; - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.fixParameter(f_gamma.name()); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassMCFitBwIn_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassMCFitBwIn_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("bwintgam")) { - cout << "Fitting histograms in input files to the Breit-Wigner plus Z/photon interference term and photon " - "propagator\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - TH1D *zMass = v_ZMCMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * zls; - cout << "set functions" << endl; - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 1000000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetNpx(100000); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassMCFitBwInGa_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassMCFitBwInGa_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("expbwintgam")) { - cout << "Fitting histograms in input files to the product of an exponential with the Breit-Wigner plus Z/photon " - "interference term and photon propagator\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << lambda << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - TH1D *zMass = v_ZMCMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Exponential expo(lambda); - funct::Constant c(yield); - typedef funct::Product::type ExpZLS; - ExpZLS expz = expo * zls; - typedef funct::Product::type FitFunction; - FitFunction f = c * expz; - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(lambda, 0.1, -100, 100); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(lambda.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetNpx(100000); - fun.SetParNames(yield.name().c_str(), - lambda.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassMCFitExpBwInGa_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassMCFitExpBwInGa_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - cout << "It works!\n"; - } catch (std::exception &e) { - cerr << "error: " << e.what() << "\n"; - return 1; - } catch (...) { - cerr << "Exception of unknown type!\n"; - } - return 0; -} diff --git a/ElectroWeakAnalysis/ZMuMu/bin/zMassResFit.cpp b/ElectroWeakAnalysis/ZMuMu/bin/zMassResFit.cpp deleted file mode 100644 index 4ce46ab3144a5..0000000000000 --- a/ElectroWeakAnalysis/ZMuMu/bin/zMassResFit.cpp +++ /dev/null @@ -1,280 +0,0 @@ -#include "PhysicsTools/Utilities/interface/Parameter.h" -#include "PhysicsTools/Utilities/interface/Constant.h" -#include "PhysicsTools/Utilities/interface/Number.h" -#include "PhysicsTools/Utilities/interface/Product.h" -#include "PhysicsTools/Utilities/interface/Sum.h" -#include "PhysicsTools/Utilities/interface/Difference.h" -#include "PhysicsTools/Utilities/interface/Gaussian.h" -#include "PhysicsTools/Utilities/interface/HistoChiSquare.h" -#include "PhysicsTools/Utilities/interface/RootMinuit.h" -#include "PhysicsTools/Utilities/interface/RootFunctionAdapter.h" -#include "PhysicsTools/Utilities/interface/rootPlot.h" -#include "TFile.h" -#include "TH1.h" -#include "TF1.h" -#include "TMath.h" -#include "TCanvas.h" -#include "TROOT.h" -#include "TMath.h" - -#include -using namespace boost; -namespace po = boost::program_options; - -#include -#include -#include -#include -#include -using namespace std; - -// A helper function to simplify the main part. -template -ostream &operator<<(ostream &os, const vector &v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); - return os; -} - -int main(int ac, char *av[]) { - try { - double fMin, fMax; - string ext; - po::options_description desc("Allowed options"); - desc.add_options()("help", "produce help message")("include-path,I", po::value >(), "include path")( - "input-file", po::value >(), "input file")( - "min,m", po::value(&fMin)->default_value(-20), "minimum value for fit range")( - "max,M", po::value(&fMax)->default_value(20), "maximum value for fit range")( - "gauss", "fit to a gaussian")("2gauss", "fit to a linear combination of two gaussians")( - "3gauss", "fit to a linear combination of three gaussians")( - "output-file,O", po::value(&ext)->default_value(".ps"), "output file format"); - - po::positional_options_description p; - p.add("input-file", -1); - - po::variables_map vm; - po::store(po::command_line_parser(ac, av).options(desc).positional(p).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - cout << "Usage: options_description [options]\n"; - cout << desc; - return 0; - } - - if (vm.count("include-path")) { - cout << "Include paths are: " << vm["include-path"].as >() << "\n"; - } - - vector v_file; - vector v_ZMassResHistos; - vector v_eps; - - if (vm.count("input-file")) { - cout << "Input files are: " << vm["input-file"].as >() << "\n"; - v_file = vm["input-file"].as >(); - for (vector::const_iterator it = v_file.begin(); it != v_file.end(); ++it) { - TFile *root_file = new TFile(it->c_str(), "read"); - TDirectory *Histos = (TDirectory *)root_file->GetDirectory("ZHisto"); - TDirectory *RecoHistos = (TDirectory *)Histos->GetDirectory("ZResolutionHisto"); - TH1D *zMass = (TH1D *)RecoHistos->Get("ZToMuMuRecoMassResolution"); - zMass->GetXaxis()->SetTitle("Mass (GeV/c^{2})"); - v_ZMassResHistos.push_back(zMass); - gROOT->SetStyle("Plain"); - string f_string = *it; - replace(f_string.begin(), f_string.end(), '.', '_'); - string eps_string = f_string + ext; - v_eps.push_back(eps_string); - cout << ">>> histogram loaded\n"; - } - cout << v_file.size() << ", " << v_ZMassResHistos.size() << ", " << v_eps.size() << endl; - cout << ">>> Input files loaded\n"; - } - //Parameters for fit - funct::Parameter yield("Yield", 10000); - funct::Parameter alpha("Alpha", 0); - funct::Parameter beta("Beta", 0); - funct::Parameter mean("Mean", 0); - funct::Parameter mean2("Mean 2", 0); - funct::Parameter mean3("Mean 3", 0); - funct::Parameter sigma1("Sigma 1", 1.); - funct::Parameter sigma2("Sigma 2", 2.5); - funct::Parameter sigma3("Sigma 3", 9.); - - if (vm.count("gauss")) { - cout << "Fitting histograms in input files to a Gaussian\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mean << endl; - cout << sigma1 << endl; - for (unsigned int i = 0; i < v_ZMassResHistos.size(); ++i) { - TH1D *zMass = v_ZMassResHistos[i]; - zMass->Rebin(4); //remember... - funct::Gaussian gaus(mean, sigma1); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * gaus; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(mean, 0.001, -1., 1.); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, yield, mean, sigma1); - fun.SetParNames(yield.name().c_str(), mean.name().c_str(), sigma1.name().c_str()); - fun.SetLineColor(kRed); - fun.SetNpx(1000); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassResFitG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassResFitG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("2gauss")) { - cout << "Fitting histograms in input files to a linear combination of two Gaussians\n"; - cout << "set pars: " << endl; - cout << yield << endl; - cout << alpha << endl; - cout << mean << endl; - cout << mean2 << endl; - cout << sigma1 << endl; - cout << sigma2 << endl; - for (unsigned int i = 0; i < v_ZMassResHistos.size(); ++i) { - TH1D *zMass = v_ZMassResHistos[i]; - zMass->Rebin(4); //remember... - funct::Gaussian gaus1(mean, sigma1); - funct::Gaussian gaus2(mean, sigma2); - typedef funct::Product::type G1; - typedef funct::Product::type, funct::Gaussian>::type G2; - typedef funct::Product::type>::type FitFunction; - funct::Number _1(1); - funct::Constant c_alpha(alpha), c_yield(yield); - FitFunction f = c_yield * (c_alpha * gaus1 + (_1 - c_alpha) * gaus2); - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(alpha, 0.1, -1., 1.); - minuit.addParameter(mean, 0.001, -1., 1.); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.addParameter(sigma2, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma1.ptr()); - pars.push_back(sigma2.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - mean.name().c_str(), - sigma1.name().c_str(), - sigma2.name().c_str()); - fun.SetLineColor(kRed); - fun.SetNpx(1000); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassResFitGG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassResFitGG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("3gauss")) { - cout << "Fitting histograms in input files to a linear combination of three Gaussians\n"; - cout << "set pars: " << endl; - cout << yield << endl; - cout << alpha << endl; - cout << beta << endl; - cout << mean << endl; - cout << mean2 << endl; - cout << mean3 << endl; - cout << sigma1 << endl; - cout << sigma2 << endl; - cout << sigma3 << endl; - for (unsigned int i = 0; i < v_ZMassResHistos.size(); ++i) { - TH1D *zMass = v_ZMassResHistos[i]; - zMass->Rebin(4); //remember... - funct::Gaussian gaus1(mean, sigma1); - funct::Gaussian gaus2(mean2, sigma2); - funct::Gaussian gaus3(mean3, sigma3); - funct::Constant a(alpha), b(beta), c(yield); - funct::Number _1(1); - typedef funct::Product::type G1; - typedef funct::Sum::type SumG1; - typedef funct::Sum::type ConstSum; - typedef funct::Product::type, funct::Gaussian>::type G2; - typedef funct::Product::type>::type FitFunction; - FitFunction f = c * (a * gaus1 + b * gaus2 + (_1 - (a + b)) * gaus3); - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(alpha, 0.1, -1., 1.); - minuit.addParameter(beta, 0.1, -1., 1.); - minuit.addParameter(mean, 0.001, -1., 1.); - minuit.addParameter(mean2, 0.001, -1., 1.); - minuit.addParameter(mean3, 0.001, -1., 1.); - minuit.addParameter(sigma1, 0.1, -5., 5.); - minuit.addParameter(sigma2, 0.1, -5., 5.); - minuit.addParameter(sigma3, 0.1, -20., 20.); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(beta.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(mean2.ptr()); - pars.push_back(mean3.ptr()); - pars.push_back(sigma1.ptr()); - pars.push_back(sigma2.ptr()); - pars.push_back(sigma3.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - beta.name().c_str(), - mean.name().c_str(), - mean2.name().c_str(), - mean3.name().c_str(), - sigma1.name().c_str(), - sigma2.name().c_str(), - sigma3.name().c_str()); - fun.SetLineColor(kRed); - //fun.SetNpx(100000); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMassResFitGGG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMassResFitGGG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - cout << "It works!\n"; - } catch (std::exception &e) { - cerr << "error: " << e.what() << "\n"; - return 1; - } catch (...) { - cerr << "Exception of unknown type!\n"; - } - return 0; -} diff --git a/ElectroWeakAnalysis/ZMuMu/bin/zMuMuExpFit.cpp b/ElectroWeakAnalysis/ZMuMu/bin/zMuMuExpFit.cpp deleted file mode 100755 index 03cfbb39c5a6e..0000000000000 --- a/ElectroWeakAnalysis/ZMuMu/bin/zMuMuExpFit.cpp +++ /dev/null @@ -1,259 +0,0 @@ -#include "PhysicsTools/Utilities/interface/Parameter.h" -#include "PhysicsTools/Utilities/interface/ZLineShape.h" -#include "PhysicsTools/Utilities/interface/Gaussian.h" -#include "PhysicsTools/Utilities/interface/Exponential.h" -#include "PhysicsTools/Utilities/interface/Polynomial.h" -#include "PhysicsTools/Utilities/interface/Convolution.h" -#include "PhysicsTools/Utilities/interface/Operations.h" -#include "PhysicsTools/Utilities/interface/MultiHistoChiSquare.h" -#include "PhysicsTools/Utilities/interface/RootMinuit.h" -#include "PhysicsTools/Utilities/interface/RootMinuitCommands.h" -#include "PhysicsTools/Utilities/interface/rootPlot.h" -#include "TROOT.h" -#include "TH1.h" -#include "TFile.h" -#include -using namespace boost; -namespace po = boost::program_options; - -#include -#include -#include -#include -#include -#include -using namespace std; - -// A helper function to simplify the main part. -template -ostream& operator<<(ostream& os, const vector& v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); - return os; -} - -//A function that sets istogram contents to 0 -//if they are too small -void fix(TH1* histo) { - for(int i = 1; i <= histo->GetNbinsX(); ++i) { - if(histo->GetBinContent(i) < 0.1) { - histo->SetBinContent(i, 0.0); - histo->SetBinError(i, 0.0); - } - } -} - -typedef funct::GaussIntegrator IntegratorConv; - -int main(int ac, char *av[]) { - gROOT->SetStyle("Plain"); - try { - typedef funct::Product::type >::type ZPeak; - typedef funct::Product::type ZMuMuSig; - typedef ZMuMuSig ZMuMu; - typedef ZMuMuSig ZMuTkSig; - typedef funct::Product >::type >::type ZMuTkBkg; - typedef funct::Sum::type ZMuTk; - typedef funct::Product::type ZMuSaSig; - typedef funct::Parameter ZMuSaBkg; - typedef funct::Sum::type ZMuSa; - - typedef fit::MultiHistoChiSquare ChiSquared; - fit::RootMinuitCommands commands("ElectroWeakAnalysis/ZMuMu/test/zMuMuExpFit.txt"); - - double fMin, fMax; - string ext; - po::options_description desc("Allowed options"); - desc.add_options() - ("help", "produce help message") - ("include-path,I", po::value< vector >(), - "include path") - ("input-file", po::value< vector >(), "input file") - ("min,m", po::value(&fMin)->default_value(60), "minimum value for fit range") - ("max,M", po::value(&fMax)->default_value(120), "maximum value for fit range") - ("output-file,O", po::value(&ext)->default_value(".ps"), - "output file format") - ; - - po::positional_options_description p; - p.add("input-file", -1); - - po::variables_map vm; - po::store(po::command_line_parser(ac, av). - options(desc).positional(p).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - cout << "Usage: options_description [options]\n"; - cout << desc; - return 0; - } - - if (vm.count("include-path")) { - cout << "Include paths are: " - << vm["include-path"].as< vector >() << "\n"; - } - - if (vm.count("input-file")) { - cout << "Input files are: " - << vm["input-file"].as< vector >() << "\n"; - vector v_file = vm["input-file"].as< vector >(); - for(vector::const_iterator it = v_file.begin(); - it != v_file.end(); ++it) { - TFile * root_file = new TFile(it->c_str(),"read"); - TH1D * histoZMuMu = (TH1D*) root_file->Get("zToMM"); - fix(histoZMuMu); - TH1D * histoZMuTk = (TH1D*) root_file->Get("zToMTk"); - fix(histoZMuTk); - TH1D * histoZMuSa = (TH1D*) root_file->Get("zToMS"); - fix(histoZMuSa); - cout << ">>> histogram loaded\n"; - string f_string = *it; - replace(f_string.begin(), f_string.end(), '.', '_'); - string plot_string = f_string + ext; - cout << ">>> Input files loaded\n"; - - const char * kYieldZMuMu = "YieldZMuMu"; - const char * kYieldZMuTk = "YieldZMuTk"; - const char * kYieldZMuSa = "YieldZMuSa"; - const char * kYieldBkgZMuTk = "YieldBkgZMuTk"; - const char * kYieldBkgZMuSa = "YieldBkgZMuSa"; - const char * kLambdaZMuMu = "LambdaZMuMu"; - const char * kMass = "Mass"; - const char * kGamma = "Gamma"; - const char * kPhotonFactorZMuMu = "PhotonFactorZMuMu"; - const char * kInterferenceFactorZMuMu = "InterferenceFactorZMuMu"; - //const char * kPhotonFactorZMuTk = "PhotonFactorZMuTk"; - //const char * kInterferenceFactorZMuTk = "InterferenceFactorZMuTk"; - const char * kMeanZMuMu = "MeanZMuMu"; - const char * kSigmaZMuMu = "SigmaZMuMu"; - const char * kLambda = "Lambda"; - const char * kA0 = "A0"; - const char * kA1 = "A1"; - const char * kA2 = "A2"; - const char * kSigmaZMuSa = "SigmaZMuSa"; - - IntegratorConv integratorConv(1.e-5); - - funct::Parameter lambdaZMuMu(kLambdaZMuMu, commands.par(kLambdaZMuMu)); - funct::Parameter mass(kMass, commands.par(kMass)); - funct::Parameter gamma(kGamma, commands.par(kGamma)); - funct::Parameter photonFactorZMuMu(kPhotonFactorZMuMu, commands.par(kPhotonFactorZMuMu)); - funct::Parameter interferenceFactorZMuMu(kInterferenceFactorZMuMu, commands.par(kInterferenceFactorZMuMu)); - //funct::Parameter photonFactorZMuTk(kPhotonFactorZMuTk, commands.par(kPhotonFactorZMuTk)); - //funct::Parameter interferenceFactorZMuTk(kInterferenceFactorZMuTk, commands.par(kInterferenceFactorZMuTk)); - funct::Parameter yieldZMuMu(kYieldZMuMu, commands.par(kYieldZMuMu)); - funct::Parameter yieldZMuTk(kYieldZMuTk, commands.par(kYieldZMuTk)); - funct::Parameter yieldZMuSa(kYieldZMuSa, commands.par(kYieldZMuSa)); - funct::Parameter yieldBkgZMuTk(kYieldBkgZMuTk, commands.par(kYieldBkgZMuTk)); - funct::Parameter yieldBkgZMuSa(kYieldBkgZMuSa, commands.par(kYieldBkgZMuSa)); - funct::Parameter meanZMuMu(kMeanZMuMu, commands.par(kMeanZMuMu)); - funct::Parameter sigmaZMuMu(kSigmaZMuMu, commands.par(kSigmaZMuMu)); - funct::Parameter sigmaZMuSa(kSigmaZMuSa, commands.par(kSigmaZMuSa)); - funct::Parameter lambda(kLambda, commands.par(kLambda)); - funct::Parameter a0(kA0, commands.par(kA0)); - funct::Parameter a1(kA1, commands.par(kA1)); - funct::Parameter a2(kA2, commands.par(kA2)); - - ZPeak zPeak = funct::Exponential(lambdaZMuMu) * - funct::conv(funct::ZLineShape(mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu), - funct::Gaussian(meanZMuMu, sigmaZMuMu), - -3*sigmaZMuMu.value(), 3*sigmaZMuMu.value(), integratorConv); - ZMuMu zMuMu = yieldZMuMu * zPeak; - ZMuTkBkg zMuTkBkg = - yieldBkgZMuTk * (funct::Exponential(lambda) * funct::Polynomial<2>(a0, a1, a2)); - ZMuTk zMuTk = yieldZMuTk * zPeak + zMuTkBkg; - ZMuSa zMuSa = yieldZMuSa * funct::Gaussian(mass, sigmaZMuSa) + yieldBkgZMuSa; - - ChiSquared chi2(zMuMu, histoZMuMu, - zMuTk, histoZMuTk, - zMuSa, histoZMuSa, - fMin, fMax); - cout << "N. deg. of freedom: " << chi2.numberOfBins() << endl; - fit::RootMinuit minuit(chi2, true); - commands.add(minuit, yieldZMuMu); - commands.add(minuit, yieldZMuTk); - commands.add(minuit, yieldZMuSa); - commands.add(minuit, yieldBkgZMuTk); - commands.add(minuit, yieldBkgZMuSa); - commands.add(minuit, lambdaZMuMu); - commands.add(minuit, mass); - commands.add(minuit, gamma); - commands.add(minuit, photonFactorZMuMu); - commands.add(minuit, interferenceFactorZMuMu); - //commands.add(minuit, photonFactorZMuTk); - //commands.add(minuit, interferenceFactorZMuTk); - commands.add(minuit, meanZMuMu); - commands.add(minuit, sigmaZMuMu); - commands.add(minuit, lambda); - commands.add(minuit, a0); - commands.add(minuit, a1); - commands.add(minuit, a2); - commands.add(minuit, sigmaZMuSa); - commands.run(minuit); - const unsigned int nPar = 17; - ROOT::Math::SMatrix > err; - minuit.getErrorMatrix(err); - std::cout << "error matrix:" << std::endl; - for(unsigned int i = 0; i < nPar; ++i) { - for(unsigned int j = 0; j < nPar; ++j) { - std::cout << err(i, j) << "\t"; - } - std::cout << std::endl; - } - minuit.printFitResults(); - string ZMuMuPlot = "ZMuMuFit" + plot_string; - root::plot(ZMuMuPlot.c_str(), *histoZMuMu, zMuMu, fMin, fMax, - yieldZMuMu, lambdaZMuMu, mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu, - meanZMuMu, sigmaZMuMu, - kRed, 2, kDashed, 10000, - "Z -> #mu #mu mass with isolation cut", "#mu #mu invariant mass (GeV/c^{2})", - "Events"); - string ZMuTkPlot = "ZMuTkFit" + plot_string; - TF1 funZMuTk = root::tf1("ZMuTkFunction", zMuTk, fMin, fMax, - yieldZMuTk, lambdaZMuMu, mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu, - meanZMuMu, sigmaZMuMu, - yieldBkgZMuTk, lambda, a0, a1, a2); - funZMuTk.SetLineColor(kRed); - funZMuTk.SetLineWidth(2); - funZMuTk.SetLineStyle(kDashed); - funZMuTk.SetNpx(10000); - TF1 funZMuTkBkg = root::tf1("ZMuTkBack", zMuTkBkg, fMin, fMax, - yieldBkgZMuTk, lambda, a0, a1, a2); - funZMuTkBkg.SetLineColor(kGreen); - funZMuTkBkg.SetLineWidth(2); - funZMuTkBkg.SetLineStyle(kDashed); - funZMuTkBkg.SetNpx(10000); - histoZMuTk->SetTitle("Z -> #mu + (unmatched) track mass with isolation cut"); - histoZMuTk->SetXTitle("#mu + (unmatched) track invariant mass (GeV/c^{2})"); - histoZMuTk->SetYTitle("Events"); - TCanvas *canvas = new TCanvas("canvas"); - histoZMuTk->Draw("e"); - funZMuTk.Draw("same"); - funZMuTkBkg.Draw("same"); - canvas->SaveAs(ZMuTkPlot.c_str()); - canvas->SetLogy(); - string logZMuTkPlot = "log_" + ZMuTkPlot; - canvas->SaveAs(logZMuTkPlot.c_str()); - string ZMuSaPlot = "ZMuSaFit" + plot_string; - root::plot(ZMuSaPlot.c_str(), *histoZMuSa, zMuSa, fMin, fMax, - yieldZMuSa, mass, sigmaZMuSa, yieldBkgZMuSa, - kRed, 2, kDashed, 10000, - "Z -> #mu + (unmatched) standalone mass with isolation cut", - "#mu + (unmatched) standalone invariant mass (GeV/c^{2})", - "Events"); - } - } - - } - catch(std::exception& e) { - cerr << "error: " << e.what() << "\n"; - return 1; - } - catch(...) { - cerr << "Exception of unknown type!\n"; - } - return 0; -} - diff --git a/ElectroWeakAnalysis/ZMuMu/bin/zMuMuFit.cpp b/ElectroWeakAnalysis/ZMuMu/bin/zMuMuFit.cpp deleted file mode 100644 index 09bce04e22d6d..0000000000000 --- a/ElectroWeakAnalysis/ZMuMu/bin/zMuMuFit.cpp +++ /dev/null @@ -1,283 +0,0 @@ -#include "PhysicsTools/Utilities/interface/Parameter.h" -#include "PhysicsTools/Utilities/interface/ZLineShape.h" -#include "PhysicsTools/Utilities/interface/Gaussian.h" -#include "PhysicsTools/Utilities/interface/Numerical.h" -#include "PhysicsTools/Utilities/interface/Exponential.h" -#include "PhysicsTools/Utilities/interface/Polynomial.h" -#include "PhysicsTools/Utilities/interface/Convolution.h" -#include "PhysicsTools/Utilities/interface/Operations.h" -#include "PhysicsTools/Utilities/interface/MultiHistoChiSquare.h" -#include "PhysicsTools/Utilities/interface/RootMinuit.h" -#include "PhysicsTools/Utilities/interface/RootMinuitCommands.h" -#include "PhysicsTools/Utilities/interface/rootPlot.h" -#include "TROOT.h" -#include "TH1.h" -#include "TFile.h" -#include -using namespace boost; -namespace po = boost::program_options; - -#include -#include -#include -#include -#include -#include -using namespace std; - -// A helper function to simplify the main part. -template -ostream& operator<<(ostream& os, const vector& v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); - return os; -} - -//A function that sets istogram contents to 0 -//if they are too small -void fix(TH1* histo) { - for(int i = 1; i <= histo->GetNbinsX(); ++i) { - if(histo->GetBinContent(i) < 0.1) { - histo->SetBinContent(i, 0.0); - histo->SetBinError(i, 0.0); - } - } -} - -typedef funct::GaussIntegrator IntegratorConv; - -int main(int ac, char *av[]) { - gROOT->SetStyle("Plain"); - try { - typedef funct::Product::type>::type ZPeak; - typedef funct::Product::type ZMuMuSig; - typedef funct::Product >::type, - funct::Power >::type >::type ZMuMuEfficiency; - typedef funct::Product::type ZMuMu; - - typedef funct::Product, - funct::Product >::type, - funct::Product, funct::Parameter>::type - >::type - >::type - >::type ZMuTkEfficiency; - typedef funct::Product::type ZMuTkSig; - typedef funct::Product >::type >::type ZMuTkBkg; - typedef funct::Sum::type ZMuTk; - - typedef ZMuTkEfficiency ZMuSaEfficiency; - typedef funct::Product::type >::type ZMuSaSig; - typedef funct::Parameter ZMuSaBkg; - typedef funct::Sum::type ZMuSa; - - typedef fit::MultiHistoChiSquare ChiSquared; - fit::RootMinuitCommands commands("ElectroWeakAnalysis/ZMuMu/test/zMuMuFit.txt"); - - double fMin, fMax; - string ext; - po::options_description desc("Allowed options"); - desc.add_options() - ("help", "produce help message") - ("include-path,I", po::value< vector >(), - "include path") - ("input-file", po::value< vector >(), "input file") - ("min,m", po::value(&fMin)->default_value(60), "minimum value for fit range") - ("max,M", po::value(&fMax)->default_value(120), "maximum value for fit range") - ("output-file,O", po::value(&ext)->default_value(".ps"), - "output file format") - ; - - po::positional_options_description p; - p.add("input-file", -1); - - po::variables_map vm; - po::store(po::command_line_parser(ac, av). - options(desc).positional(p).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - cout << "Usage: options_description [options]\n"; - cout << desc; - return 0; - } - - if (vm.count("include-path")) { - cout << "Include paths are: " - << vm["include-path"].as< vector >() << "\n"; - } - - if (vm.count("input-file")) { - cout << "Input files are: " - << vm["input-file"].as< vector >() << "\n"; - vector v_file = vm["input-file"].as< vector >(); - for(vector::const_iterator it = v_file.begin(); - it != v_file.end(); ++it) { - TFile * root_file = new TFile(it->c_str(),"read"); - TH1D * histoZMuMu = (TH1D*) root_file->Get("zToMM"); - fix(histoZMuMu); - TH1D * histoZMuTk = (TH1D*) root_file->Get("zToMTk"); - fix(histoZMuTk); - TH1D * histoZMuSa = (TH1D*) root_file->Get("zToMS"); - fix(histoZMuSa); - cout << ">>> histogram loaded\n"; - string f_string = *it; - replace(f_string.begin(), f_string.end(), '.', '_'); - string plot_string = f_string + ext; - cout << ">>> Input files loaded\n"; - - const char * kYieldZMuMu = "YieldZMuMu"; - const char * kEfficiencyTk = "EfficiencyTk"; - const char * kEfficiencySa = "EfficiencySa"; - const char * kYieldBkgZMuTk = "YieldBkgZMuTk"; - const char * kYieldBkgZMuSa = "YieldBkgZMuSa"; - const char * kLambdaZMuMu = "LambdaZMuMu"; - const char * kMass = "Mass"; - const char * kGamma = "Gamma"; - const char * kPhotonFactorZMuMu = "PhotonFactorZMuMu"; - const char * kInterferenceFactorZMuMu = "InterferenceFactorZMuMu"; - //const char * kPhotonFactorZMuTk = "PhotonFactorZMuTk"; - //const char * kInterferenceFactorZMuTk = "InterferenceFactorZMuTk"; - const char * kMeanZMuMu = "MeanZMuMu"; - const char * kSigmaZMuMu = "SigmaZMuMu"; - const char * kLambda = "Lambda"; - const char * kA0 = "A0"; - const char * kA1 = "A1"; - const char * kA2 = "A2"; - const char * kSigmaZMuSa = "SigmaZMuSa"; - - IntegratorConv integratorConv(1.e-5); - - funct::Parameter lambdaZMuMu(kLambdaZMuMu, commands.par(kLambdaZMuMu)); - funct::Parameter mass(kMass, commands.par(kMass)); - funct::Parameter gamma(kGamma, commands.par(kGamma)); - funct::Parameter photonFactorZMuMu(kPhotonFactorZMuMu, commands.par(kPhotonFactorZMuMu)); - funct::Parameter interferenceFactorZMuMu(kInterferenceFactorZMuMu, commands.par(kInterferenceFactorZMuMu)); - //funct::Parameter photonFactorZMuTk(kPhotonFactorZMuTk, commands.par(kPhotonFactorZMuTk)); - //funct::Parameter interferenceFactorZMuTk(kInterferenceFactorZMuTk, commands.par(kInterferenceFactorZMuTk)); - funct::Parameter yieldZMuMu(kYieldZMuMu, commands.par(kYieldZMuMu)); - funct::Parameter efficiencyTk(kEfficiencyTk, commands.par(kEfficiencyTk)); - funct::Parameter efficiencySa(kEfficiencySa, commands.par(kEfficiencySa)); - funct::Parameter yieldBkgZMuTk(kYieldBkgZMuTk, commands.par(kYieldBkgZMuTk)); - funct::Parameter yieldBkgZMuSa(kYieldBkgZMuSa, commands.par(kYieldBkgZMuSa)); - funct::Parameter meanZMuMu(kMeanZMuMu, commands.par(kMeanZMuMu)); - funct::Parameter sigmaZMuMu(kSigmaZMuMu, commands.par(kSigmaZMuMu)); - funct::Parameter sigmaZMuSa(kSigmaZMuSa, commands.par(kSigmaZMuSa)); - funct::Parameter lambda(kLambda, commands.par(kLambda)); - funct::Parameter a0(kA0, commands.par(kA0)); - funct::Parameter a1(kA1, commands.par(kA1)); - funct::Parameter a2(kA2, commands.par(kA2)); - - ZPeak zPeak = funct::Exponential(lambdaZMuMu) * - funct::conv(funct::ZLineShape(mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu), - funct::Gaussian(meanZMuMu, sigmaZMuMu), - -3*sigmaZMuMu.value(), 3*sigmaZMuMu.value(), integratorConv); - ZMuMuSig zMuMuSig = yieldZMuMu * zPeak; - ZMuMuEfficiency zMuMuEfficiency = (efficiencyTk ^ funct::Numerical<2>(2)) * - (efficiencySa ^ funct::Numerical<2>(2)); - ZMuMu zMuMu = zMuMuEfficiency * zMuMuSig; - ZMuTkBkg zMuTkBkg = - yieldBkgZMuTk * (funct::Exponential(lambda) * funct::Polynomial<2>(a0, a1, a2)); - ZMuTkEfficiency zMuTkEfficiency = funct::Numerical<2>(2) * - ((efficiencyTk ^ funct::Numerical<2>(2)) * (efficiencySa * (funct::Numerical<1>(1) - efficiencySa))); - ZMuTk zMuTk = zMuTkEfficiency * zMuMuSig + zMuTkBkg; - ZMuSaEfficiency zMuSaEfficiency = funct::Numerical<2>(2) * - ((efficiencySa ^ funct::Numerical<2>(2)) * (efficiencyTk * (funct::Numerical<1>(1) - efficiencyTk))); - ZMuSa zMuSa = zMuSaEfficiency * (yieldZMuMu * funct::Gaussian(mass, sigmaZMuSa)) + yieldBkgZMuSa; - - ChiSquared chi2(zMuMu, histoZMuMu, - zMuTk, histoZMuTk, - zMuSa, histoZMuSa, - fMin, fMax); - cout << "N. deg. of freedom: " << chi2.numberOfBins() << endl; - fit::RootMinuit minuit(chi2, true); - commands.add(minuit, yieldZMuMu); - commands.add(minuit, efficiencyTk); - commands.add(minuit, efficiencySa); - commands.add(minuit, yieldBkgZMuTk); - commands.add(minuit, yieldBkgZMuSa); - commands.add(minuit, lambdaZMuMu); - commands.add(minuit, mass); - commands.add(minuit, gamma); - commands.add(minuit, photonFactorZMuMu); - commands.add(minuit, interferenceFactorZMuMu); - //commands.add(minuit, photonFactorZMuTk); - //commands.add(minuit, interferenceFactorZMuTk); - commands.add(minuit, meanZMuMu); - commands.add(minuit, sigmaZMuMu); - commands.add(minuit, lambda); - commands.add(minuit, a0); - commands.add(minuit, a1); - commands.add(minuit, a2); - commands.add(minuit, sigmaZMuSa); - commands.run(minuit); - const unsigned int nPar = 17; - ROOT::Math::SMatrix > err; - minuit.getErrorMatrix(err); - std::cout << "error matrix:" << std::endl; - for(unsigned int i = 0; i < nPar; ++i) { - for(unsigned int j = 0; j < nPar; ++j) { - std::cout << err(i, j) << "\t"; - } - std::cout << std::endl; - } - minuit.printFitResults(); - string ZMuMuPlot = "ZMuMuFit" + plot_string; - root::plot(ZMuMuPlot.c_str(), *histoZMuMu, zMuMu, fMin, fMax, - efficiencyTk, efficiencySa, - yieldZMuMu, lambdaZMuMu, mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu, - meanZMuMu, sigmaZMuMu, - kRed, 2, kDashed, 10000, - "Z -> #mu #mu mass", "#mu #mu invariant mass (GeV/c^{2})", - "Events"); - string ZMuTkPlot = "ZMuTkFit" + plot_string; - TF1 funZMuTk = root::tf1("ZMuTkFunction", zMuTk, fMin, fMax, - efficiencyTk, efficiencySa, - yieldZMuMu, lambdaZMuMu, mass, gamma, photonFactorZMuMu, interferenceFactorZMuMu, - meanZMuMu, sigmaZMuMu, - yieldBkgZMuTk, lambda, a0, a1, a2); - funZMuTk.SetLineColor(kRed); - funZMuTk.SetLineWidth(2); - funZMuTk.SetLineStyle(kDashed); - funZMuTk.SetNpx(10000); - TF1 funZMuTkBkg = root::tf1("ZMuTkBack", zMuTkBkg, fMin, fMax, - yieldBkgZMuTk, lambda, a0, a1, a2); - funZMuTkBkg.SetLineColor(kGreen); - funZMuTkBkg.SetLineWidth(2); - funZMuTkBkg.SetLineStyle(kDashed); - funZMuTkBkg.SetNpx(10000); - histoZMuTk->SetTitle("Z -> #mu + (unmatched) track mass"); - histoZMuTk->SetXTitle("#mu + (unmatched) track invariant mass (GeV/c^{2})"); - histoZMuTk->SetYTitle("Events"); - TCanvas *canvas = new TCanvas("canvas"); - histoZMuTk->Draw("e"); - funZMuTk.Draw("same"); - funZMuTkBkg.Draw("same"); - canvas->SaveAs(ZMuTkPlot.c_str()); - canvas->SetLogy(); - string logZMuTkPlot = "log_" + ZMuTkPlot; - canvas->SaveAs(logZMuTkPlot.c_str()); - string ZMuSaPlot = "ZMuSaFit" + plot_string; - root::plot(ZMuSaPlot.c_str(), *histoZMuSa, zMuSa, fMin, fMax, - efficiencySa, efficiencyTk, - yieldZMuMu, mass, sigmaZMuSa, yieldBkgZMuSa, - kRed, 2, kDashed, 10000, - "Z -> #mu + (unmatched) standalone mass", - "#mu + (unmatched) standalone invariant mass (GeV/c^{2})", - "Events"); - } - } - - } - catch(std::exception& e) { - cerr << "error: " << e.what() << "\n"; - return 1; - } - catch(...) { - cerr << "Exception of unknown type!\n"; - } - return 0; -} - diff --git a/ElectroWeakAnalysis/ZMuMu/bin/zToMuMuMassMCFit.cpp b/ElectroWeakAnalysis/ZMuMu/bin/zToMuMuMassMCFit.cpp deleted file mode 100644 index 9fea7e2d1dd17..0000000000000 --- a/ElectroWeakAnalysis/ZMuMu/bin/zToMuMuMassMCFit.cpp +++ /dev/null @@ -1,438 +0,0 @@ -#include "PhysicsTools/Utilities/interface/Parameter.h" -#include "PhysicsTools/Utilities/interface/BreitWigner.h" -#include "PhysicsTools/Utilities/interface/Constant.h" -#include "PhysicsTools/Utilities/interface/Identity.h" -#include "PhysicsTools/Utilities/interface/Product.h" -#include "PhysicsTools/Utilities/interface/Sum.h" -#include "PhysicsTools/Utilities/interface/Number.h" -#include "PhysicsTools/Utilities/interface/Exponential.h" -#include "PhysicsTools/Utilities/interface/Gaussian.h" -#include "PhysicsTools/Utilities/interface/ZLineShape.h" -#include "PhysicsTools/Utilities/interface/HistoChiSquare.h" -#include "PhysicsTools/Utilities/interface/RootMinuit.h" -#include "PhysicsTools/Utilities/interface/RootFunctionAdapter.h" -#include "PhysicsTools/Utilities/interface/rootPlot.h" -#include "TFile.h" -#include "TH1.h" -#include "TF1.h" -#include "TMath.h" -#include "TCanvas.h" -#include "TROOT.h" - -#include -#include -#include -#include -#include -#include -using namespace boost; -namespace po = boost::program_options; -using namespace std; - -// A helper function to simplify the main part. -template -ostream &operator<<(ostream &os, const vector &v) { - copy(v.begin(), v.end(), ostream_iterator(cout, " ")); - return os; -} - -int main(int ac, char *av[]) { - try { - double fMin, fMax; - string ext; - po::options_description desc("Allowed options"); - desc.add_options()("help", "produce help message")("include-path,I", po::value >(), "include path")( - "input-file", po::value >(), "input file")( - "min,m", po::value(&fMin)->default_value(80), "minimum value for fit range")( - "max,M", po::value(&fMax)->default_value(120), "maximum value for fit range")( - "breitwigner", "fit to a breit-wigner")("gauss", "fit to a gaussian")( - "bwinter", "fit to a breit-wigner plus Z/photon interference term")( - "bwintgam", "fit to a breit-wigner plus Z/photon interference term and photon propagator")( - "expbwintgam", - "fit to the product of an exponential with a breit-wigner plus Z/photon interference term and photon " - "propagator")("weipolexpbwintgam", - "fit to the product of a weighted polynomial and an exponential with a breit-wigner plus " - "Z/photon interference term and photon propagator")( - "output-file,O", po::value(&ext)->default_value(".ps"), "output file format"); - - po::positional_options_description p; - p.add("input-file", -1); - - po::variables_map vm; - po::store(po::command_line_parser(ac, av).options(desc).positional(p).run(), vm); - po::notify(vm); - - if (vm.count("help")) { - cout << "Usage: options_description [options]\n"; - cout << desc; - return 0; - } - - if (vm.count("include-path")) { - cout << "Include paths are: " << vm["include-path"].as >() << "\n"; - } - - vector v_file; - vector v_ZMCMassHistos; - vector v_eps; - - if (vm.count("input-file")) { - cout << "Input files are: " << vm["input-file"].as >() << "\n"; - v_file = vm["input-file"].as >(); - for (vector::const_iterator it = v_file.begin(); it != v_file.end(); ++it) { - TFile *root_file = new TFile(it->c_str(), "read"); - TDirectory *Histos = (TDirectory *)root_file->GetDirectory("ZHisto"); - TDirectory *MCHistos = (TDirectory *)Histos->GetDirectory("ZMCHisto"); - TH1D *zMass = (TH1D *)MCHistos->Get("MuMuMCMass"); //for Z status 3 use "ZMCMass" - zMass->Rebin(4); //remember... - zMass->GetXaxis()->SetTitle("Mass (GeV/c^{2})"); - v_ZMCMassHistos.push_back(zMass); - gROOT->SetStyle("Plain"); - string f_string = *it; - replace(f_string.begin(), f_string.end(), '.', '_'); - string eps_string = f_string + ext; - v_eps.push_back(eps_string); - cout << ">>> histogram loaded\n"; - } - cout << v_file.size() << ", " << v_ZMCMassHistos.size() << ", " << v_eps.size() << endl; - cout << ">>> Input files loaded\n"; - } - //Values for Z mass and width - funct::Parameter mass("Mass", 91.092); //91.1876 - funct::Parameter gamma("Gamma", 2.980); //2.4952 - //funct::Parameters for Z Line Shape - funct::Parameter f_gamma("Photon factor", 0.85); //0 - funct::Parameter f_int("Interference factor", -0.00142); //0.001 - funct::Parameter yield("Yield", 482000); //1000 - //funct::Parameters for fits with one gaussian - funct::Parameter mean("Mean", 91.1876); - funct::Parameter sigma("Sigma", 10.); - //funct::Parameters for fit with an exponential - funct::Parameter lambda("Lambda", -0.0054); //-0.001 - //funct::Parameters for fit with a weighted polynomial - funct::Parameter alpha("Alpha", 0.1); - - if (vm.count("breitwigner")) { - cout << "Fitting histograms in input file to a Breit-Wigner\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - cout << ">>> load histogram\n"; - TH1D *zMass = v_ZMCMassHistos[i]; - cout << ">>> histogram loaded\n"; - funct::BreitWigner bw(mass, gamma); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * bw; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.minimize(); - minuit.printFitResults(); - root::plot("ZMuMuMassMCFitBW.eps", *zMass, f, fMin, fMax, yield, mass, gamma); - } - } - - if (vm.count("gauss")) { - cout << "Fitting histograms in input files to a Gaussian\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mean << endl; - cout << sigma << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - TH1D *zMass = v_ZMCMassHistos[i]; - funct::Gaussian gaus(mean, sigma); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * gaus; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mean, 0.001, 80, 100); - minuit.addParameter(sigma, 0.1, -5., 5.); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, yield, mean, sigma); - fun.SetParNames(yield.name().c_str(), mean.name().c_str(), sigma.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMuMuMassMCFitG_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMuMuMassMCFitG_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("bwinter")) { - cout << "Fitting histograms in input files to the Breit-Wigner plus Z/photon interference term\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - TH1D *zMass = v_ZMCMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * zls; - cout << "set functions" << endl; - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 100000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.fixParameter(f_gamma.name()); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMuMuMassMCFitBwIn_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMuMuMassMCFitBwIn_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("bwintgam")) { - cout << "Fitting histograms in input files to the Breit-Wigner plus Z/photon interference term and photon " - "propagator\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - TH1D *zMass = v_ZMCMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Constant c(yield); - typedef funct::Product::type FitFunction; - FitFunction f = c * zls; - cout << "set functions" << endl; - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 1000000); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetParNames(yield.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMuMuMassMCFitBwInGa_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMuMuMassMCFitBwInGa_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("expbwintgam")) { - cout << "Fitting histograms in input files to the product of an exponential with the Breit-Wigner plus Z/photon " - "interference term and photon propagator\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << lambda << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - TH1D *zMass = v_ZMCMassHistos[i]; - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Exponential expo(lambda); - funct::Constant c(yield); - typedef funct::Product::type ExpZLS; - ExpZLS expz = expo * zls; - typedef funct::Product::type FitFunction; - FitFunction f = c * expz; - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(lambda, 0.1, -1., 0); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(lambda.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetNpx(100000); - fun.SetParNames(yield.name().c_str(), - lambda.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMuMuMassMCFitExpBwInGa_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMuMuMassMCFitExpBwInGa_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - if (vm.count("weipolexpbwintgam")) { - cout << "Fitting histograms in input files to the product of a weighted polynomial and an exponential with the " - "Breit-Wigner plus Z/photon interference term and photon propagator\n"; - cout << ">>> set pars: " << endl; - cout << yield << endl; - cout << lambda << endl; - cout << mass << endl; - cout << gamma << endl; - cout << f_gamma << endl; - cout << f_int << endl; - cout << mean << endl; - cout << sigma << endl; - cout << alpha << endl; - for (unsigned int i = 0; i < v_ZMCMassHistos.size(); ++i) { - TH1D *zMass = v_ZMCMassHistos[i]; - funct::Constant a(alpha); - funct::Identity id; - funct::Gaussian gaus(mean, sigma); - funct::Number _1(1.); - funct::ZLineShape zls(mass, gamma, f_gamma, f_int); - funct::Exponential expo(lambda); - funct::Constant c(yield); - typedef funct::Product::type Pol1; - Pol1 pol = a * id; - typedef funct::Product::type PolGau; - PolGau poga = pol * gaus; - typedef funct::Sum::type SumPG; - SumPG spg = _1 + poga; - typedef funct::Product::type ExpZLS; - ExpZLS expz = expo * zls; - typedef funct::Product::type SumPGExpZ; - SumPGExpZ spgexpz = spg * expz; - typedef funct::Product::type FitFunction; - FitFunction f = c * spgexpz; - cout << "set functions" << endl; - typedef fit::HistoChiSquare ChiSquared; - ChiSquared chi2(f, zMass, fMin, fMax); - int fullBins = chi2.numberOfBins(); - cout << "N. deg. of freedom: " << fullBins << endl; - fit::RootMinuit minuit(chi2, true); - minuit.addParameter(yield, 10, 100, 10000000); - minuit.addParameter(alpha, 0.1, -100, 100); - minuit.addParameter(mean, 10, 70, 110); - minuit.fixParameter(mean.name()); - minuit.addParameter(sigma, 0.1, -100, 100); - minuit.addParameter(lambda, 0.1, -100, 100); - minuit.addParameter(mass, .1, 70., 110); - minuit.addParameter(gamma, 1, 1, 10); - minuit.addParameter(f_gamma, 0.1, -100, 1000); - minuit.addParameter(f_int, .0001, -1000000, 1000000); - minuit.minimize(); - minuit.printFitResults(); - vector > pars; - pars.push_back(yield.ptr()); - pars.push_back(alpha.ptr()); - pars.push_back(mean.ptr()); - pars.push_back(sigma.ptr()); - pars.push_back(lambda.ptr()); - pars.push_back(mass.ptr()); - pars.push_back(gamma.ptr()); - pars.push_back(f_gamma.ptr()); - pars.push_back(f_int.ptr()); - TF1 fun = root::tf1("fun", f, fMin, fMax, pars); - fun.SetNpx(100000); - fun.SetParNames(yield.name().c_str(), - alpha.name().c_str(), - mean.name().c_str(), - sigma.name().c_str(), - lambda.name().c_str(), - mass.name().c_str(), - gamma.name().c_str(), - f_gamma.name().c_str(), - f_int.name().c_str()); - fun.SetLineColor(kRed); - fun.SetLineWidth(1); - fun.SetLineStyle(kDashed); - TCanvas *canvas = new TCanvas("canvas"); - zMass->Draw("e"); - fun.Draw("same"); - string epsFilename = "ZMuMuMassMCFitWeiPolExpBwInGa_" + v_eps[i]; - canvas->SaveAs(epsFilename.c_str()); - canvas->SetLogy(); - string epsLogFilename = "ZMuMuMassMCFitWeiPolExpBwInGa_Log_" + v_eps[i]; - canvas->SaveAs(epsLogFilename.c_str()); - } - } - - cout << "It works!\n"; - } catch (std::exception &e) { - cerr << "error: " << e.what() << "\n"; - return 1; - } catch (...) { - cerr << "Exception of unknown type!\n"; - } - return 0; -} diff --git a/EventFilter/DTRawToDigi/interface/DTROS25Data.h b/EventFilter/DTRawToDigi/interface/DTROS25Data.h deleted file mode 100644 index 57ea5ecaa1df0..0000000000000 --- a/EventFilter/DTRawToDigi/interface/DTROS25Data.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef DTRawToDigi_DTROS25Data_h -#define DTRawToDigi_DTROS25Data_h - -/** \class DTROS25Data - * The collection containing DT ROS25 status data. - * - * \author M. Zanetti - INFN Padova - */ - -#include - -#include - - -typedef std::pair DTTDCData; - -class DTROS25Data { - -public: - - /// Constructors - DTROS25Data(int ROSId = 0): theROSId(ROSId) {} - - - /// Destructor - virtual ~DTROS25Data() {} - - /// Setters - inline void setROSId(const int & ID) { theROSId = ID; } - - inline void addROSTrailer( const DTROSTrailerWord & word) { theROSTrailers.push_back(word); } - inline void addROSError( const DTROSErrorWord & word) { theROSErrors.push_back(word); } - inline void addROSDebug( const DTROSDebugWord & word) { theROSDebugs.push_back(word); } - inline void addROBTrailer( const DTROBTrailerWord & word) { theROBTrailers.push_back(word); } - inline void addTDCMeasurement( const DTTDCMeasurementWord & word) { theTDCMeasurements.push_back(word); } - inline void addTDCData( const DTTDCData & tdcData) { theTDCData.push_back(tdcData); } - - /// Getters - inline int getROSID() const { return theROSId; } - - inline const std::vector& getROSTrailers() const {return theROSTrailers;} - inline const std::vector& getROSErrors() const {return theROSErrors;} - inline const std::vector& getROSDebugs() const {return theROSDebugs;} - inline const std::vector& getROBTrailers() const {return theROBTrailers;} - inline const std::vector& getTDCMeasurements() const {return theTDCMeasurements;} - inline const std::vector& getTDCData() const {return theTDCData;} - -private: - - int theROSId; - - std::vector theROSTrailers; - std::vector theROSErrors; - std::vector theROSDebugs; - std::vector theROBTrailers; - std::vector theTDCMeasurements; - std::vector theTDCData; - -}; - -#endif diff --git a/EventFilter/ESRawToDigi/interface/ESCrcKchipFast.h b/EventFilter/ESRawToDigi/interface/ESCrcKchipFast.h deleted file mode 100644 index 206cbc5c734dc..0000000000000 --- a/EventFilter/ESRawToDigi/interface/ESCrcKchipFast.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef ESCrcKchipFast_H -#define ESCrcKchipFast_H - -#include - -class ESCrcKchipFast { - - private : - - uint32_t crc; - - public: - - ESCrcKchipFast() { - init(); - reset() ; - }; - - void init() { - crc = 0x0ffff ; - } - - void reset() { - crc = 0x0ffff ; - } ; - - void add(unsigned int data) { - for (int i=0;i<16;i++) - { - if ((crc&0x0001) == (data&0x0001)) - crc=crc>>1; - else - crc=(crc>>1)^0x8408; // flipped 0x1021; - data=(data>>1); - } - }; - - uint32_t get_crc() { - return crc ; - }; - - bool isCrcOk(unsigned int crcin=0x0000) { - return ((get_crc()==crcin) ? true : false ); - }; - - ~ESCrcKchipFast() { } ; - -}; - -#endif diff --git a/EventFilter/EcalRawToDigi/interface/ECALUnpackerException.h b/EventFilter/EcalRawToDigi/interface/ECALUnpackerException.h deleted file mode 100644 index a9f1e57d0cdb2..0000000000000 --- a/EventFilter/EcalRawToDigi/interface/ECALUnpackerException.h +++ /dev/null @@ -1,32 +0,0 @@ -// Date : 30/05/2005 -// Author : N.Almeida (LIP) - -#ifndef ECALUNPACKEREXCEPTION_H -#define ECALUNPACKEREXCEPTION_H - -#include -#include -#include - - -class ECALUnpackerException { - public : - - /** - * Constructor - */ - ECALUnpackerException(std::ostringstream a){ info_=a.str(); } - - ECALUnpackerException(std::string a){info_=a;} - /** - * Exception's discription - */ - std::string what() const throw() { return info_;} - - protected : - - std::string info_; - -}; - -#endif diff --git a/EventFilter/EcalRawToDigi/interface/MyWatcher.h b/EventFilter/EcalRawToDigi/interface/MyWatcher.h deleted file mode 100644 index 5d26a0df24808..0000000000000 --- a/EventFilter/EcalRawToDigi/interface/MyWatcher.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef MyWATCHER_H -#define MyWATCHER_H - -#include "TStopwatch.h" -#include -#include - -#ifdef EDM_ML_DEBUG -class MyWatcher : public TStopwatch { - public: - MyWatcher(const std::string n=""):name(n),total(0) {} - ~MyWatcher(){} - - std::string start(bool r=true){Start(r); return " [Start]";} - std::string continu(){Continue(); return " [Continue]";} - std::string reset(){Reset(); return " [Reset]";} - std::string stop() {Stop(); return " [Stop]";} - std::string lap() { - std::stringstream o; - double r=RealTime(); - total+=r; - o<<"\n "< -#include -#include - - - - namespace evf - { - - - namespace moduleweb { - class ForkParams { - public: - ForkParams():slotId(-1),restart(0),isMaster(-1){} - int slotId; - bool restart; - int isMaster; - }; - class ForkInfoObj { - public: - ForkInfoObj() - { - control_sem_ = new sem_t; - sem_init(control_sem_,0,0); - stopCondition=0; - receivedStop_=false; - } - ~ForkInfoObj() - { - sem_destroy(control_sem_); - delete control_sem_; - } - void lock() {if (mst_lock_) pthread_mutex_lock(mst_lock_);} - void unlock() {if (mst_lock_) pthread_mutex_unlock(mst_lock_);} - void (*forkHandler) (void *); - ForkParams forkParams; - unsigned int stopCondition; - bool receivedStop_; - sem_t *control_sem_; - pthread_mutex_t * mst_lock_; - void * fuAddr; - }; - } - -} -#endif diff --git a/EventFilter/Utilities/interface/config_json.h b/EventFilter/Utilities/interface/config_json.h deleted file mode 100644 index 5d334cbc5e6b9..0000000000000 --- a/EventFilter/Utilities/interface/config_json.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef JSON_CONFIG_H_INCLUDED -# define JSON_CONFIG_H_INCLUDED - -/// If defined, indicates that json library is embedded in CppTL library. -//# define JSON_IN_CPPTL 1 - -/// If defined, indicates that json may leverage CppTL library -//# define JSON_USE_CPPTL 1 -/// If defined, indicates that cpptl vector based map should be used instead of std::map -/// as Value container. -//# define JSON_USE_CPPTL_SMALLMAP 1 -/// If defined, indicates that Json specific container should be used -/// (hash table & simple deque container with customizable allocator). -/// THIS FEATURE IS STILL EXPERIMENTAL! -//# define JSON_VALUE_USE_INTERNAL_MAP 1 -/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. -/// The memory pools allocator used optimization (initializing Value and ValueInternalLink -/// as if it was a POD) that may cause some validation tool to report errors. -/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. -//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 - -/// If defined, indicates that Json use exception to report invalid type manipulation -/// instead of C assert macro. -# define JSON_USE_EXCEPTION 1 - -# ifdef JSON_IN_CPPTL -# include -# ifndef JSON_USE_CPPTL -# define JSON_USE_CPPTL 1 -# endif -# endif - -# ifdef JSON_IN_CPPTL -# define JSON_API CPPTL_API -# elif defined(JSON_DLL_BUILD) -# define JSON_API __declspec(dllexport) -# elif defined(JSON_DLL) -# define JSON_API __declspec(dllimport) -# else -# define JSON_API -# endif - -#endif // JSON_CONFIG_H_INCLUDED diff --git a/FWCore/ServiceRegistry/interface/TypeInfoHolder.h b/FWCore/ServiceRegistry/interface/TypeInfoHolder.h deleted file mode 100644 index f09e6d65b49fb..0000000000000 --- a/FWCore/ServiceRegistry/interface/TypeInfoHolder.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef ServiceRegistry_TypeInfoHolder_h -#define ServiceRegistry_TypeInfoHolder_h - -#include -// -*- C++ -*- -// -// Package: ServiceRegistry -// Class : TypeInfoHolder -// -/**\class TypeInfoHolder TypeInfoHolder.h FWCore/ServiceRegistry/interface/TypeInfoHolder.h - - Description: wrapper to allow std::type_info to be used as a key to a std::map - - Usage: - - -*/ -// -// Original Author: Chris Jones -// Created: Mon Sep 5 14:38:42 EDT 2005 -// - -// system include files - -// user include files - -// forward declarations -namespace edm { - namespace serviceregistry { - - class TypeInfoHolder { - public: - TypeInfoHolder(const std::type_info& iInfo) : m_info(iInfo) {} - const std::type_info& info() const { return m_info;} - - bool operator<(const TypeInfoHolder& iRHS) const { - return m_info.before(iRHS.m_info) ; - } - private: - const std::type_info& m_info; - }; - } -} - -#endif diff --git a/GeneratorInterface/TauolaInterface/interface/TauolaWrapper.h b/GeneratorInterface/TauolaInterface/interface/TauolaWrapper.h deleted file mode 100644 index 9a998a1a68c58..0000000000000 --- a/GeneratorInterface/TauolaInterface/interface/TauolaWrapper.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef gen_ExternalDecays_TauolaWrapper_h -#define gen_ExternalDecays_TauolaWrapper_h - -/********** TauolaWrapper - * - * Wrapper to Fortran functions in TAUOLA tau decay library - * - * Christian Veelken - * 04/17/07 - * - * Modified to contain access to individual decays (COMMON TAUBRA), and - * force polarization like in case of particle gun taus (SUBROUTINE DEXAY - * and COMMON MOMDEC) - * 23.2.2009/S.Lehti - * - * Modified to remove everything related to pythia6 or pretauola; - * all pythia6-related functionalities and/or ties are moving back - * to Pythia6Interface; - * the concept will ensure transparent use of Tauola with ANY - * multi-purpose generator - * J.V.Yarba, Feb.26, 2009 - * - ***************************************/ - -// -//------------------------------------------------------------------------------- -// - -// main function(s) of TAUOLA/pretauola tau decay library - -extern "C" { - void tauola_(int*, int*); - void tauola_srs_(int*,int*); - void taurep_(int*); - void ranmar_(float*,int*); - void rmarin_(int*, int*, int*); -} -#define tauola tauola_ - -void inline call_tauola (int mode, int polarization) { tauola(&mode, &polarization); } - -extern "C" { - extern void dexay_(int*, float[4]); -} -#define dexay dexay_ - -void inline call_dexay (int mode, float polarization[4]) { dexay(&mode, polarization); } - -// -//------------------------------------------------------------------------------- -// - -// common block with steering parameters for CMS specific Fortran interface to TAUOLA - -extern "C" { - extern struct { - int pjak1; - int pjak2; - int mdtau; - } ki_taumod_; -} -#define ki_taumod ki_taumod_ - -extern "C" { - extern struct { - int jak1; - int jak2; - int itdkrc; - int ifphot; - int ifhadm; - int ifhadp; - } libra_ ; -} -#define libra libra_ - -extern "C" { - extern struct { - float gamprt[30]; - int jlist[30]; - int nchan; - } taubra_; -} -#define taubra taubra_ - -extern "C" { - extern struct { - double q1[4]; - double q2[4]; - double p1[4]; - double p2[4]; - double p3[4]; - double p4[4]; - } momdec_; -} -#define momdec momdec_ - -extern "C" { - extern struct { - int np1; - int np2; - } taupos_; -} -#define taupos taupos_ - -#endif diff --git a/HeavyFlavorAnalysis/SpecificDecay/interface/BPHMuonChargeSelect.h b/HeavyFlavorAnalysis/SpecificDecay/interface/BPHMuonChargeSelect.h deleted file mode 100644 index 3f7d574ed79fc..0000000000000 --- a/HeavyFlavorAnalysis/SpecificDecay/interface/BPHMuonChargeSelect.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef HeavyFlavorAnalysis_SpecificDecay_BPHMuonChargeSelect_h -#define HeavyFlavorAnalysis_SpecificDecay_BPHMuonChargeSelect_h -/** \class BPHMuonChargeSelect - * - * Description: - * Class for muon selection by charge - * - * \author Paolo Ronchese INFN Padova - * - */ - -//---------------------- -// Base Class Headers -- -//---------------------- -#include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleChargeSelect.h" - -//------------------------------------ -// Collaborating Class Declarations -- -//------------------------------------ -#include "DataFormats/PatCandidates/interface/Muon.h" - -//--------------- -// C++ Headers -- -//--------------- - -// --------------------- -// -- Class Interface -- -// --------------------- - -class BPHMuonChargeSelect : public BPHParticleChargeSelect { -public: - /** Constructor - */ - BPHMuonChargeSelect(int c) : BPHParticleChargeSelect(c) {} - - // deleted copy constructor and assignment operator - BPHMuonChargeSelect(const BPHMuonChargeSelect& x) = delete; - BPHMuonChargeSelect& operator=(const BPHMuonChargeSelect& x) = delete; - - /** Destructor - */ - ~BPHMuonChargeSelect() override {} - - /** Operations - */ - /// select muon - bool accept(const reco::Candidate& cand) const override { - if (dynamic_cast(&cand) == nullptr) - return false; - return BPHParticleChargeSelect::accept(cand); - }; -}; - -#endif diff --git a/HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleChargeSelect.h b/HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleChargeSelect.h deleted file mode 100644 index e85f05677bad2..0000000000000 --- a/HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleChargeSelect.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef HeavyFlavorAnalysis_SpecificDecay_BPHParticleChargeSelect_h -#define HeavyFlavorAnalysis_SpecificDecay_BPHParticleChargeSelect_h -/** \class BPHParticleChargeSelect - * - * Description: - * Class for particle selection by charge - * - * \author Paolo Ronchese INFN Padova - * - */ - -//---------------------- -// Base Class Headers -- -//---------------------- -#include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoSelect.h" - -//------------------------------------ -// Collaborating Class Declarations -- -//------------------------------------ -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -//--------------- -// C++ Headers -- -//--------------- - -// --------------------- -// -- Class Interface -- -// --------------------- - -class BPHParticleChargeSelect : public BPHRecoSelect { -public: - /** Constructor - */ - BPHParticleChargeSelect(int c) : charge(c ? (c > 0 ? 1 : -1) : 0) {} - - // deleted copy constructor and assignment operator - BPHParticleChargeSelect(const BPHParticleChargeSelect& x) = delete; - BPHParticleChargeSelect& operator=(const BPHParticleChargeSelect& x) = delete; - - /** Destructor - */ - ~BPHParticleChargeSelect() override {} - - /** Operations - */ - /// select particle - bool accept(const reco::Candidate& cand) const override { - switch (charge) { - default: - case 0: - return (cand.charge() != 0); - case 1: - return (cand.charge() > 0); - case -1: - return (cand.charge() < 0); - } - return true; - }; - - /// set selection charge - void setCharge(int c) { - charge = (c ? (c > 0 ? 1 : -1) : 0); - return; - } - - /// get selection charge - double getCharge() const { return charge; } - -private: - int charge; -}; - -#endif diff --git a/IOPool/Common/interface/CustomStreamer.h b/IOPool/Common/interface/CustomStreamer.h deleted file mode 100644 index 5f07f3e7fd904..0000000000000 --- a/IOPool/Common/interface/CustomStreamer.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef IOPool_Common_CustomStreamer_h -#define IOPool_Common_CustomStreamer_h - -#include -#include "TClass.h" -#include "TClassStreamer.h" -#include "TClassRef.h" -#include "FWCore/Utilities/interface/TypeID.h" -#include "TBuffer.h" - -namespace edm { - template - class CustomStreamer : public TClassStreamer { - public: - typedef T element_type; - CustomStreamer(); - void operator() (TBuffer &R__b, void *objp); - private: - std::string className_; - TClassRef cl_; - }; - - template - CustomStreamer::CustomStreamer() : - className_(TypeID(typeid(T)).className()), - cl_(className_.c_str()) - {} - - template - void - CustomStreamer::operator()(TBuffer &R__b, void *objp) { - if (R__b.IsReading()) { - cl_->ReadBuffer(R__b, objp); - } else { - cl_->WriteBuffer(R__b, objp); - } - } - - template - void - SetCustomStreamer() { - TClass *cl = TClass::GetClass(typeid(T)); - if (cl->GetStreamer() == 0) { - cl->AdoptStreamer(new CustomStreamer()); - } - } - - template - void - SetCustomStreamer(T const&) { - TClass *cl = TClass::GetClass(typeid(T)); - if (cl->GetStreamer() == 0) { - cl->AdoptStreamer(new CustomStreamer()); - } - } -} - -#endif diff --git a/JetMETCorrections/InterpolationTables/interface/BoxNDScanner.h b/JetMETCorrections/InterpolationTables/interface/BoxNDScanner.h deleted file mode 100644 index 44d32c6b037da..0000000000000 --- a/JetMETCorrections/InterpolationTables/interface/BoxNDScanner.h +++ /dev/null @@ -1,172 +0,0 @@ -#ifndef NPSTAT_BOXNDSCANNER_HH_ -#define NPSTAT_BOXNDSCANNER_HH_ - -/*! -// \file BoxNDScanner.h -// -// \brief Iteration over uniformly spaced coordinates inside -// a multidimensional box -// -// Author: I. Volobouev -// -// March 2010 -*/ - -#include "JetMETCorrections/InterpolationTables/interface/BoxND.h" - -namespace npstat { - /** - * A class for iterating over all coordinates in a multidimensional box - * (but not a full-fledeged iterator). The expected usage pattern is as - * follows: - * - * @code - * double* coords = ... (the buffer size should be at least box.dim()) - * for (BoxNDScanner scan(box,shape); scan.isValid(); ++scan) - * { - * scan.getCoords(coords, coordsBufferSize); - * .... Do what is necessary with coordinates .... - * .... Extract linear bin number: .............. - * scan.state(); - * } - * @endcode - * - * The coordinates will be in the middle of the bins (imagine - * a multivariate histogram with boundaries defined by the given box). - */ - template - class BoxNDScanner - { - public: - //@{ - /** - // Constructor from a bounding box and a multidimensional - // array shape - */ - inline BoxNDScanner(const BoxND& box, - const std::vector& shape) - : box_(box), state_(0UL) - {initialize(shape.empty() ? static_cast(0) : - &shape[0], shape.size());} - - inline BoxNDScanner(const BoxND& box, - const unsigned* shape, const unsigned lenShape) - : box_(box), state_(0UL) {initialize(shape, lenShape);} - //@} - - /** Dimensionality of the scan */ - inline unsigned dim() const {return box_.dim();} - - /** Retrieve current state (i.e., linear index of the scan) */ - inline unsigned long state() const {return state_;} - - /** Maximum possible state (i.e., linear index of the scan) */ - inline unsigned long maxState() const {return maxState_;} - - /** Returns false when iteration is complete */ - inline bool isValid() const {return state_ < maxState_;} - - /** Retrieve current coordinates inside the box */ - void getCoords(Numeric* x, unsigned nx) const; - - /** Retrieve current multidimensional index */ - void getIndex(unsigned* index, unsigned indexBufferLen) const; - - /** Reset the state (as if the object has just been constructed) */ - inline void reset() {state_ = 0UL;} - - /** Prefix increment */ - inline BoxNDScanner& operator++() - {if (state_ < maxState_) ++state_; return *this;} - - /** Postfix increment (distinguished by the dummy "int" parameter) */ - inline void operator++(int) {if (state_ < maxState_) ++state_;} - - /** Set the state directly */ - inline void setState(const unsigned long state) - {state_ = state <= maxState_ ? state : maxState_;} - - private: - BoxNDScanner(); - - void initialize(const unsigned* shape, unsigned lenShape); - - BoxND box_; - std::vector strides_; - std::vector bw_; - unsigned long state_; - unsigned long maxState_; - }; -} - -#include -#include "JetMETCorrections/InterpolationTables/interface/NpstatException.h" - -namespace npstat { - template - void BoxNDScanner::initialize(const unsigned* shape, - const unsigned dim) - { - if (!(dim && box_.dim() == dim)) throw npstat::NpstatInvalidArgument( - "In npstat::BoxNDScanner::initialize: incompatible scan shape"); - assert(shape); - for (unsigned j=0; j0; --j) - strides_[j - 1] = strides_[j]*shape[j]; - maxState_ = strides_[0]*shape[0]; - - bw_.reserve(dim); - for (unsigned j=0; j - void BoxNDScanner::getCoords(Numeric* x, const unsigned nx) const - { - const unsigned dim = strides_.size(); - if (nx < dim) throw npstat::NpstatInvalidArgument( - "In npstat::BoxNDScanner::getCoords: " - "insufficient length of the output buffer"); - if (state_ >= maxState_) throw npstat::NpstatRuntimeError( - "In npstat::BoxNDScanner::getCoords: invalid scanner state"); - assert(x); - - unsigned long l = state_; - for (unsigned i=0; i - void BoxNDScanner::getIndex(unsigned* ix, const unsigned nx) const - { - const unsigned dim = strides_.size(); - if (nx < dim) throw npstat::NpstatInvalidArgument( - "In npstat::BoxNDScanner::getIndex: " - "insufficient length of the output buffer"); - if (state_ >= maxState_) throw npstat::NpstatRuntimeError( - "In npstat::BoxNDScanner::getIndex: invalid scanner state"); - assert(ix); - - unsigned long l = state_; - for (unsigned i=0; i(idx); - l -= (idx * strides_[i]); - } - } -} - - -#endif // NPSTAT_BOXNDSCANNER_HH_ - diff --git a/JetMETCorrections/InterpolationTables/interface/MultivariateFunctorScanner.h b/JetMETCorrections/InterpolationTables/interface/MultivariateFunctorScanner.h deleted file mode 100644 index c34494d45b63e..0000000000000 --- a/JetMETCorrections/InterpolationTables/interface/MultivariateFunctorScanner.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef NPSTAT_MULTIVARIATEFUNCTORSCANNER_HH_ -#define NPSTAT_MULTIVARIATEFUNCTORSCANNER_HH_ - -/*! -// \file MultivariateFunctorScanner.h -// -// \brief Adapts any AbsMultivariateFunctor for use with ArrayND method -// "functorFill" -// -// Author: I. Volobouev -// -// July 2012 -*/ - -#include -#include -#include "JetMETCorrections/InterpolationTables/interface/NpstatException.h" - -#include "JetMETCorrections/InterpolationTables/interface/AbsMultivariateFunctor.h" - -namespace npstat { - /** - // This class adapts an object derived from AbsMultivariateFunctor - // so that it can be used with ArrayND method "functorFill" and such - */ - template - class MultivariateFunctorScanner - { - public: - /** - // A mapper for each coordinate in the "maps" argument will - // convert the array index into a proper argument for the scanned - // density. - // - // This functor will NOT make copies of either "fcn" or "maps" - // parameters. These parameters will be used by reference only - // (aliased). It is up to the user of this class to ensure proper - // lifetime of these objects. - */ - inline MultivariateFunctorScanner(const AbsMultivariateFunctor& fcn, - const std::vector& maps) - : fcn_(fcn), mapping_(maps), buf_(fcn.minDim()), dim_(fcn.minDim()) - { - if (!(dim_ && dim_ == maps.size())) throw npstat::NpstatInvalidArgument( - "In npstat::MultivariateFunctorScanner constructor: " - "incompatible arguments"); - if (dim_ != fcn.maxDim()) throw npstat::NpstatInvalidArgument( - "In npstat::MultivariateFunctorScanner constructor: " - "functors of variable dimensionality are not supported"); - } - - /** Calculate the functor value for the given array indices */ - inline double operator()(const unsigned* index, - const unsigned indexLen) const - { - if (dim_ != indexLen) throw npstat::NpstatInvalidArgument( - "In npstat::MultivariateFunctorScanner::operator(): " - "incompatible input point dimensionality"); - assert(index); - double* x = &buf_[0]; - for (unsigned i=0; i& mapping_; - mutable std::vector buf_; - unsigned dim_; - }; -} - -#endif // NPSTAT_MULTIVARIATEFUNCTORSCANNER_HH_ - diff --git a/JetMETCorrections/InterpolationTables/interface/rescanArray.h b/JetMETCorrections/InterpolationTables/interface/rescanArray.h deleted file mode 100644 index 08742b7113908..0000000000000 --- a/JetMETCorrections/InterpolationTables/interface/rescanArray.h +++ /dev/null @@ -1,122 +0,0 @@ -#ifndef NPSTAT_RESCANARRAY_HH_ -#define NPSTAT_RESCANARRAY_HH_ - -/*! -// \file rescanArray.h -// -// \brief Fill a multidimensional array using values from another array -// with a different shape -// -// Author: I. Volobouev -// -// October 2010 -*/ - -#include "JetMETCorrections/InterpolationTables/interface/ArrayND.h" - -namespace npstat { - /** - // A utility for filling one array using values of another. The - // array shapes do not have to be the same but the ranks have to be. - // Roughly, the arrays are treated as values of histogram bins inside - // the unit box. The array "to" is filled either with the closest bin - // value of the array "from" or with an interpolated value (if - // "interpolationDegree" parameter is not 0). - // - // interpolationDegree parameter must be one of 0, 1, or 3. - */ - template - void rescanArray(const ArrayND& from, - ArrayND* to, - unsigned interpolationDegree=0); -} - -#include -#include "JetMETCorrections/InterpolationTables/interface/NpstatException.h" - -#include "JetMETCorrections/InterpolationTables/interface/LinearMapper1d.h" - -namespace npstat { - namespace Private { - template - class ArrayMapper - { - public: - ArrayMapper(const ArrayND& from, - const ArrayND& to, - const unsigned interpolationDegree) - : mapped_(from.rank()), - from_(from), - dim_(from.rank()), - ideg_(interpolationDegree) - { - assert(dim_ == to.rank()); - if (dim_) - { - mappers_.reserve(dim_); - for (unsigned i=0; i mappers_; - mutable std::vector mapped_; - const ArrayND& from_; - unsigned dim_; - unsigned ideg_; - }; - } - - template - void rescanArray(const ArrayND& from, - ArrayND* to, - const unsigned interpolationDegree) - { - assert(to); - if (from.rank() != to->rank()) throw npstat::NpstatInvalidArgument( - "In npstat::rescanArray: incompatible dimensionalities " - "of input and output arrays"); - if (!(interpolationDegree == 0U || - interpolationDegree == 1U || - interpolationDegree == 3U)) throw npstat::NpstatInvalidArgument( - "In npstat::rescanArray: unsupported interpolation degree"); - to->functorFill(Private::ArrayMapper( - from, *to, interpolationDegree)); - } -} - - -#endif // NPSTAT_RESCANARRAY_HH_ - diff --git a/JetMETCorrections/Type1MET/interface/CorrectedMETProducerT.h b/JetMETCorrections/Type1MET/interface/CorrectedMETProducerT.h deleted file mode 100644 index 298d28b228224..0000000000000 --- a/JetMETCorrections/Type1MET/interface/CorrectedMETProducerT.h +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef JetMETCorrections_Type1MET_CorrectedMETProducer_h -#define JetMETCorrections_Type1MET_CorrectedMETProducer_h - -/** \class CorrectedMETProducerT - * - * Produce MET collections with Type 1 / Type 1 + 2 corrections applied - * - * NOTE: This file defines the generic template. - * Concrete instances for CaloMET and PFMET are defined in - * JetMETCorrections/Type1MET/plugins/CorrectedCaloMETProducer.cc - * JetMETCorrections/Type1MET/plugins/CorrectedPFMETProducer.cc - * - * \authors Michael Schmitt, Richard Cavanaugh, The University of Florida - * Florent Lacroix, University of Illinois at Chicago - * Christian Veelken, LLR - * - * - * - */ - -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" - -#include "JetMETCorrections/Type1MET/interface/METCorrectionAlgorithm.h" -#include "DataFormats/METReco/interface/CorrMETData.h" -#include "DataFormats/Candidate/interface/Candidate.h" - -#include "HLTrigger/HLTcore/interface/defaultModuleLabel.h" - -#include - -namespace CorrectedMETProducer_namespace { - template - reco::Candidate::LorentzVector correctedP4(const T& rawMEt, const CorrMETData& correction) { - double correctedMEtPx = rawMEt.px() + correction.mex; - double correctedMEtPy = rawMEt.py() + correction.mey; - double correctedMEtPt = sqrt(correctedMEtPx * correctedMEtPx + correctedMEtPy * correctedMEtPy); - return reco::Candidate::LorentzVector(correctedMEtPx, correctedMEtPy, 0., correctedMEtPt); - } - - template - double correctedSumEt(const T& rawMEt, const CorrMETData& correction) { - return rawMEt.sumEt() + correction.sumet; - } - - template - class CorrectedMETFactoryT { - public: - T operator()(const T&, const CorrMETData&) const { - assert(0); // "place-holder" for template instantiations for concrete T types only, **not** to be called - } - }; -} // namespace CorrectedMETProducer_namespace - -template -class CorrectedMETProducerT : public edm::stream::EDProducer<> { - typedef std::vector METCollection; - -public: - explicit CorrectedMETProducerT(const edm::ParameterSet& cfg) - : moduleLabel_(cfg.getParameter("@module_label")), algorithm_(0) { - token_ = consumes(cfg.getParameter("src")); - - algorithm_ = new METCorrectionAlgorithm(cfg, consumesCollector()); - - produces(""); - } - ~CorrectedMETProducerT() { delete algorithm_; } - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - edm::ParameterSetDescription desc; - desc.add("src", edm::InputTag("corrPfMetType1", "type1")); - descriptions.add(defaultModuleLabel >(), desc); - } - -private: - void produce(edm::Event& evt, const edm::EventSetup& es) { - std::unique_ptr correctedMEtCollection(new METCollection); - - edm::Handle rawMEtCollection; - evt.getByToken(token_, rawMEtCollection); - - for (typename METCollection::const_iterator rawMEt = rawMEtCollection->begin(); rawMEt != rawMEtCollection->end(); - ++rawMEt) { - CorrMETData correction = algorithm_->compMETCorrection(evt); - - static const CorrectedMETProducer_namespace::CorrectedMETFactoryT correctedMET_factory{}; - T correctedMEt = correctedMET_factory(*rawMEt, correction); - - correctedMEtCollection->push_back(correctedMEt); - } - - //--- add collection of MET objects with Type 1 / Type 1 + 2 corrections applied to the event - evt.put(std::move(correctedMEtCollection)); - } - - std::string moduleLabel_; - - edm::EDGetTokenT token_; - - METCorrectionAlgorithm* algorithm_; // algorithm for computing Type 1 / Type 1 + 2 MET corrections -}; - -#endif diff --git a/L1Trigger/DTSectorCollector/interface/DTSCCand.h b/L1Trigger/DTSectorCollector/interface/DTSCCand.h deleted file mode 100644 index 3f7a616799466..0000000000000 --- a/L1Trigger/DTSectorCollector/interface/DTSCCand.h +++ /dev/null @@ -1,123 +0,0 @@ -//------------------------------------------------- -// -// \class: DTSC.h -/** - * Implementation of Sector Collector trigger algorithm - * - * - * - * \author D. Bonacorsi, S. Marcellini - */ -// -//-------------------------------------------------- -#ifndef DT_SC_H -#define DT_SC_H - -//------------------------------------ -// Collaborating Class Declarations -- -//------------------------------------ -class DTTracoTrigData; -class DTTSCand; -class DTConfigSectColl; -// added DBSM -class DTTrigGeom; - -//---------------------- -// Base Class Headers -- -//---------------------- -// added DBSM -#include "L1Trigger/DTUtilities/interface/DTGeomSupplier.h" - -//--------------- -// C++ Headers -- -//--------------- -#include - -// --------------------- -// -- Class Interface -- -// --------------------- - - -class DTSC{ - - public: - - //! Constructor - DTSC(DTConfigSectColl*); - - //! Destructor - ~DTSC(); - - // non-const methods - - //! Add a TSM candidate to the Sect Coll, ifs is first/second track flag - void addCand(DTTSCand* cand); - - //! Set a flag to skip sort2 - void ignoreSecondTrack() { _ignoreSecondTrack=1; } - - //! Run the Sector Collector algorithm - void run(); - - //! Sort 1 - DTTSCand* DTSectCollsort1(); - - //! Sort 2 - DTTSCand* DTSectCollsort2(); - - //! Clear - void clear(); - - // const methods - - //! Configuration set - inline DTConfigSectColl* config() const { return _config; } - - //! Return the number of input tracks (first/second) - unsigned nCand(int ifs) const; - - //! Return the number of input first tracks - inline int nFirstT() const { return _incand[0].size(); } - - //! Return the number of input second tracks - inline int nSecondT() const { return _incand[1].size(); } - - //! Return requested TSS candidate - DTTSCand* getDTTSCand(int ifs, unsigned n) const; - - //! Return requested TRACO trigger - const DTTracoTrigData* getTracoT(int ifs, unsigned n) const; - - //! Return the number of sorted tracks - inline int nTracks() const { return _outcand.size(); } - - //! Return the requested track - DTTSCand* getTrack(int n) const ; - - - private: - - // Configuration - DTConfigSectColl* _config; - - // input data - std::vector _incand[2]; - - // output data - std::vector _outcand; - - // internal use variables - int _ignoreSecondTrack; - - -}; -#endif - - - - - - - - - diff --git a/L1Trigger/GlobalCaloTrigger/interface/L1GctSimpleJetFinder.h b/L1Trigger/GlobalCaloTrigger/interface/L1GctSimpleJetFinder.h deleted file mode 100644 index 35fa1897822ac..0000000000000 --- a/L1Trigger/GlobalCaloTrigger/interface/L1GctSimpleJetFinder.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef L1GCTSIMPLEJETFINDER_H_ -#define L1GCTSIMPLEJETFINDER_H_ - -#include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetFinderBase.h" - -#include - -/*! \class L1GctSimpleJetFinder - * \brief simple jet finder for test purposes. - * - * Currently returns no jets - * The intention is to return local maxima (without clustering) - * - */ -/* - * \author Greg Heath - * \date June 2006 - */ - -class L1GctSimpleJetFinder : public L1GctJetFinderBase { -public: - /// id is 0-8 for -ve Eta jetfinders, 9-17 for +ve Eta, for increasing Phi. - L1GctSimpleJetFinder(int id); - - ~L1GctSimpleJetFinder(); - - /// Overload << operator - friend std::ostream& operator<<(std::ostream& os, const L1GctSimpleJetFinder& algo); - - /// get input data from sources - virtual void fetchInput(); - - /// process the data, fill output buffers - virtual void process(); - -protected: - // Each jetFinder must define the constants as private and copy the - // function definitions below. - virtual unsigned maxRegionsIn() const { return MAX_REGIONS_IN; } - virtual unsigned centralCol0() const { return CENTRAL_COL0; } - virtual unsigned nCols() const { return N_COLS; } - -private: - /// The real jetFinders must define these constants - static const unsigned int MAX_REGIONS_IN; ///< Dependent on number of rows and columns. - static const unsigned int N_COLS; - static const unsigned int CENTRAL_COL0; - - void findJets(); -}; - -std::ostream& operator<<(std::ostream& os, const L1GctSimpleJetFinder& algo); - -#endif /*L1GCTSIMPLEJETFINDER_H_*/ diff --git a/L1Trigger/L1TCalorimeter/interface/classes.h b/L1Trigger/L1TCalorimeter/interface/classes.h deleted file mode 100644 index 5c23744bb10d3..0000000000000 --- a/L1Trigger/L1TCalorimeter/interface/classes.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * ======================================================================== - * - * Description: Define dataformats for L1RecoMatch, L1 Global object. - * - * ======================================================================== - */ - -#include "L1Trigger/L1TCalorimeter/interface/L1RecoMatch.h" -#include "L1Trigger/L1TCalorimeter/interface/L1GObject.h" - -namespace { - - L1RecoMatch dummyMatch; - L1GObject dummyL1G; - std::vector dummyL1GCollection; - edm::Wrapper > dummyL1GWrapper; - -} diff --git a/L1Trigger/L1TMuonOverlap/interface/OMTFConfigurator.h b/L1Trigger/L1TMuonOverlap/interface/OMTFConfigurator.h deleted file mode 100644 index 82bd4a5d7c64f..0000000000000 --- a/L1Trigger/L1TMuonOverlap/interface/OMTFConfigurator.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef OMTF_OMTFConfigurator_H -#define OMTF_OMTFConfigurator_H - -#include "xercesc/dom/DOM.hpp" - - -////////////////////////////////// -// OMTFConfigurator -////////////////////////////////// -class OMTFConfigurator{ - - public: - - - private: - -}; - - -////////////////////////////////// -////////////////////////////////// - - - -#endif diff --git a/L1Trigger/L1TMuonOverlap/interface/OMTFPatternMaker.h b/L1Trigger/L1TMuonOverlap/interface/OMTFPatternMaker.h deleted file mode 100644 index 60898ad2a730e..0000000000000 --- a/L1Trigger/L1TMuonOverlap/interface/OMTFPatternMaker.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef OMTF_OMTFPaternMaker_H -#define OMTF_OMTFPaternMaker_H - -#include - -#include "L1Trigger/L1TMuonOverlap/interface/GoldenPattern.h" - -class OMTFConfiguration; -class XMLConfigReader; -class OMTFinput; - -namespace edm{ -class ParameterSet; -} - -class OMTFPaternMaker{ - - public: - - OMTFPaternMaker(const edm::ParameterSet & cfg); - - ~OMTFPaternMaker(); - - private: - - ///Map holding Golden Patterns - std::map theGPs; - -}; - - -#endif diff --git a/L1Trigger/L1TNtuples/interface/L1AnalysisRecoTrackBase.h b/L1Trigger/L1TNtuples/interface/L1AnalysisRecoTrackBase.h deleted file mode 100644 index 2f19f4a6b092c..0000000000000 --- a/L1Trigger/L1TNtuples/interface/L1AnalysisRecoTrackBase.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef __L1Analysis_L1AnalysisRecoTrackBase_H__ -#define __L1Analysis_L1AnalysisRecoTrackBase_H__ - - -namespace L1Analysis -{ - class L1AnalysisRecoTrackBase - { - public : - unsigned nTrk; - unsigned nHighPurity; - double fHighPurity; - }; -} -#endif - - diff --git a/L1TriggerOffline/L1Analyzer/interface/L1PromptAnalysis.h b/L1TriggerOffline/L1Analyzer/interface/L1PromptAnalysis.h deleted file mode 100644 index d6d29a3eef1a6..0000000000000 --- a/L1TriggerOffline/L1Analyzer/interface/L1PromptAnalysis.h +++ /dev/null @@ -1,288 +0,0 @@ - -//------------------------------------------------- -// -// \class L1PromptAnalysis -/** - * Description: This code is designed for l1 prompt analysis -// starting point is a GMTTreeMaker By Ivan Mikulec. -*/ -// -// I. Mikulec HEPHY Vienna -// -//-------------------------------------------------- -#ifndef L1_PROMPT_ANALYSIS_H -#define L1_PROMPT_ANALYSIS_H - -//--------------- -// C++ Headers -- -//--------------- - -#include -#include - -//---------------------- -// Base Class Headers -- -//---------------------- -#include "FWCore/Framework/interface/EDAnalyzer.h" - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/Event.h" -#include "DataFormats/Common/interface/Handle.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -//------------------------------------ -// Collaborating Class Declarations -- -//------------------------------------ - -#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h" -#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h" -#include "FWCore/Utilities/interface/InputTag.h" - -class TFile; -class TTree; - -// --------------------- -// -- Class Interface -- -// --------------------- - -const int MAXGEN = 20; -const int MAXRPC = 12; -const int MAXDTBX = 12; -const int MAXCSC = 12; -const int MAXGMT = 12; -const int MAXGT = 12; -const int MAXRCTREG = 400; -const int MAXDTPH = 50; -const int MAXDTTH = 50; -const int MAXDTTR = 50; - -class L1PromptAnalysis : public edm::EDAnalyzer { -public: - // constructor - explicit L1PromptAnalysis(const edm::ParameterSet&); - virtual ~L1PromptAnalysis(); - - // fill tree - virtual void analyze(const edm::Event&, const edm::EventSetup&); - void book(); - - virtual void beginJob(); - virtual void endJob(); - -private: - //GENERAL block - int runn; - int eventn; - int lumi; - int bx; - uint64_t orbitn; - uint64_t timest; - - // Generator info - float weight; - float pthat; - - // simulation block - int ngen; - float pxgen[MAXGEN]; - float pygen[MAXGEN]; - float pzgen[MAXGEN]; - float ptgen[MAXGEN]; - float etagen[MAXGEN]; - float phigen[MAXGEN]; - int chagen[MAXGEN]; - float vxgen[MAXGEN]; - float vygen[MAXGEN]; - float vzgen[MAXGEN]; - int pargen[MAXGEN]; - - // GMT data - int bxgmt; - - //DTBX Trigger block - int ndt; - int bxd[MAXDTBX]; - float ptd[MAXDTBX]; - int chad[MAXDTBX]; - float etad[MAXDTBX]; - int etafined[MAXDTBX]; - float phid[MAXDTBX]; - int quald[MAXDTBX]; - int dwd[MAXDTBX]; - int chd[MAXDTBX]; - - //CSC Trigger block - int ncsc; - int bxc[MAXCSC]; - float ptc[MAXCSC]; - int chac[MAXCSC]; - float etac[MAXCSC]; - float phic[MAXCSC]; - int qualc[MAXCSC]; - int dwc[MAXCSC]; - - //RPCb Trigger - int nrpcb; - int bxrb[MAXRPC]; - float ptrb[MAXRPC]; - int charb[MAXRPC]; - float etarb[MAXRPC]; - float phirb[MAXRPC]; - int qualrb[MAXRPC]; - int dwrb[MAXRPC]; - - //RPCf Trigger - int nrpcf; - int bxrf[MAXRPC]; - float ptrf[MAXRPC]; - int charf[MAXRPC]; - float etarf[MAXRPC]; - float phirf[MAXRPC]; - int qualrf[MAXRPC]; - int dwrf[MAXRPC]; - - //Global Muon Trigger - int ngmt; - int bxg[MAXGMT]; - float ptg[MAXGMT]; - int chag[MAXGMT]; - float etag[MAXGMT]; - float phig[MAXGMT]; - int qualg[MAXGMT]; - int detg[MAXGMT]; - int rankg[MAXGMT]; - int isolg[MAXGMT]; - int mipg[MAXGMT]; - int dwg[MAXGMT]; - int idxRPCb[MAXGMT]; - int idxRPCf[MAXGMT]; - int idxDTBX[MAXGMT]; - int idxCSC[MAXGMT]; - - // GT info - uint64_t gttw1[3]; - uint64_t gttw2[3]; - uint64_t gttt[3]; - - //PSB info - int nele; - int bxel[MAXGT]; - float rankel[MAXGT]; - float phiel[MAXGT]; - float etael[MAXGT]; - - int njet; - int bxjet[MAXGT]; - float rankjet[MAXGT]; - float phijet[MAXGT]; - float etajet[MAXGT]; - - //GCT - edm::InputTag gctCenJetsSource_; - edm::InputTag gctForJetsSource_; - edm::InputTag gctTauJetsSource_; - edm::InputTag gctEnergySumsSource_; - edm::InputTag gctIsoEmSource_; - edm::InputTag gctNonIsoEmSource_; - - int gctIsoEmSize; - float gctIsoEmEta[4]; - float gctIsoEmPhi[4]; - float gctIsoEmRnk[4]; - int gctNonIsoEmSize; - float gctNonIsoEmEta[4]; - float gctNonIsoEmPhi[4]; - float gctNonIsoEmRnk[4]; - int gctCJetSize; - float gctCJetEta[4]; - float gctCJetPhi[4]; - float gctCJetRnk[4]; - int gctFJetSize; - float gctFJetEta[4]; - float gctFJetPhi[4]; - float gctFJetRnk[4]; - int gctTJetSize; - float gctTJetEta[4]; - float gctTJetPhi[4]; - float gctTJetRnk[4]; - float gctEtMiss; - float gctEtMissPhi; - float gctEtHad; - float gctEtTot; - int gctHFRingEtSumSize; - float gctHFRingEtSumEta[4]; - float gctHFBitCountsSize; - float gctHFBitCountsEta[4]; - // RCT - - edm::InputTag rctSource_; - int rctRegSize; - float rctRegEta[MAXRCTREG]; - float rctRegPhi[MAXRCTREG]; - float rctRegRnk[MAXRCTREG]; - int rctRegVeto[MAXRCTREG]; - int rctRegBx[MAXRCTREG]; - int rctRegOverFlow[MAXRCTREG]; - int rctRegMip[MAXRCTREG]; - int rctRegFGrain[MAXRCTREG]; - int rctEmSize; - int rctIsIsoEm[MAXRCTREG]; - float rctEmEta[MAXRCTREG]; - float rctEmPhi[MAXRCTREG]; - float rctEmRnk[MAXRCTREG]; - int rctEmBx[MAXRCTREG]; - - // DTTF - edm::InputTag dttfSource_; - - int dttf_phSize; - int dttf_phBx[MAXDTPH]; - int dttf_phWh[MAXDTPH]; - int dttf_phSe[MAXDTPH]; - int dttf_phSt[MAXDTPH]; - float dttf_phAng[MAXDTPH]; - float dttf_phBandAng[MAXDTPH]; - int dttf_phCode[MAXDTPH]; - float dttf_phX[MAXDTPH]; - float dttf_phY[MAXDTPH]; - - int dttf_thSize; - int dttf_thBx[MAXDTTH]; - int dttf_thWh[MAXDTTH]; - int dttf_thSe[MAXDTTH]; - int dttf_thSt[MAXDTTH]; - float dttf_thX[MAXDTTH]; - float dttf_thY[MAXDTTH]; - float dttf_thTheta[MAXDTTH][7]; - int dttf_thCode[MAXDTTH][7]; - - int dttf_trSize; - int dttf_trBx[MAXDTTR]; - int dttf_trTag[MAXDTTR]; - int dttf_trQual[MAXDTTR]; - int dttf_trPtPck[MAXDTTR]; - float dttf_trPtVal[MAXDTTR]; - int dttf_trPhiPck[MAXDTTR]; - float dttf_trPhiVal[MAXDTTR]; - int dttf_trPhiGlob[MAXDTTR]; - int dttf_trChPck[MAXDTTR]; - int dttf_trWh[MAXDTTR]; - int dttf_trSc[MAXDTTR]; - /// - - TFile* m_file; - TTree* m_tree; - - edm::InputTag m_GMTInputTag; - edm::InputTag m_GTEvmInputTag; - edm::InputTag m_GTInputTag; - edm::InputTag m_GeneratorInputTag; - edm::InputTag m_SimulationInputTag; - - bool m_PhysVal; - bool verbose_; - std::string m_outfilename; -}; - -#endif diff --git a/MagneticField/Engine/interface/MagneticFieldHelpers.h b/MagneticField/Engine/interface/MagneticFieldHelpers.h deleted file mode 100644 index 06beec5d40985..0000000000000 --- a/MagneticField/Engine/interface/MagneticFieldHelpers.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef MagneticFieldHelpers_h -#define MagneticFieldHelpers_h - -// #include "CondFormats/RunInfo/interface/RunInfo.h" -// #include "CondFormats/DataRecord/interface/RunSummaryRcd.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" - -namespace magneticFieldHelpers { - - /// Return the closer nominal field value (kGauss) to a given magnet current (A) - int closerNominalField(float current) { - int zeroFieldThreshold = 1000; //fixme - float nominalCurrents[5] = {9558,14416,16819,18268,19262} ; //FIXME: replace with correct values... - int nominalFields[5] = {20,30,35,38,40} ; //in kGauss - if(current < zeroFieldThreshold) return 0; - int i=0; - for(;i<4;i++) - { - if(2*current < nominalCurrents[i]+nominalCurrents[i+1] ) - return nominalFields[i]; - } - return nominalFields[i]; - } - -// /// Return the closer nominal field value (kGauss) to the average current stored in the DB. -// int closerNominalField(const RunInfo & runInfo) { -// return closerNominalField(runInfo.m_avg_current); -// } - -// /// Return the closer nominal field value (kGauss) to the average current stored in the DB. -// int closerNominalField(const edm::EventSetup& es) -// { -// edm::ESHandle sum; -// es.get().get(sum); -// return closerNominalField( *sum.product() ); -// } - - -} - -#endif // MagneticFieldHelpers_h diff --git a/MagneticField/VolumeGeometry/interface/RectangularVolumeBounds.h b/MagneticField/VolumeGeometry/interface/RectangularVolumeBounds.h deleted file mode 100644 index 5ef800e81b2bd..0000000000000 --- a/MagneticField/VolumeGeometry/interface/RectangularVolumeBounds.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef RectangularVolumeBounds_H -#define RectangularVolumeBounds_H - -#include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h" - -typedef RectangularPlaneBounds RectangularVolumeBounds; - -#endif diff --git a/Mixing/Base/interface/FixedPUGenerator.h b/Mixing/Base/interface/FixedPUGenerator.h deleted file mode 100644 index 3a0ce92928a71..0000000000000 --- a/Mixing/Base/interface/FixedPUGenerator.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef FIXED_PU_GENERATOR_H -#define FIXED_PU_GENERATOR_H - -/*---------------------------------------------------------------------- - -----------------------------------------------------------------------*/ -#include "Mixing/Base/interface/PUGenerator.h" - -namespace edm -{ - - class FixedPUGenerator: public PUGenerator - { - public: - explicit FixedPUGenerator(int average): nrEvtsPerBunch(average) { } - ~FixedPUGenerator() { } - - private: - virtual unsigned int numberOfEventsPerBunch() const { return nrEvtsPerBunch;} - - unsigned int nrEvtsPerBunch; - }; -}//edm - -#endif diff --git a/Mixing/Base/interface/PUGenerator.h b/Mixing/Base/interface/PUGenerator.h deleted file mode 100644 index dbe7ff5e68425..0000000000000 --- a/Mixing/Base/interface/PUGenerator.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef PU_GENERATOR_H -#define PU_GENERATOR_H - -/*---------------------------------------------------------------------- - -----------------------------------------------------------------------*/ - -namespace edm -{ - - class PUGenerator - { - public: - explicit PUGenerator() { } - virtual ~PUGenerator() { } - virtual unsigned int numberOfEventsPerBunch() const=0; - - private: - }; - -}//edm -#endif diff --git a/OnlineDB/CSCCondDB/interface/AutoCorrMat.h b/OnlineDB/CSCCondDB/interface/AutoCorrMat.h deleted file mode 100644 index 7727adb480b82..0000000000000 --- a/OnlineDB/CSCCondDB/interface/AutoCorrMat.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - Author: Stan Durkin - -*/ - -#include -#include -#define LAYERS_ma 6 -#define STRIPS_ma 80 - -class AutoCorrMat{ - - public: - - AutoCorrMat(){ - for(int i=0;i<12;i++){ - Mat[i]=0.0; - N[i]=0.0; - } - } - - ~AutoCorrMat(){} - - void zero(){ - for(int i=0;i<12;i++){ - Mat[i]=0.0; - N[i]=0.0; - } - for (int i=3;i<12;i++){ - evar[i]=1; - variance[i]=10.0; - mymean[i]=3.2; - } - evt=0; - } - - void add(int *adc){ - int pairs[12][2]={{3,3},{3,4},{4,4},{3,5},{4,5},{5,5},{4,6},{5,6},{6,6},{5,7},{6,7},{7,7}}; - double ped=(adc[0]+adc[1])/2.; - evt++; - - for(int i=3;i<8;i++){ - if(fabs(adc[i]-ped)<25.){ - evar[i]++; - mymean[i] += adc[i]-ped; - variance[i] += (adc[i]-ped)*(adc[i]-ped); - } - } - - for(int i=0;i<12;i++){ - - //Add values within 3 sigma of mean only - float threeSigma0 = 3. * sqrt(variance[pairs[i][0]]/evar[pairs[i][0]]); - float threeSigma1 = 3. * sqrt(variance[pairs[i][1]]/evar[pairs[i][1]]); - - if (fabs(adc[pairs[i][0]]-ped) -#include - - -class Conv{ - - public: - - Conv(){} - - //square wave fcn convoluted with 1/(t+2.5) - float elec(float t,float vs){ - float f; - if (t<=vs){ - f=log(t+2.5)-log(2.5); - } - else{ - f=log(t+2.5)-log(t-50+2.5); - } - return f; - }//end elec - - - //calculate single electron distribution in 6.25 ns steps - void mkbins(float vs){ - int i,k; - float t; - for(i=0;i<120;i++) conve[i]=0.0; - for(i=0;i<120;i++){ - for(k=0;k<16;k++){ - t=(6.25*i)+(k*0.625); - conve[i]=conve[i]+elec(t,vs); - } - } - } //end mkbins - - - //convolution function - void convolution(float *xleft_a, float *xleft_b, float *min_left, float *xright_a, float *xright_b, float *min_right, float *pTime){ - //void(convolution){ - - float max, cross0,cross2,min_l,min_r,sum_x=0.0,sumx2=0.; - float sum_y_left=0.0,sum_y_right=0.0,sum_xy_left=0.0,sum_xy_right=0.0; - float a_left=0.0,a_right=0.0,b_left=0.0,b_right=0.0,chi2_left=0.0,chi2_right=0.0,chi_left=0.0,chi_right=0.0; - float aleft=0.0,aright=0.0,bleft=0.0,bright=0.0; - int i,j,k,l,imax=0; - - for(l=0;l<3;l++){ - for(i=0;i<119;i++)conv[l][i]=0.0; - for(j=0;j<119;j++){ - for(k=0;k<119;k++){ - if(j+k<119)conv[l][j+k]=conv[l][j+k]+convd[l][j]*conve[k]; - } - } - } - max=0; - min_l=9999999999999999.0; - min_r=9999999999999999.0; - for(i=0;i<119;i++){ - if(conv[1][i]>max){ - max=conv[1][i]; - imax=i; - } - } - - //find the max peak time from 3 timebins when line intersects x axis a+b*x=0 -> x=-a/b - float time1=-999.0, time2=-999.0, time3=-999.0; - float data1=-999.0, data2=-999.0, data3=-999.0; - float peakTime=0.0; - - time1=imax-1; - time2=imax; - time3=imax+1; - - data1=conv[1][imax-1]; - data2=conv[1][imax]; - data3=conv[1][imax+1]; - - peakTime=(0.5)*((time1*time1*(data3-data2)+time2*time2*(data1-data3)+time3*time3*(data2-data1))/(time1*(data3-data2)+time2*(data1-data3)+time3*(data2-data1)))*6.25; - - for(l=0;l<3;l++){ - for(i=0;i<119;i++)conv[l][i]=conv[l][i]/max; - } - - int nobs = 0; - for (int j=0; j<119; j++){ - if (conv[1][j]>0.6) nobs++; - } - - for(i=0;i<119;i++){ - cross0=0.0; - cross2=0.0; - - if(conv[1][i]>0.6){ - cross0=conv[0][i]/(conv[0][i]+conv[1][i]+conv[2][i]); - cross2=conv[2][i]/(conv[0][i]+conv[1][i]+conv[2][i]); - - sum_x += i; - sum_y_left += cross0; - sum_y_right += cross2; - sumx2 += i*i; - sum_xy_left += i*cross0; - sum_xy_right += i*cross2; - } - } - - //LMS fitting straight line y=a+b*x - - bleft = ((nobs*sum_xy_left) - (sum_x * sum_y_left))/((nobs*sumx2) - (sum_x*sum_x)); - bright = ((nobs*sum_xy_right) - (sum_x * sum_y_right))/((nobs*sumx2) - (sum_x*sum_x)); - - aleft = ((sum_y_left*sumx2)-(sum_x*sum_xy_left))/((nobs*sumx2)-(sum_x*sum_x)); - aright = ((sum_y_right*sumx2)-(sum_x*sum_xy_right))/((nobs*sumx2)-(sum_x*sum_x)); - - for(i=0;i<119;i++ ){ - chi2_left += (cross0 -(aleft+(bleft*i)))*(cross0 -(aleft+(bleft*i))); - chi2_right += (cross2 -(aright+(bright*i)))*(cross2 -(aright+(bright*i))); - } - - if(chi_left -#include - - -using namespace ROOT::Minuit2; - -class SaturationFcn : public FCNBase{ - - public: - - SaturationFcn(){} - - ~SaturationFcn(){} - - - void set_data(int N,float *charge_ptr,float *adc_ptr){ - - float x[20],y[20]; - - for(int i=0;i& x) const { - double chisq = 0.0; - int N=20; - for(int i=0;i -#include -#include "OnlineDB/CSCCondDB/interface/SaturationFcn.h" - -class SaturationFit{ - - public: - - SaturationFit(int N,float *charge_ptr,float *adc_ptr, float *u0_ptr, float *u1_ptr, float *u2_ptr, float*u3_ptr){ - double u[3],sigma[3],chisq; - VariableMetricMinimizer* pMinimizer=new VariableMetricMinimizer() ; - SaturationFcn* pFcn=new SaturationFcn(); - pFcn->set_data(N,charge_ptr,adc_ptr); - std::vector par(4,0); - std::vector err(4,0); - //printf(" about to fill pars \n"); - par[0]=pFcn->x0start; - par[1]=pFcn->x1start; - par[2]=pFcn->x2start; - par[3]=pFcn->x3start; - //printf(" pars: %f %f %f %f \n",par[0],par[1],par[2],par[3]); - err[0]=20.0; - err[1]=0.0001; - err[2]=1.0; - err[3]=20.0; - FunctionMinimum fmin = pMinimizer->Minimize(*pFcn, par, err, 1, 5000, 0.01); - if( !fmin.IsValid()){ - printf(" minuit did not converge \n"); - } else { - std::cout<<"fit succeeded... results: "<(0) ); - *u0_ptr=u[0]; - sigma[0] = fmin.UserParameters().Error( static_cast(0) ); - u[1] = fmin.UserParameters().Value( static_cast(1) ); - *u1_ptr=u[1]; - sigma[1] = fmin.UserParameters().Error( static_cast(1) ); - u[2] = fmin.UserParameters().Value( static_cast(2) ); - *u2_ptr=u[2]; - sigma[2] = fmin.UserParameters().Error( static_cast(2) ); - u[3] = fmin.UserParameters().Value( static_cast(3) ); - *u3_ptr=u[3]; - sigma[3] = fmin.UserParameters().Error( static_cast(3) ); - //std::cout<<"fitresults: "< - -#include "OnlineDB/EcalCondDB/interface/IUniqueDBObject.h" - -/** - * Abstract base class for a definition object - */ -class IConfig : public IUniqueDBObject { -}; - -#endif diff --git a/OnlineDB/EcalCondDB/interface/IRunIOV.h b/OnlineDB/EcalCondDB/interface/IRunIOV.h deleted file mode 100644 index b114539609030..0000000000000 --- a/OnlineDB/EcalCondDB/interface/IRunIOV.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef IRUNIOV_H -#define IRUNIOV_H - -#include -#include - -#include "OnlineDB/EcalCondDB/interface/ITag.h" - -typedef int run_t; - -class IIOV; - -class IRunIOV { -public: - virtual ~IRunIOV() {} - - virtual void fetchAt(IIOV* fillIOV, const run_t run, ITag* tag) const noexcept(false) = 0; - - virtual void fetchWithin(std::vector* fillVec, const run_t beginRun, const run_t endRun, ITag* tag) const - noexcept(false) = 0; -}; - -#endif diff --git a/OnlineDB/EcalCondDB/interface/ITimeIOV.h b/OnlineDB/EcalCondDB/interface/ITimeIOV.h deleted file mode 100644 index 7bfe3eff2c1ba..0000000000000 --- a/OnlineDB/EcalCondDB/interface/ITimeIOV.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef ITIMEIOV_H -#define ITIMEIOV_H - -#include -#include - -#include "OnlineDB/EcalCondDB/interface/Tm.h" -#include "OnlineDB/EcalCondDB/interface/ITag.h" -#include "OnlineDB/EcalCondDB/interface/IIOV.h" - -class ITimeIOV { -public: - virtual ~ITimeIOV() {} - - virtual void fetchAt(IIOV* fillIOV, const Tm eventTm, ITag* tag) const noexcept(false) = 0; - - virtual void fetchWithin(std::vector* fillVec, const Tm beginTm, const Tm endTm, ITag* tag) const - noexcept(false) = 0; -}; - -#endif diff --git a/OnlineDB/EcalCondDB/interface/all_cali_types.h b/OnlineDB/EcalCondDB/interface/all_cali_types.h deleted file mode 100644 index 9f653882c73e9..0000000000000 --- a/OnlineDB/EcalCondDB/interface/all_cali_types.h +++ /dev/null @@ -1,7 +0,0 @@ -#include "OnlineDB/EcalCondDB/interface/CaliTag.h" -#include "OnlineDB/EcalCondDB/interface/CaliIOV.h" -#include "OnlineDB/EcalCondDB/interface/CaliGeneralDat.h" -#include "OnlineDB/EcalCondDB/interface/CaliCrystalIntercalDat.h" -#include "OnlineDB/EcalCondDB/interface/CaliHVScanRatioDat.h" -#include "OnlineDB/EcalCondDB/interface/CaliGainRatioDat.h" -#include "OnlineDB/EcalCondDB/interface/CaliTempDat.h" diff --git a/OnlineDB/EcalCondDB/interface/all_dcu_types.h b/OnlineDB/EcalCondDB/interface/all_dcu_types.h deleted file mode 100644 index d739ae4adc7ea..0000000000000 --- a/OnlineDB/EcalCondDB/interface/all_dcu_types.h +++ /dev/null @@ -1,11 +0,0 @@ -#include "OnlineDB/EcalCondDB/interface/DCUTag.h" -#include "OnlineDB/EcalCondDB/interface/DCUCCSDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUIOV.h" -#include "OnlineDB/EcalCondDB/interface/DCUCapsuleTempDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUCapsuleTempRawDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUIDarkDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUIDarkPedDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUVFETempDat.h" -#include "OnlineDB/EcalCondDB/interface/DCULVRTempsDat.h" -#include "OnlineDB/EcalCondDB/interface/DCULVRBTempsDat.h" -#include "OnlineDB/EcalCondDB/interface/DCULVRVoltagesDat.h" diff --git a/OnlineDB/EcalCondDB/interface/all_mod_types.h b/OnlineDB/EcalCondDB/interface/all_mod_types.h deleted file mode 100644 index 2755198814870..0000000000000 --- a/OnlineDB/EcalCondDB/interface/all_mod_types.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef ALLMOD -#define ALLMOD - -#include "OnlineDB/EcalCondDB/interface/RunTag.h" -#include "OnlineDB/EcalCondDB/interface/RunIOV.h" -#include "OnlineDB/EcalCondDB/interface/MODRunIOV.h" -#include "OnlineDB/EcalCondDB/interface/RunDat.h" -#include "OnlineDB/EcalCondDB/interface/RunCommentDat.h" -#include "OnlineDB/EcalCondDB/interface/RunPTMTempDat.h" -#include "OnlineDB/EcalCondDB/interface/RunConfigDat.h" -#include "OnlineDB/EcalCondDB/interface/RunFEConfigDat.h" -#include "OnlineDB/EcalCondDB/interface/RunTPGConfigDat.h" -#include "OnlineDB/EcalCondDB/interface/RunH4TablePositionDat.h" -#include "OnlineDB/EcalCondDB/interface/MODCCSTRDat.h" -#include "OnlineDB/EcalCondDB/interface/MODCCSFEDat.h" -#include "OnlineDB/EcalCondDB/interface/MODCCSHFDat.h" -#include "OnlineDB/EcalCondDB/interface/MODDCCOperationDat.h" -#include "OnlineDB/EcalCondDB/interface/MODDCCDetailsDat.h" -#endif - - diff --git a/OnlineDB/EcalCondDB/test/InsertDCUIdarkPed.cpp b/OnlineDB/EcalCondDB/test/InsertDCUIdarkPed.cpp deleted file mode 100644 index e6e7dcc935bda..0000000000000 --- a/OnlineDB/EcalCondDB/test/InsertDCUIdarkPed.cpp +++ /dev/null @@ -1,354 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" -#include "OnlineDB/EcalCondDB/interface/all_dcu_types.h" - - -using namespace std; -using std::string; - -class CondDBApp { -public: - - /** - * App constructor; Makes the database connection - */ - CondDBApp( string sid, string user, string pass) - { - try { - cout << "Making connection..." << flush; - econn = new EcalCondDBInterface( sid, user, pass ); - cout << "Done." << endl; - } catch (runtime_error &e) { - cerr << e.what() << endl; - exit(-1); - } - - locations[0] = "H4"; - locations[1] = "867-1"; - locations[2] = "867-2"; - locations[3] = "867-3"; - } - - - - /** - * App destructor; Cleans up database connection - */ - ~CondDBApp() - { - delete econn; - } - - - - DCUIOV makeDCUIOV() - { - LocationDef locdef; - locdef.setLocation("P5_Co"); - DCUTag dcutag; - dcutag.setLocationDef(locdef); - dcutag.setGeneralTag("IDarkPedestalsRun"); - - // Our beginning time will be the current GMT time - // This is the time zone that should be written to the DB! - // (Actually UTC) - Tm since; - since.setToCurrentGMTime(); - - // Our beginning run number will be the seconds representation - // of that time, and we will increment our IoV based on - // a microsecond representation - uint64_t microseconds = since.microsTime(); - startmicros = microseconds; - - // Set the properties of the iov - DCUIOV dcuiov; - - dcuiov.setSince(since); - dcuiov.setDCUTag(dcutag); - - return dcuiov; - } - - - - /** - * Write objects with associated DCUIOVs - * IOVs are written using automatic updating of the 'till', as if - * the time of the end of the run was not known at the time of writing. - */ - - void testWrite(std::string filename) - { - - float temp_vec[61200]; - int ih4_vec[61200]; - int ih4; - float temp; - - for(int ic=0; ic<61200; ic++){ - temp_vec[ic]=0; - ih4_vec[ic]=0; - } - - - cout << "read IDark Pedestal file " << filename << endl; - - - FILE *fin; // input file - fin = fopen(filename.c_str(),"r"); - - char line[256]; - - fgets(line,255,fin); // first is the comment line - - - while(fgets(line,255,fin)) - { - - std::string EBorEE; - std::stringstream aStrStream; - aStrStream << line; - - int ism=0; - aStrStream >> EBorEE >> ism>> ih4 >> temp; - - ih4=ih4-1; // in the file ih4 follows the electronics numbering but plus one - - if (EBorEE == "EB-") ism=ism+18; - - int ic=(ism-1)*1700+ih4; - - temp_vec[ic]=temp; - ih4_vec[ic]=ih4; - - } - fclose(fin); - - - - cout << "Writing DCUCapsuleTempDat objects to database..." << endl; - cout << "Making a DCUIOV..." << flush; - DCUIOV dcuiov = this->makeDCUIOV(); - cout << "Done." << endl; - - this->printIOV(&dcuiov); - - Tm eventTm = dcuiov.getSince(); - DCUTag dcutag = dcuiov.getDCUTag(); - - // Get channel ID for SM 10, crystal c - // int c = 1; - // EcalLogicID ecid; - - cout << "Loading ecal logic id from DB" << endl; - vector ecid_vec; - ecid_vec = econn->getEcalLogicIDSetOrdered("EB_elec_crystal_number", 1, 36, 0, 1699, - EcalLogicID::NULLID,EcalLogicID::NULLID, - "EB_elec_crystal_number",12); - - - map dataset; - - - for (int c=0; c<61200; c++){ - // the channels are turned in phi and eta - - DCUIDarkPedDat capTemp; - capTemp.setPed(temp_vec[c]); - // Fill the dataset - dataset[ecid_vec[c]] = capTemp; - - } - - // Insert the dataset, identifying by iov - cout << "Inserting dataset..." << flush; - econn->insertDataArraySet(&dataset, &dcuiov); - cout << "Done." << endl; - - }; - - - - /** - * Write a data set - */ - template - void testTable(DATT* data, IOVT* iov, EcalLogicID* ecid) - { - tablesTried++; - try { - cout << "Table " << tablesTried << "..." << flush; - map dataset; - dataset[*ecid] = *data; - econn->insertDataSet(&dataset, iov); - cout << "write OK..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, iov); - if (!dataset.size()) { - throw(runtime_error("Zero rows read back")); - } - cout << "read OK" << endl; - tablesOK++; - } catch (runtime_error &e) { - cout << "testTable FAILED: " << e.what() << endl; - } catch (...) { - cout << "testTable FAILED: unknown exception" << endl; - } - } - - - - /** - * Write to each of the data tables - */ - void testAllTables() - { - cout << "Testing writing to all tables..." << endl; - tablesTried = 0; - tablesOK = 0; - - // get a dummy logic ID - EcalLogicID logicID = econn->getEcalLogicID(-1); - - // DCUIOV tables - DCUIOV dcuiov = this->makeDCUIOV(); - - DCUCapsuleTempDat table01; - testTable(&table01, &dcuiov, &logicID); - - DCUCapsuleTempRawDat table02; - testTable(&table02, &dcuiov, &logicID); - - DCUIDarkDat table03; - testTable(&table03, &dcuiov, &logicID); - - DCUIDarkPedDat table04; - testTable(&table04, &dcuiov, &logicID); - - DCUVFETempDat table05; - testTable(&table05, &dcuiov, &logicID); - - DCULVRTempsDat table06; - testTable(&table06, &dcuiov, &logicID); - - DCULVRBTempsDat table07; - testTable(&table07, &dcuiov, &logicID); - - DCULVRVoltagesDat table08; - testTable(&table08, &dcuiov, &logicID); - - cout << "Test of writing to all tables complete" << endl; - cout << tablesOK << " of " << tablesTried << " written to successfully" << endl << endl << endl; - }; - - - -private: - CondDBApp(); // hidden default constructor - EcalCondDBInterface* econn; - string locations[4]; - uint64_t startmicros; - uint64_t endmicros; - run_t startrun; - run_t endrun; - - int tablesTried; - int tablesOK; - - /** - * Iterate through the dataset and print some data - */ - void printDataSet( const map* dataset, int limit = 0 ) const - { - cout << "==========printDataSet()" << endl; - if (dataset->size() == 0) { - cout << "No data in map!" << endl; - } - EcalLogicID ecid; - DCUCapsuleTempDat capsTemp; - - int count = 0; - typedef map< EcalLogicID, DCUCapsuleTempDat >::const_iterator CI; - for (CI p = dataset->begin(); p != dataset->end(); p++) { - count++; - if (limit && count > limit) { return; } - ecid = p->first; - capsTemp = p->second; - - cout << "SM: " << ecid.getID1() << endl; - cout << "Xtal: " << ecid.getID2() << endl; - cout << "capsule temp: " << capsTemp.getCapsuleTemp() << endl; - cout << "========================" << endl; - } - cout << endl; - } - - - /** - * Print out a DCUTag - */ - void printTag( const DCUTag* tag) const - { - cout << endl; - cout << "=============DCUTag:" << endl; - cout << "GeneralTag: " << tag->getGeneralTag() << endl; - cout << "Location: " << tag->getLocationDef().getLocation() << endl; - cout << "====================" << endl; - } - - void printIOV( const DCUIOV* iov) const - { - cout << endl; - cout << "=============DCUIOV:" << endl; - DCUTag tag = iov->getDCUTag(); - printTag(&tag); - cout << "since: " << iov->getSince().str() << endl; - cout << "till: " << iov->getTill().str() << endl; - cout << "====================" << endl; - } -}; - - - -int main (int argc, char* argv[]) -{ - string filename; - string sid; - string user; - string pass; - - - if (argc != 5) { - cout << "Usage:" << endl; - cout << " " << argv[0] << " " << endl; - exit(-1); - } - - sid = argv[1]; - user = argv[2]; - pass = argv[3]; - filename=argv[4]; - - try { - CondDBApp app(sid, user, pass); - - app.testWrite(filename); - - } catch (exception &e) { - cout << "ERROR: " << e.what() << endl; - } catch (...) { - cout << "Unknown error caught" << endl; - } - - cout << "All Done." << endl; - - return 0; -} diff --git a/OnlineDB/EcalCondDB/test/TestChannelView.cpp b/OnlineDB/EcalCondDB/test/TestChannelView.cpp deleted file mode 100644 index d3b8cb918a53c..0000000000000 --- a/OnlineDB/EcalCondDB/test/TestChannelView.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include -#include -#include -#include -#include - -#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" -#include "OnlineDB/EcalCondDB/interface/all_dcu_types.h" - - -using namespace std; - -class CondDBApp { -public: - - /** - * App constructor; Makes the database connection - */ - CondDBApp( string sid, string user, string pass) - { - try { - cout << "Making connection..." << flush; - econn = new EcalCondDBInterface( sid, user, pass ); - cout << "Done." << endl; - } catch (runtime_error &e) { - cerr << e.what() << endl; - exit(-1); - } - - locations[0] = "H4"; - locations[1] = "867-1"; - locations[2] = "867-2"; - locations[3] = "867-3"; - } - - - - /** - * App destructor; Cleans up database connection - */ - ~CondDBApp() - { - delete econn; - } - - - /** - * test read - */ - void test() { - cout << "test of the channelview table..." << endl; - - - - // Get channel ID for SM 10, crystal c - // int c = 1; - // EcalLogicID ecid; - vector ecid_vec; - ecid_vec = econn->getEcalLogicIDSet("EB_elec_crystal_number", 10, 10, 1, 10,EcalLogicID::NULLID, EcalLogicID::NULLID,"EB_crystal_number"); - // ecid = econn->getEcalLogicID("EB_crystal_number", 10, c); - for (int i=0; i<(int)ecid_vec.size() ; i++){ - int id1=ecid_vec[i].getID1(); - int id2=ecid_vec[i].getID2(); - int log_id=ecid_vec[i].getLogicID(); - cout << "id1="< " << endl; - exit(-1); - } - - host = argv[1]; - sid = argv[2]; - user = argv[3]; - pass = argv[4]; - - try { - CondDBApp app(sid, user, pass); - - app.test(); - } catch (exception &e) { - cout << "ERROR: " << e.what() << endl; - } catch (...) { - cout << "Unknown error caught" << endl; - } - - cout << "All Done." << endl; - - return 0; -} diff --git a/OnlineDB/EcalCondDB/test/TestDCU.cpp b/OnlineDB/EcalCondDB/test/TestDCU.cpp deleted file mode 100644 index 3c052c5ffe260..0000000000000 --- a/OnlineDB/EcalCondDB/test/TestDCU.cpp +++ /dev/null @@ -1,315 +0,0 @@ -#include -#include -#include -#include -#include - -#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" -#include "OnlineDB/EcalCondDB/interface/all_dcu_types.h" - - -using namespace std; - -class CondDBApp { -public: - - /** - * App constructor; Makes the database connection - */ - CondDBApp( string sid, string user, string pass) - { - try { - cout << "Making connection..." << flush; - econn = new EcalCondDBInterface( sid, user, pass ); - cout << "Done." << endl; - } catch (runtime_error &e) { - cerr << e.what() << endl; - exit(-1); - } - - locations[0] = "H4"; - locations[1] = "867-1"; - locations[2] = "867-2"; - locations[3] = "867-3"; - } - - - - /** - * App destructor; Cleans up database connection - */ - ~CondDBApp() - { - delete econn; - } - - - - DCUIOV makeDCUIOV() - { - LocationDef locdef; - locdef.setLocation(locations[3]); - DCUTag dcutag; - dcutag.setLocationDef(locdef); - - - // Our beginning time will be the current GMT time - // This is the time zone that should be written to the DB! - // (Actually UTC) - Tm since; - since.setToCurrentGMTime(); - - // Our beginning run number will be the seconds representation - // of that time, and we will increment our IoV based on - // a microsecond representation - uint64_t microseconds = since.microsTime(); - startmicros = microseconds; - - // Set the properties of the iov - DCUIOV dcuiov; - - dcuiov.setSince(since); - dcuiov.setDCUTag(dcutag); - - return dcuiov; - } - - - - /** - * Write objects with associated DCUIOVs - * IOVs are written using automatic updating of the 'till', as if - * the time of the end of the run was not known at the time of writing. - */ - void testWrite() - { - cout << "Writing DCUCapsuleTempDat objects to database..." << endl; - cout << "Making a DCUIOV..." << flush; - DCUIOV dcuiov = this->makeDCUIOV(); - cout << "Done." << endl; - - this->printIOV(&dcuiov); - - Tm eventTm = dcuiov.getSince(); - DCUTag dcutag = dcuiov.getDCUTag(); - - // Get channel ID for SM 10, crystal c - // int c = 1; - // EcalLogicID ecid; - vector ecid_vec; - ecid_vec = econn->getEcalLogicIDSet("EB_crystal_number", 10, 10, 1, 1700); - // ecid = econn->getEcalLogicID("EB_crystal_number", 10, c); - - - - map dataset; - int count=0; - for (int c=1; c<1701; c++){ - // the channels are turned in phi and eta - DCUCapsuleTempDat capTemp; - - int i = 1; - float val = 0.11111 + i; - capTemp.setCapsuleTemp(val); - - // Fill the dataset - dataset[ecid_vec[count]] = capTemp; - - count++; - } - - // Insert the dataset, identifying by iov - cout << "Inserting dataset..." << flush; - econn->insertDataArraySet(&dataset, &dcuiov); - cout << "Done." << endl; - - // Fetch it back - cout << "Fetching dataset..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, &dcuiov); - cout << "retrieved " << dataset.size() << " channel-value pairs" << endl; - printDataSet(&dataset); - - // Fetch back DCUIOV just written - cout << "Fetching IOV just written..." << flush; - DCUIOV dcuiov_prime = econn->fetchDCUIOV(&dcutag, eventTm); - cout << "Done." << endl << endl << endl; - this->printIOV(&dcuiov_prime); - }; - - - - /** - * Write a data set - */ - template - void testTable(DATT* data, IOVT* iov, EcalLogicID* ecid) - { - tablesTried++; - try { - cout << "Table " << tablesTried << "..." << flush; - map dataset; - dataset[*ecid] = *data; - econn->insertDataSet(&dataset, iov); - cout << "write OK..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, iov); - if (!dataset.size()) { - throw(runtime_error("Zero rows read back")); - } - cout << "read OK" << endl; - tablesOK++; - } catch (runtime_error &e) { - cout << "testTable FAILED: " << e.what() << endl; - } catch (...) { - cout << "testTable FAILED: unknown exception" << endl; - } - } - - - - /** - * Write to each of the data tables - */ - void testAllTables() - { - cout << "Testing writing to all tables..." << endl; - tablesTried = 0; - tablesOK = 0; - - // get a dummy logic ID - EcalLogicID logicID = econn->getEcalLogicID(-1); - - // DCUIOV tables - DCUIOV dcuiov = this->makeDCUIOV(); - - DCUCapsuleTempDat table01; - testTable(&table01, &dcuiov, &logicID); - - DCUCapsuleTempRawDat table02; - testTable(&table02, &dcuiov, &logicID); - - DCUIDarkDat table03; - testTable(&table03, &dcuiov, &logicID); - - DCUIDarkPedDat table04; - testTable(&table04, &dcuiov, &logicID); - - DCUVFETempDat table05; - testTable(&table05, &dcuiov, &logicID); - - DCULVRTempsDat table06; - testTable(&table06, &dcuiov, &logicID); - - DCULVRBTempsDat table07; - testTable(&table07, &dcuiov, &logicID); - - DCULVRVoltagesDat table08; - testTable(&table08, &dcuiov, &logicID); - - cout << "Test of writing to all tables complete" << endl; - cout << tablesOK << " of " << tablesTried << " written to successfully" << endl << endl << endl; - }; - - - -private: - CondDBApp(); // hidden default constructor - EcalCondDBInterface* econn; - string locations[4]; - uint64_t startmicros; - uint64_t endmicros; - run_t startrun; - run_t endrun; - - int tablesTried; - int tablesOK; - - /** - * Iterate through the dataset and print some data - */ - void printDataSet( const map* dataset, int limit = 0 ) const - { - cout << "==========printDataSet()" << endl; - if (dataset->size() == 0) { - cout << "No data in map!" << endl; - } - EcalLogicID ecid; - DCUCapsuleTempDat capsTemp; - - int count = 0; - typedef map< EcalLogicID, DCUCapsuleTempDat >::const_iterator CI; - for (CI p = dataset->begin(); p != dataset->end(); p++) { - count++; - if (limit && count > limit) { return; } - ecid = p->first; - capsTemp = p->second; - - cout << "SM: " << ecid.getID1() << endl; - cout << "Xtal: " << ecid.getID2() << endl; - cout << "capsule temp: " << capsTemp.getCapsuleTemp() << endl; - cout << "========================" << endl; - } - cout << endl; - } - - - /** - * Print out a DCUTag - */ - void printTag( const DCUTag* tag) const - { - cout << endl; - cout << "=============DCUTag:" << endl; - cout << "GeneralTag: " << tag->getGeneralTag() << endl; - cout << "Location: " << tag->getLocationDef().getLocation() << endl; - cout << "====================" << endl; - } - - void printIOV( const DCUIOV* iov) const - { - cout << endl; - cout << "=============DCUIOV:" << endl; - DCUTag tag = iov->getDCUTag(); - printTag(&tag); - cout << "since: " << iov->getSince().str() << endl; - cout << "till: " << iov->getTill().str() << endl; - cout << "====================" << endl; - } -}; - - - -int main (int argc, char* argv[]) -{ - string host; - string sid; - string user; - string pass; - - if (argc != 5) { - cout << "Usage:" << endl; - cout << " " << argv[0] << " " << endl; - exit(-1); - } - - host = argv[1]; - sid = argv[2]; - user = argv[3]; - pass = argv[4]; - - try { - CondDBApp app(sid, user, pass); - - app.testWrite(); - app.testAllTables(); - } catch (exception &e) { - cout << "ERROR: " << e.what() << endl; - } catch (...) { - cout << "Unknown error caught" << endl; - } - - cout << "All Done." << endl; - - return 0; -} diff --git a/OnlineDB/EcalCondDB/test/TestMOD.cpp b/OnlineDB/EcalCondDB/test/TestMOD.cpp deleted file mode 100644 index cb21a155d3074..0000000000000 --- a/OnlineDB/EcalCondDB/test/TestMOD.cpp +++ /dev/null @@ -1,265 +0,0 @@ -#include -#include -#include -#include -#include -#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" -#include "OnlineDB/EcalCondDB/interface/all_mod_types.h" - - -using namespace std; - -class CondDBApp { -public: - - /** - * App constructor; Makes the database connection - */ - CondDBApp(string host, string sid, string user, string pass) - { - try { - cout << "Making connection..." << flush; - econn = new EcalCondDBInterface( sid, user, pass ); - cout << "Done." << endl; - } catch (runtime_error &e) { - cerr << e.what() << endl; - exit(-1); - } - - locations[0] = "H4"; - locations[1] = "867-1"; - locations[2] = "867-2"; - locations[3] = "867-3"; - } - - - - /** - * App destructor; Cleans up database connection - */ - ~CondDBApp() - { - delete econn; - } - - - RunIOV makeRunIOV() - { - // The objects necessary to identify a dataset - LocationDef locdef; - RunTypeDef rundef; - RunTag runtag; - - locdef.setLocation(locations[3]); - - rundef.setRunType("TEST"); - - runtag.setLocationDef(locdef); - runtag.setRunTypeDef(rundef); - - // Our beginning time will be the current GMT time - // This is the time zone that should be written to the DB! - // (Actually UTC) - Tm startTm; - startTm.setToCurrentGMTime(); - - // Our beginning run number will be the seconds representation - // of that time, and we will increment our IoV based on - // a microsecond representation - uint64_t microseconds = startTm.microsTime(); - startmicros = microseconds; - run_t run = (int)(microseconds/1000000); - startrun = run; - - cout << "Starting Time: " << startTm.str() << endl; - cout << "Starting Micros: " << startmicros << endl; - cout << "Starting Run: " << startrun << endl; - - // Set the properties of the iov - RunIOV runiov; - - startTm.setToMicrosTime(microseconds); - cout << "Setting run " << run << " run_start " << startTm.str() << endl; - runiov.setRunNumber(run); - runiov.setRunStart(startTm); - runiov.setRunTag(runtag); - - return runiov; - } - - - MODRunIOV makeMODRunIOV(RunIOV* runiov) - { - MODRunIOV modiov; - modiov.setRunIOV(*runiov); - modiov.setSubRunNumber(0); - modiov.setSubRunStart(runiov->getRunStart()); - - return modiov; - } - - - - /** - * Write MODCCSTRDat objects with associated RunIOVs - * IOVs are written using automatic updating of the 'RunEnd', as if - * the time of the end of the run was not known at the time of writing. - */ - void testWrite() - { - cout << "Writing MODCCSTRDat to database..." << endl; - RunIOV runiov = this->makeRunIOV(); - RunTag runtag = runiov.getRunTag(); - run_t run = runiov.getRunNumber(); - - // write to the DB - cout << "Inserting run..." << flush; - econn->insertRunIOV(&runiov); - cout << "Done." << endl; - printIOV(&runiov); - - // fetch it back - cout << "Fetching run by tag just used..." << flush; - RunIOV runiov_prime = econn->fetchRunIOV(&runtag, run); - cout << "Done." << endl; - printIOV(&runiov_prime); - cout << "Fetching run by location..." << flush; - RunIOV runiov_prime2 = econn->fetchRunIOV(runtag.getLocationDef().getLocation(), run); - cout << "Done." << endl; - printIOV(&runiov_prime2); - - // MODitoring Tag and IOV - MODRunIOV modiov = this->makeMODRunIOV(&runiov); - - // Get channel ID for SM 10, crystal c - int c = 1; - EcalLogicID ecid; - ecid = econn->getEcalLogicID("EB_token_ring", 10, c); - - // Set the data - /* MODCCSTRDat d; - map dataset; - int i = 1112287340; - d.setWord(i); - dataset[ecid] = d; - // Insert the dataset, identifying by iov - cout << "Inserting dataset..." << flush; - econn->insertDataSet(&dataset, &modiov); - cout << "Done." << endl; - */ - - // Set the data - MODCCSHFDat dhf; - map datasethf; - std::string fname="/u1/fra/test.txt"; - dhf.setFile(fname); - dhf.setTest(123); - std::cout<< "here it is: " <insertDataSet(&datasethf, &modiov); - cout << "Done." << endl; - - // Fetch it back - /* cout << "Fetching dataset..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, &modiov); - cout << "retrieved " << dataset.size() << " channel-value pairs" << endl; - */ - - cout << "Done." << endl << endl << endl; - }; - - - - /** - * Write a data set - */ - template - void testTable(DATT* data, IOVT* iov, EcalLogicID* ecid) - { - tablesTried++; - try { - cout << "Table " << tablesTried << "..." << flush; - map dataset; - dataset[*ecid] = *data; - econn->insertDataSet(&dataset, iov); - cout << "write OK..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, iov); - if (!dataset.size()) { - throw(runtime_error("Zero rows read back")); - } - cout << "read OK" << endl; - tablesOK++; - } catch (runtime_error &e) { - cout << "testTable FAILED: " << e.what() << endl; - } catch (...) { - cout << "testTable FAILED: unknown exception" << endl; - } - } - - - - -private: - CondDBApp(); // hidden default constructor - EcalCondDBInterface* econn; - string locations[4]; - uint64_t startmicros; - uint64_t endmicros; - run_t startrun; - run_t endrun; - - int tablesTried; - int tablesOK; - - - void printIOV( const RunIOV* iov) const - { - cout << endl; - cout << "=============RunIOV:" << endl; - RunTag tag = iov->getRunTag(); - - cout << "Run Number: " << iov->getRunNumber() << endl; - cout << "Run Start: " << iov->getRunStart().str() << endl; - cout << "Run End: " << iov->getRunEnd().str() << endl; - cout << "====================" << endl; - } -}; - - - -int main (int argc, char* argv[]) -{ - string host; - string sid; - string user; - string pass; - - if (argc != 5) { - cout << "Usage:" << endl; - cout << " " << argv[0] << " " << endl; - exit(-1); - } - - host = argv[1]; - sid = argv[2]; - user = argv[3]; - pass = argv[4]; - - try { - CondDBApp app(host, sid, user, pass); - - app.testWrite(); - } catch (exception &e) { - cout << "ERROR: " << e.what() << endl; - } catch (...) { - cout << "Unknown error caught" << endl; - } - - cout << "All Done." << endl; - - return 0; -} diff --git a/PhysicsTools/FWLite/interface/WSelectorFast.h b/PhysicsTools/FWLite/interface/WSelectorFast.h deleted file mode 100644 index 9b9f923e7914f..0000000000000 --- a/PhysicsTools/FWLite/interface/WSelectorFast.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef PhysicsTools_FWLite_WSelectorFast_h -#define PhysicsTools_FWLite_WSelectorFast_h -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/PatCandidates/interface/Muon.h" -#include "PhysicsTools/SelectorUtils/interface/EventSelector.h" - -/** - \class WSelector WSelector.h "PhysicsTools/FWLite/interface/WSelector.h" - \brief Example class of an EventSelector to apply a simple W Boson selection - - Example class for of an EventSelector as defined in the SelectorUtils package. - EventSelectors may be used to facilitate cutflows and to implement selections - independent from the event loop in FWLite or full framework. -*/ - -class WSelectorFast : public EventSelector { -public: - /// constructor - WSelectorFast(edm::ParameterSet const& params) - : muonSrc_(params.getParameter("muonSrc")), metSrc_(params.getParameter("metSrc")) { - double muonPtMin = params.getParameter("muonPtMin"); - double metMin = params.getParameter("metMin"); - push_back("Muon Pt", muonPtMin); - push_back("MET", metMin); - set("Muon Pt"); - set("MET"); - wMuon_ = 0; - met_ = 0; - if (params.exists("cutsToIgnore")) { - setIgnoredCuts(params.getParameter >("cutsToIgnore")); - } - retInternal_ = getBitTemplate(); - } - /// destructor - virtual ~WSelectorFast() {} - /// return muon candidate of W boson - pat::Muon const& wMuon() const { return *wMuon_; } - /// return MET of W boson - pat::MET const& met() const { return *met_; } - - /// here is where the selection occurs - virtual bool operator()(edm::EventBase const& event, pat::strbitset& ret) { - ret.set(false); - // Handle to the muon collection - edm::Handle > muons; - // Handle to the MET collection - edm::Handle > met; - // get the objects from the event - bool gotMuons = event.getByLabel(muonSrc_, muons); - bool gotMET = event.getByLabel(metSrc_, met); - // get the MET, require to be > minimum - if (gotMET) { - met_ = &met->at(0); - if (met_->pt() > cut(metIndex_, double()) || ignoreCut(metIndex_)) - passCut(ret, metIndex_); - } - // get the highest pt muon, require to have pt > minimum - if (gotMuons) { - if (!ignoreCut(muonPtIndex_)) { - if (muons->size() > 0) { - wMuon_ = &muons->at(0); - if (wMuon_->pt() > cut(muonPtIndex_, double()) || ignoreCut(muonPtIndex_)) - passCut(ret, muonPtIndex_); - } - } else { - passCut(ret, muonPtIndex_); - } - } - setIgnored(ret); - return (bool)ret; - } - -protected: - /// muon input - edm::InputTag muonSrc_; - /// met input - edm::InputTag metSrc_; - /// muon candidate from W boson - pat::Muon const* wMuon_; - /// MET from W boson - pat::MET const* met_; - /// index for muon Pt cut - index_type muonPtIndex_; - /// index for MET cut - index_type metIndex_; -}; -#endif // PhysicsTools_FWLite_WSelectorFast_h diff --git a/PhysicsTools/MVAComputer/interface/MVAModuleHelper.h b/PhysicsTools/MVAComputer/interface/MVAModuleHelper.h deleted file mode 100644 index d0cc993c87ac9..0000000000000 --- a/PhysicsTools/MVAComputer/interface/MVAModuleHelper.h +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef PhysicsTools_MVAComputer_MVAModuleHelper_h -#define PhysicsTools_MVAComputer_MVAModuleHelper_h -// -*- C++ -*- -// -// Package: MVAComputer -// Class : MVAModuleHelper -// - -// -// Author: Christophe Saout -// Created: Sat Apr 24 15:18 CEST 2007 -// - -#include -#include -#include -#include -#include -#include -#include - -#include "FWCore/Framework/interface/EventSetup.h" - -#include "PhysicsTools/MVAComputer/interface/AtomicId.h" -#include "PhysicsTools/MVAComputer/interface/Calibration.h" -#include "PhysicsTools/MVAComputer/interface/MVAComputerCache.h" -#include "CondFormats/PhysicsToolsObjects/interface/MVAComputer.h" - -namespace PhysicsTools { - - /** \class MVAModuleHelperDefaultFiller - * - * \short Default template for MVAModuleHelper "Filler" template argument - * - * Simply calls a "double compute(const AtomicID &name) const" method - * on the object for each variable requested. - * - ************************************************************/ - template - struct MVAModuleHelperDefaultFiller { - MVAModuleHelperDefaultFiller(const PhysicsTools::AtomicId &name) {} - - double operator()(const Object &object, const PhysicsTools::AtomicId &name) { return object.compute(name); } - }; - - /** \class MVAModuleHelper - * - * \short Template for automated variable collection and MVA computation in EDM modules - * - * The class MVAModuleHelper can be embedded in EDM modules. It automatically - * collects the variables listed in the MVA training description using type - * traits and passes them on to the computer. The calibration and or trainer - * is automatically collected from the EventSetup. - * - ************************************************************/ - template > - class MVAModuleHelper { - public: - MVAModuleHelper(const std::string &label) : label(label) {} - MVAModuleHelper(const MVAModuleHelper &orig) : label(orig.label) {} - ~MVAModuleHelper() {} - - void setEventSetup(const edm::EventSetup &setup); - void setEventSetup(const edm::EventSetup &setup, const char *esLabel); - - double operator()(const Object &object) const; - - void train(const Object &object, bool target, double weight = 1.0) const; - - private: - void init(const PhysicsTools::Calibration::MVAComputerContainer *container); - - const std::string label; - PhysicsTools::MVAComputerCache cache; - - class Value { - public: - Value(const std::string &name) : name(name), filler(name) {} - Value(const std::string &name, double value) : name(name), filler(name), value(value) {} - - inline bool update(const Object &object) const { - value = filler(object, name); - return !std::isfinite(value); - } - - PhysicsTools::AtomicId getName() const { return name; } - double getValue() const { return value; } - - private: - PhysicsTools::AtomicId name; - Filler filler; - - mutable double value; - }; - - std::vector values; - }; - - template - void MVAModuleHelper::setEventSetup(const edm::EventSetup &setup) { - edm::ESHandle handle; - setup.get().get(handle); - const PhysicsTools::Calibration::MVAComputerContainer *container = handle.product(); - if (cache.update(container, label.c_str()) && cache) - init(container); - } - - template - void MVAModuleHelper::setEventSetup(const edm::EventSetup &setup, const char *esLabel) { - edm::ESHandle handle; - setup.get().get(esLabel, handle); - const PhysicsTools::Calibration::MVAComputerContainer *container = handle.product(); - if (cache.update(container, label.c_str()) && cache) - init(container); - } - - template - void MVAModuleHelper::init(const PhysicsTools::Calibration::MVAComputerContainer *container) { - const std::vector &vars = container->find(label).inputSet; - values.clear(); - for (std::vector::const_iterator iter = vars.begin(); iter != vars.end(); - ++iter) - if (std::strncmp(iter->name.c_str(), "__", 2) != 0) - values.push_back(Value(iter->name)); - } - - template - double MVAModuleHelper::operator()(const Object &object) const { - std::for_each(values.begin(), values.end(), std::bind(&Value::update, std::placeholders::_1, object)); - return cache->eval(values); - } - - template - void MVAModuleHelper::train(const Object &object, bool target, double weight) const { - static const PhysicsTools::AtomicId kTargetId("__TARGET__"); - static const PhysicsTools::AtomicId kWeightId("__WEIGHT__"); - - if (!cache) - return; - - if (std::accumulate( - values.begin(), - values.end(), - 0, - std::bind( - std::plus(), std::placeholders::_1, std::bind(&Value::update, std::placeholders::_2, object)))) - return; - - PhysicsTools::Variable::ValueList list; - list.add(kTargetId, target); - list.add(kWeightId, weight); - for (typename std::vector::const_iterator iter = values.begin(); iter != values.end(); ++iter) - list.add(iter->getName(), iter->getValue()); - - cache->eval(list); - } - -} // namespace PhysicsTools - -#endif // PhysicsTools_MVAComputer_MVAModuleHelper_h diff --git a/PhysicsTools/PatExamples/interface/WPlusJetsEventSelector.h b/PhysicsTools/PatExamples/interface/WPlusJetsEventSelector.h deleted file mode 100644 index 0de02de5f5412..0000000000000 --- a/PhysicsTools/PatExamples/interface/WPlusJetsEventSelector.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning "This has moved to PhysicsTools/SelectorUtils" -#include "PhysicsTools/SelectorUtils/interface/WPlusJetsEventSelector.h" diff --git a/PhysicsTools/PatUtils/interface/JetSelector.h b/PhysicsTools/PatUtils/interface/JetSelector.h deleted file mode 100644 index a3c17dd98a88a..0000000000000 --- a/PhysicsTools/PatUtils/interface/JetSelector.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef PhysicsTools_PatUtils_JetSelector_h -#define PhysicsTools_PatUtils_JetSelector_h - -/** - \class pat::JetSelector JetSelector.h "PhysicsTools/PatUtils/JetSelector.h" - \brief Selects good Jets - - The Jet selector returns a flag (see pat::ParticleStatus) based on one of the possible - selections: either cut-based or custom (user-defined set of cuts). - This is driven by the configuration parameters (see the PATJetCleaner - documentation for configuration details). - - The parameters are passed to the selector through a JetSelection struct. - (An adapter exists for use in CMSSW: - reco::modules::ParameterAdapter>.) - - \author C. Autermann (Uni Hamburg) - \version $Id: JetSelector.h,v 1.4 2008/03/05 14:51:02 fronga Exp $ -**/ - -#include -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "PhysicsTools/PatUtils/interface/JetSelection.h" -#include "PhysicsTools/PatUtils/interface/CaloJetSelector.h" -#include "DataFormats/Common/interface/ValueMap.h" - -#include "PhysicsTools/PatUtils/interface/ParticleCode.h" - - -namespace pat { - - typedef edm::ValueMap JetValueMap; - - template - class JetSelector { - - - public: - JetSelector( const JetSelection& config ); - ~JetSelector() {} - - /// Returns 0 if Jet matches criteria, a flag otherwise. - /// Criteria depend on the selector's configuration. - /// Jet IDs only need to be provided if selection is based - /// on it (cut, neural net or likelihood). Cluster shapes are for - /// custom selection only. - const ParticleStatus - filter( const unsigned int& index, - const edm::View& Jets, - const JetValueMap* JetMap - ) const; - - - private: - - JetSelection config_; - - std::unique_ptr CaloJetSelector_;///Selects CaloJets - //std::unique_ptr PFSelector_;///Selects PFJets - - }; // class - -} // namespace - -#endif diff --git a/PhysicsTools/PatUtils/interface/JetSelector.icc b/PhysicsTools/PatUtils/interface/JetSelector.icc deleted file mode 100644 index a462b047b54b4..0000000000000 --- a/PhysicsTools/PatUtils/interface/JetSelector.icc +++ /dev/null @@ -1,63 +0,0 @@ - -#include "PhysicsTools/PatUtils/interface/JetSelector.h" -#include "DataFormats/Common/interface/RefToBase.h" - - -//______________________________________________________________________________ -template -pat::JetSelector::JetSelector( const pat::JetSelection& config ) : - config_( config ) -{ - - if (config_.selectionType=="custom") { - CaloJetSelector_ = std::make_unique(config); - //PFJetSelector_ = std::make_unique(config); - } - -} - - -//______________________________________________________________________________ -template -const pat::ParticleStatus -pat::JetSelector::filter( const unsigned int& index, - const edm::View& Jets, - const JetValueMap * JetMap - ) const -{ - - ParticleStatus result = BAD; - - if (config_.selectionType=="none") { - - result = GOOD; - } - else if (config_.selectionType=="JetID" && JetMap!=0) { - const double jetIDresult = (*JetMap)[ Jets.refAt(index) ]; - if ( jetIDresult > config_.value ) result = GOOD; - else result = BAD; - } - else if ( config_.selectionType == "custom" ) { - - const JetType& Jet = Jets[index]; - const reco::CaloJet * caloJet = 0; - const reco::PFJet * pfJet = 0; - caloJet = dynamic_cast(&Jet); - ///specific selection for CaloJets - if (caloJet) result = CaloJetSelector_->filter( *caloJet ); - else { - ///specific selection for PFJets - pfJet = dynamic_cast( &Jet); - //FIXME: not implemented yet! - //if (pfJet) result = PFJetSelector_->filter( *pfJet); - } - - } else - // Throw! unknown configuration - throw edm::Exception(edm::errors::Configuration) - << "Unknown Jet ID selection " << config_.selectionType; - - - return result; -} - diff --git a/PhysicsTools/PatUtils/interface/PatSelectorByFlags.h b/PhysicsTools/PatUtils/interface/PatSelectorByFlags.h deleted file mode 100644 index fcd5d01e519f7..0000000000000 --- a/PhysicsTools/PatUtils/interface/PatSelectorByFlags.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef PhysicsTools_PatUtils_interface_PatSelectorByFlags_h -#define PhysicsTools_PatUtils_interface_PatSelectorByFlags_h - -#include "DataFormats/PatCandidates/interface/Flags.h" - -namespace pat { - class SelectorByFlags { - public: - SelectorByFlags() : mask_(0) { } - SelectorByFlags(uint32_t maskToTest) : mask_(~maskToTest) {} - SelectorByFlags(const std::string &bitToTest) ; - SelectorByFlags(const std::vector bitsToTest) ; - bool operator()(const reco::Candidate &c) const { return pat::Flags::test(c, mask_); } - bool operator()(const reco::Candidate *c) const { return (c == 0 ? false : pat::Flags::test(*c, mask_)); } - private: - uint32_t mask_; - }; -} -#endif diff --git a/PhysicsTools/PatUtils/interface/RefHelper.h b/PhysicsTools/PatUtils/interface/RefHelper.h deleted file mode 100644 index 4756266e9ba40..0000000000000 --- a/PhysicsTools/PatUtils/interface/RefHelper.h +++ /dev/null @@ -1,130 +0,0 @@ -#ifndef PhysicsTools_PatUtils_RefHelper_h -#define PhysicsTools_PatUtils_RefHelper_h - -#include "DataFormats/Common/interface/Ptr.h" -#include "DataFormats/Common/interface/ValueMap.h" -namespace pat { namespace helper { -/*** \brief A class to help manage references and associative containers in some tricky cases (e.g. selection by copy) -*/ -template -class RefHelper { - public: - typedef typename edm::Ptr Ref; - - /// Constructor taking a ValueMap of back-references daughter => mother. - RefHelper(const edm::ValueMap< Ref > &backRefMap) : backRefMap_(backRefMap) { } - - /// Returns a Ref to the direct parent of "ref", or a null Ref if "ref" is already root - Ref parentOrNull(const Ref &ref) const ; - - /// Returns a Ref to the direct parent of "ref", or "ref" itself if it's already root - Ref parentOrSelf(const Ref &ref) const ; - - /// Climbs back the Ref chain and returns the root of the branch starting from "ref" - Ref ancestorOrSelf(const Ref &ref) const ; - - bool isRoot(const Ref &ref) const ; - - /// true if old is some ancestor of young (it does not have to be the root) - bool isAncestorOf(const Ref &old, const Ref &young) const ; - - /// true if the two share the same root - bool sharedAncestor(const Ref &ref1, const Ref &ref2) const ; - - /// Recursively looks up map to find something associated to ref, or one of its parents. - /// Throws edm::Exception(edm::errors::InvalidReference) if there's no match - template - V recursiveLookup(const SomeRef &ref, const edm::ValueMap &map) const ; - - /// Looks up map to find something associated to the root ancestor of "ref" - /// Throws edm::Exception(edm::errors::InvalidReference) if there's no match - template - V ancestorLookup(const SomeRef &ref, const edm::ValueMap &map) const ; - - private: - const edm::ValueMap< Ref > & backRefMap_; -}; - -template -typename RefHelper::Ref RefHelper::parentOrNull(const RefHelper::Ref &ref) const { - if (backRefMap_.contains(ref.id())) { - try { - return backRefMap_[ref]; - } catch (edm::Exception &e) { - if (e.categoryCode() == edm::errors::InvalidReference) { - return Ref(); - } else { - throw; - } - } - } else { - return Ref(); - } -} - -template -typename RefHelper::Ref RefHelper::parentOrSelf(const RefHelper::Ref &ref) const { - Ref ret = parentOrNull(ref); - return ret.isNonnull() ? ret : ref; -} - -template -typename RefHelper::Ref RefHelper::ancestorOrSelf(const RefHelper::Ref &ref) const { - Ref ret = ref; - do { - Ref test = parentOrNull(ret); - if (test.isNull()) return ret; - ret = test; - } while (true); -} - - -template -bool RefHelper::isRoot(const RefHelper::Ref &ref) const { - return parentOrNull(ref).isNull(); -} - -template -bool RefHelper::isAncestorOf(const RefHelper::Ref &old, const RefHelper::Ref &young) const { - Ref test = young; - do { - if (test == old) return true; - test = parentOrNull(test); - } while (test.isNonnull()); - return false; -} - -template -bool RefHelper::sharedAncestor(const RefHelper::Ref &ref1, const RefHelper::Ref &ref2) const { - return ( ancestorOrSelf(ref1) == ancestorOrSelf(ref2) ); -} - -template -template -V RefHelper::recursiveLookup(const SomeRef &ref, const edm::ValueMap &map) const { - Ref test(ref); - do { - if (map.contains(test.id())) { - try { - return map[test]; - } catch (edm::Exception &e) { - if (e.categoryCode() != edm::errors::InvalidReference) { - throw; - } - } - } - test = parentOrNull(test); - } while (test.isNonnull()); - throw edm::Exception(edm::errors::InvalidReference) << - "RefHelper: recursive Lookup failed: neither the specified ref nor any of its parents are in the map.\n"; -} - -template -template -V RefHelper::ancestorLookup(const SomeRef &ref, const edm::ValueMap &map) const { - Ref tref(ref); - return map[ancestorOrSelf(tref)]; -} - -} } // namespace -#endif diff --git a/PhysicsTools/SelectorUtils/interface/Variables.h b/PhysicsTools/SelectorUtils/interface/Variables.h deleted file mode 100644 index b911a79e316b0..0000000000000 --- a/PhysicsTools/SelectorUtils/interface/Variables.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef SelectorUtils_Variables_h -#define SelectorUtils_Variables_h - -// short cut classes for reco::Candidate methods -// Benedikt Hegner, DESY - -#include "DataFormats/Candidate/interface/Candidate.h" - -class vEnergy { -public: - typedef reco::Candidate ValType; - vEnergy() {} - double operator()( const ValType& x ) const { return x.energy(); } -}; - -#endif diff --git a/PhysicsTools/UtilAlgos/interface/DummyMatchSelector.h b/PhysicsTools/UtilAlgos/interface/DummyMatchSelector.h deleted file mode 100644 index 8d0d99aab14d8..0000000000000 --- a/PhysicsTools/UtilAlgos/interface/DummyMatchSelector.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef DummyMatchSelector_h -#define DummyMatchSelector_h - -/** - Dummy class for preselection of object matches. -*/ - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -namespace reco { - - template - class DummyMatchSelector { - - public: - - DummyMatchSelector(const edm::ParameterSet& cfg) { } - - bool operator()( const T1 & c, const T2 & hlt ) const { return true; } - - }; - -} - - -#endif diff --git a/PhysicsTools/UtilAlgos/interface/EventSelector.h b/PhysicsTools/UtilAlgos/interface/EventSelector.h deleted file mode 100644 index 60176c8025f34..0000000000000 --- a/PhysicsTools/UtilAlgos/interface/EventSelector.h +++ /dev/null @@ -1 +0,0 @@ -#include "CommonTools/UtilAlgos/interface/EventSelector.h" diff --git a/PhysicsTools/UtilAlgos/interface/MCMatchSelector.h b/PhysicsTools/UtilAlgos/interface/MCMatchSelector.h deleted file mode 100644 index a54aecc246ba8..0000000000000 --- a/PhysicsTools/UtilAlgos/interface/MCMatchSelector.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef MCMatchSelector_h -#define MCMatchSelector_h -/* \class MCMatchSelector - * - * Extended version of MCTruthPairSelector. Preselects matches - * based on charge, pdgId and status. - */ - -#include -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -namespace reco { - template - class MCMatchSelector { - public: - MCMatchSelector(const edm::ParameterSet& cfg) : - checkCharge_(cfg.getParameter("checkCharge")) { - std::vector ids = - cfg.getParameter< std::vector >("mcPdgId"); - for ( std::vector::const_iterator i=ids.begin(); - i!=ids.end(); ++i ) ids_.insert(*i); - std::vector status = - cfg.getParameter< std::vector >("mcStatus"); - for ( std::vector::const_iterator i=status.begin(); - i!=status.end(); ++i ) status_.insert(*i); - } - /// true if match is possible - bool operator()( const T1 & c, const T2 & mc ) const { - if ( checkCharge_ && c.charge() != mc.charge() ) return false; - if ( !ids_.empty() ) { - if ( ids_.find(abs(mc.pdgId()))==ids_.end() ) return false; - } - if ( status_.empty() ) return true; - return status_.find(mc.status())!=status_.end(); - } - private: - bool checkCharge_; - std::set ids_; - std::set status_; - }; -} - -#endif diff --git a/PhysicsTools/UtilAlgos/interface/NtpProducer.h b/PhysicsTools/UtilAlgos/interface/NtpProducer.h deleted file mode 100755 index 5f0fab84a092f..0000000000000 --- a/PhysicsTools/UtilAlgos/interface/NtpProducer.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef UtilAlgos_NtpProducer_h -#define UtilAlgos_NtpProducer_h -/** \class NtpProducer - * - * Creates histograms defined in config file - * - * \author: Luca Lista, INFN - * - * Template parameters: - * - C : Concrete candidate collection type - * - */ -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "CommonTools/Utils/interface/StringObjectFunction.h" - -template -class NtpProducer : public edm::EDProducer { -public: - /// constructor from parameter set - NtpProducer( const edm::ParameterSet& ); - /// destructor - ~NtpProducer(); - -protected: - /// process an event - virtual void produce( edm::Event&, const edm::EventSetup& ); - -private: - /// label of the collection to be read in - edm::EDGetTokenT srcToken_; - /// variable tags - std::vector > > tags_; -}; - -template -NtpProducer::NtpProducer( const edm::ParameterSet& par ) : - srcToken_( consumes(par.template getParameter( "src" ) ) ) { - std::vector variables = - par.template getParameter >("variables"); - std::vector::const_iterator - q = variables.begin(), end = variables.end(); - for (; q!=end; ++q) { - std::string tag = q->getUntrackedParameter("tag"); - StringObjectFunction quantity(q->getUntrackedParameter("quantity")); - tags_.push_back(std::make_pair(tag, quantity)); - produces >(tag).setBranchAlias(tag); - } -} - -template -NtpProducer::~NtpProducer() { -} - -template -void NtpProducer::produce( edm::Event& iEvent, const edm::EventSetup& ) { - edm::Handle coll; - iEvent.getByToken(srcToken_, coll); - - typename std::vector > >::const_iterator - q = tags_.begin(), end = tags_.end(); - for(;q!=end; ++q) { - auto x = std::make_unique>(); - x->reserve(coll->size()); - for (typename C::const_iterator elem=coll->begin(); elem!=coll->end(); ++elem ) { - x->push_back(q->second(*elem)); - } - iEvent.put(std::move(x), q->first); - } -} - -#endif diff --git a/PhysicsTools/UtilAlgos/interface/SelectedOutputCollectionTrait.h b/PhysicsTools/UtilAlgos/interface/SelectedOutputCollectionTrait.h deleted file mode 100755 index 229e4b88144d1..0000000000000 --- a/PhysicsTools/UtilAlgos/interface/SelectedOutputCollectionTrait.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef UtilAlgos_SelectedOutputCollectionTrait_h -#define UtilAlgos_SelectedOutputCollectionTrait_h -/* \class helper SelectedOutputCollection - * - * \author Luca Lista, INFN - * - */ -#include "DataFormats/Common/interface/AssociationVector.h" -#include "DataFormats/Common/interface/RefToBase.h" -#include "DataFormats/Common/interface/RefToBaseVector.h" -#include "DataFormats/Common/interface/RefToBaseProd.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/View.h" - -namespace helper { - - template - struct SelectedOutputCollectionTrait { - typedef InputCollection type; - }; - - template - struct SelectedOutputCollectionTrait, C> > { - typedef typename edm::RefProd::product_type type; - }; - - template - struct SelectedOutputCollectionTrait, C> > { - typedef typename edm::RefToBaseVector type; - }; - - template - struct SelectedOutputCollectionTrait > { - typedef typename edm::RefToBaseVector type; - }; - - template - struct SelectedOutputCollectionTrait > { - typedef typename edm::RefToBaseVector type; - }; - - template - struct SelectedOutputCollectionTrait > { - typedef typename edm::RefVector type; - }; - -} - -#endif diff --git a/PhysicsTools/UtilAlgos/interface/SelectionAdderTrait.h b/PhysicsTools/UtilAlgos/interface/SelectionAdderTrait.h deleted file mode 100755 index d830b07f6bc8c..0000000000000 --- a/PhysicsTools/UtilAlgos/interface/SelectionAdderTrait.h +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef UtilAlgos_SelectionAdderTrait_h -#define UtilAlgos_SelectionAdderTrait_h -/* \class SelectionAdderTrait - * - * \author Luca Lista, INFN - */ -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/PtrVector.h" -#include "DataFormats/Common/interface/RefToBaseVector.h" -#include "DataFormats/Common/interface/RefToBaseProd.h" -#include "DataFormats/Common/interface/RefProd.h" -#include "DataFormats/Common/interface/AssociationVector.h" - -namespace helper { - - template - struct SelectionCopyAdder { - template - void operator()( StoreContainer & selected, const edm::Handle & c, size_t idx ) { - selected.push_back( ( * c )[ idx ] ); - } - }; - - template - struct SelectionPointerAdder { - template - void operator()( StoreContainer & selected, const edm::Handle & c, size_t idx ) { - selected.push_back( & ( * c )[ idx ] ); - } - }; - - template - struct SelectionPointerDerefAdder { - template - void operator()( StoreContainer & selected, const edm::Handle & c, size_t idx ) { - selected.push_back( & * ( * c )[ idx ] ); - } - }; - - template - struct SelectionFirstPointerAdder { - template - void operator()( StoreContainer & selected, const edm::Handle & c, size_t idx ) { - selected.push_back( & * ( ( * c )[ idx ].first ) ); - } - }; - - template - struct SelectionFirstRefAdder { - template - void operator()( StoreContainer & selected, const edm::Handle & c, size_t idx ) { - selected.push_back( ( * c )[ idx ].first ); - } - }; - - template - struct SelectionRefAdder { - template - void operator()( StoreContainer & selected, const edm::Handle & c, size_t idx ) { - selected.push_back( edm::Ref( c, idx ) ); - } - }; - - template - struct SelectionRefViewAdder { - void operator()( edm::RefToBaseVector & selected, const edm::Handle > & c, size_t idx ) { - selected.push_back( c->refAt( idx ) ); - } - }; - - template - struct SelectionPtrViewAdder { - void operator()( edm::PtrVector & selected, const edm::Handle > & c, size_t idx ) { - selected.push_back( c->ptrAt( idx ) ); - } - }; - - template - struct SelectionAdderTrait { - static_assert(sizeof(InputCollection) == 0); - }; - - template - struct SelectionAdderTrait > { - typedef SelectionPointerAdder > type; - }; - - template - struct SelectionAdderTrait > { - typedef SelectionRefAdder > type; - }; - - template - struct SelectionAdderTrait, edm::RefVector > { - typedef SelectionCopyAdder > type; - }; - - template - struct SelectionAdderTrait, std::vector > { - typedef SelectionPointerDerefAdder > type; - }; - - template - struct SelectionAdderTrait, edm::RefToBaseVector > { - typedef SelectionCopyAdder > type; - }; - - template - struct SelectionAdderTrait, std::vector > { - typedef SelectionPointerDerefAdder > type; - }; - - template - struct SelectionAdderTrait, C>, std::vector > { - typedef SelectionFirstPointerAdder > type; - }; - - template - struct SelectionAdderTrait, C>, std::vector > { - typedef SelectionFirstPointerAdder > type; - }; - - template - struct SelectionAdderTrait, C>, edm::RefVector > { - typedef SelectionFirstRefAdder > type; - }; - - template - struct SelectionAdderTrait, C>, - edm::RefToBaseVector > { - typedef SelectionFirstRefAdder > type; - }; - - template - struct SelectionAdderTrait, edm::RefToBaseVector > { - typedef SelectionRefViewAdder type; - }; - - template - struct SelectionAdderTrait, edm::PtrVector > { - typedef SelectionPtrViewAdder type; - }; - -} - -#endif diff --git a/PhysicsTools/UtilAlgos/interface/StoreContainerTrait.h b/PhysicsTools/UtilAlgos/interface/StoreContainerTrait.h deleted file mode 100755 index f563c548df5e4..0000000000000 --- a/PhysicsTools/UtilAlgos/interface/StoreContainerTrait.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef UtilAlgos_StoreContainerTrait_h -#define UtilAlgos_StoreContainerTrait_h -/* \class helper::StoreContainerTrait - * - * \author Luca Lista, INFN - */ -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/RefToBaseVector.h" -#include "DataFormats/Common/interface/PtrVector.h" -#include "DataFormats/Common/interface/AssociationVector.h" - -namespace helper { - template - struct StoreContainerTrait { - typedef std::vector type; - }; - - template - struct StoreContainerTrait > { - typedef edm::RefVector type; - }; - - template - struct StoreContainerTrait > { - typedef edm::RefToBaseVector type; - }; - - template - struct StoreContainerTrait > { - typedef edm::PtrVector type; - }; - - template - struct StoreContainerTrait > { - typedef typename StoreContainerTrait::type type; - }; -} - -#endif diff --git a/PhysicsTools/UtilAlgos/interface/TwoObjectCalculator.h b/PhysicsTools/UtilAlgos/interface/TwoObjectCalculator.h deleted file mode 100644 index cc3bc3b8b048e..0000000000000 --- a/PhysicsTools/UtilAlgos/interface/TwoObjectCalculator.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CommonTools_UtilAlgos_TwoObjectCalculator_H -#define CommonTools_UtilAlgos_TwoObjectCalculator_H - -#include -#include - -struct CosDphiCalculator { - template double operator()( const LHS & lhs, const RHS & rhs){ - double cdphi = cos(lhs.phi()-rhs.phi()); - return cdphi; - } - static std::string calculationType(){ return "CosDphiCalculator";} - static std::string description() { return " calculate cos(Delta Phi(Obj1, Obj2))";} -}; - -#endif diff --git a/PhysicsTools/Utilities/interface/GammaPropagator.h b/PhysicsTools/Utilities/interface/GammaPropagator.h deleted file mode 100644 index d9c31e730722c..0000000000000 --- a/PhysicsTools/Utilities/interface/GammaPropagator.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef PhysicsTools_Utilities_GammaPropagator_h -#define PhysicsTools_Utilities_GammaPropagator_h - -namespace funct { - - struct GammaPropagator { - GammaPropagator() {} - double operator()(double mass) const { - if(mass <= 0) return 0; - return 1./(mass*mass); - } - }; - -} - -#endif diff --git a/PhysicsTools/Utilities/interface/GammaZInterference.h b/PhysicsTools/Utilities/interface/GammaZInterference.h deleted file mode 100644 index e6a09214baac3..0000000000000 --- a/PhysicsTools/Utilities/interface/GammaZInterference.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef PhysicsTools_Utilities_GammaZInterference_h -#define PhysicsTools_Utilities_GammaZInterference_h -#include "PhysicsTools/Utilities/interface/Parameter.h" - -#include - -namespace funct { - - struct GammaZInterference { - GammaZInterference(const Parameter& m, const Parameter& g) : mass(m.ptr()), width(g.ptr()) {} - GammaZInterference(std::shared_ptr m, std::shared_ptr g) : mass(m), width(g) {} - double operator()(double x) const { - double m2 = *mass * (*mass); - double g2 = *width * (*width); - double g2OverM2 = g2 / m2; - double s = x * x; - double deltaS = s - m2; - double interference = 0; - if (fabs(deltaS / m2) < 16) { - double prop = deltaS * deltaS + s * s * g2OverM2; - interference = 5 * (*mass) * deltaS / prop; - } - return interference; - } - std::shared_ptr mass, width; - }; - -} // namespace funct - -#endif diff --git a/PhysicsTools/Utilities/interface/Number.h b/PhysicsTools/Utilities/interface/Number.h deleted file mode 100644 index 017216302d631..0000000000000 --- a/PhysicsTools/Utilities/interface/Number.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef PhysicsTools_Utilities_Number_h -#define PhysicsTools_Utilities_Number_h - -namespace funct { - - struct Number { - Number(double value) : value_(value) { } - double operator()(double x) const { return value_; } - private: - double value_; - }; - -} - -#endif diff --git a/PhysicsTools/Utilities/interface/ZLineShape.h b/PhysicsTools/Utilities/interface/ZLineShape.h deleted file mode 100644 index faa936648c335..0000000000000 --- a/PhysicsTools/Utilities/interface/ZLineShape.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef PhysicsTools_Utilities_ZLineShape_h -#define PhysicsTools_Utilities_ZLineShape_h -#include "PhysicsTools/Utilities/interface/BreitWigner.h" -#include "PhysicsTools/Utilities/interface/GammaPropagator.h" -#include "PhysicsTools/Utilities/interface/GammaZInterference.h" -#include "PhysicsTools/Utilities/interface/Parameter.h" - -namespace funct { - class ZLineShape { - public: - ZLineShape(const Parameter& m, const Parameter& g, const Parameter& Ng, const Parameter& Ni) - : Ngamma(Ng.ptr()), Nint(Ni.ptr()), bw_(m, g), gp_(), gzi_(m, g) {} - ZLineShape(std::shared_ptr m, - std::shared_ptr g, - std::shared_ptr Ng, - std::shared_ptr Ni) - : Ngamma(Ng), Nint(Ni), bw_(m, g), gp_(), gzi_(m, g) {} - double operator()(double x) const { return (1.0 - *Nint - *Ngamma) * bw_(x) + *Ngamma * gp_(x) + *Nint * gzi_(x); } - std::shared_ptr Ngamma, Nint; - - private: - BreitWigner bw_; - GammaPropagator gp_; - GammaZInterference gzi_; - }; - -} // namespace funct - -#endif diff --git a/RecoEcal/EgammaClusterProducers/interface/PiZeroDiscriminatorProducer.h b/RecoEcal/EgammaClusterProducers/interface/PiZeroDiscriminatorProducer.h deleted file mode 100644 index f5ca3698b9954..0000000000000 --- a/RecoEcal/EgammaClusterProducers/interface/PiZeroDiscriminatorProducer.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef RecoEcal_EgammaClusterProducers_PiZeroDiscriminatorProducer_h -#define RecoEcal_EgammaClusterProducers_PiZeroDiscriminatorProducer_h - - -#include - -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "DataFormats/EcalDetId/interface/ESDetId.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" - -#include "RecoEcal/EgammaClusterAlgos/interface/EndcapPiZeroDiscriminatorAlgo.h" - -#include "TH1.h" -class TFile; - - -// authors A. Kyriakis, D. Maletic - -class PiZeroDiscriminatorProducer : public edm::EDProducer { - - public: - - typedef math::XYZPoint Point; - - explicit PiZeroDiscriminatorProducer (const edm::ParameterSet& ps); - - ~PiZeroDiscriminatorProducer(); - - virtual void produce( edm::Event& evt, const edm::EventSetup& es); - - private: - - int nEvt_; // internal counter of events - - //clustering parameters: - std::string preshClusterShapeCollectionX_; // secondary name to be given to collection of cluster produced in this module - std::string preshClusterShapeCollectionY_; - std::string preshClusterShapeProducer_; - - std::string barrelClusterShapeMapProducer_; - std::string barrelClusterShapeMapCollection_; - std::string endcapClusterShapeMapProducer_; - std::string endcapClusterShapeMapCollection_; - - std::string photonCorrCollectionProducer_; - std::string correctedPhotonCollection_; - std::string PhotonPi0DiscriminatorAssociationMap_; - - EndcapPiZeroDiscriminatorAlgo * presh_pi0_algo; // algorithm doing the real work - - EndcapPiZeroDiscriminatorAlgo::DebugLevel_pi0 debugL_pi0; -}; -#endif - diff --git a/RecoEgamma/EgammaTools/interface/ConversionTools.h b/RecoEgamma/EgammaTools/interface/ConversionTools.h deleted file mode 100644 index 49907adb05a8d..0000000000000 --- a/RecoEgamma/EgammaTools/interface/ConversionTools.h +++ /dev/null @@ -1 +0,0 @@ -#warning "Obsolete header, include CommonTools/Egamma/interface/ConversionTools.h instead" diff --git a/RecoEgamma/EgammaTools/interface/EffectiveAreas.h b/RecoEgamma/EgammaTools/interface/EffectiveAreas.h deleted file mode 100644 index ee1f9cfd46e6a..0000000000000 --- a/RecoEgamma/EgammaTools/interface/EffectiveAreas.h +++ /dev/null @@ -1 +0,0 @@ -#warning "Obsolete header, include CommonTools/Egamma/interface/EffectiveAreas.h instead" diff --git a/RecoHI/HiJetAlgos/interface/UECalibration.h b/RecoHI/HiJetAlgos/interface/UECalibration.h deleted file mode 100644 index 4221dec146ddc..0000000000000 --- a/RecoHI/HiJetAlgos/interface/UECalibration.h +++ /dev/null @@ -1,162 +0,0 @@ -#ifndef __HiJetAlgos_UECalibration_h__ -#define __HiJetAlgos_UECalibration_h__ - -///////////////////////////////////////////////////////////////////// -// SVD Block Predictor -#include -#include -#include -#include - -#include "FWCore/ParameterSet/interface/FileInPath.h" - -struct UECalibration { - UECalibration(const std::vector &v) - { - np[0] = 3; // Number of reduced PF ID (track, ECAL, HCAL) - np[1] = 15; // Number of pseudorapidity block - np[2] = 5; // Fourier series order - np[3] = 2; // Re or Im - np[4] = 82; // Number of feature parameter - - ni0[0] = np[1]; - ni0[1] = 344; - - ni1[0] = np[1]; - ni1[1] = 344; - - ni2[0] = np[1]; - ni2[1] = 82; - - unsigned int Nnp_full = np[0] * np[1] * np[2] * np[3] * np[4]; - unsigned int Nnp = np[0] * np[1] * (1 + (np[2] - 1) * np[3]) * np[4]; - unsigned int Nni0 = ni0[0]*ni0[1]; - unsigned int Nni1 = ni1[0]*ni1[1]; - unsigned int Nni2 = ni2[0]*ni2[1]; - - memset(ue_predictor_pf, 0, Nnp_full * sizeof(float)); - memset(ue_interpolation_pf0, 0, Nni0 * sizeof(float)); - memset(ue_interpolation_pf1, 0, Nni1 * sizeof(float)); - memset(ue_interpolation_pf2, 0, Nni2 * sizeof(float)); - - for (index = 0; index < Nnp + Nni0 + Nni1 + Nni2; index++) { - float val = v[index]; - int bin0, bin1, bin2, bin3, bin4; - - if (index < Nnp){ - bin4 = index % np[4]; - - unsigned int u = (index / np[4]) % (1 + (np[2] - 1) * np[3]); - - if (u == 0) { - bin2 = 0; - bin3 = 0; - } - else { - bin2 = (u - 1) / np[3] + 1; - bin3 = (u - 1) % np[3]; - } - - bin1 = ((index / np[4]) / (1 + (np[2] - 1) * np[3])) % np[1]; - bin0 = ((index / np[4]) / (1 + (np[2] - 1) * np[3])) / np[1]; - - ue_predictor_pf[bin0][bin1][bin2][bin3][bin4] = val; - } - else if (index < Nnp + Nni0) { - bin1 = (index - Nnp) % ni0[1]; - bin0 = (index - Nnp) / ni0[1]; - ue_interpolation_pf0[bin0][bin1] = val; - } - else if (index < Nnp + Nni0 + Nni1) { - bin1 = (index - Nnp - Nni0) % ni1[1]; - bin0 = (index - Nnp - Nni0) / ni1[1]; - ue_interpolation_pf1[bin0][bin1] = val; - } - else { - bin1 = (index - Nnp - Nni0 - Nni1) % ni2[1]; - bin0 = (index - Nnp - Nni0 - Nni1) / ni2[1]; - ue_interpolation_pf2[bin0][bin1] = val; - } - } - } - - UECalibration(std::string calibrationFile){ - np[0] = 3; // Number of reduced PF ID (track, ECAL, HCAL) - np[1] = 15; // Number of pseudorapidity block - np[2] = 5; // Fourier series order - np[3] = 2; // Re or Im - np[4] = 82; // Number of feature parameter - - ni0[0] = np[1]; - ni0[1] = 344; - - ni1[0] = np[1]; - ni1[1] = 344; - - ni2[0] = np[1]; - ni2[1] = 82; - - index = 0; - - unsigned int Nnp_full = np[0] * np[1] * np[2] * np[3] * np[4]; - unsigned int Nnp = np[0] * np[1] * (1 + (np[2] - 1) * np[3]) * np[4]; - unsigned int Nni0 = ni0[0]*ni0[1]; - unsigned int Nni1 = ni1[0]*ni1[1]; - unsigned int Nni2 = ni2[0]*ni2[1]; - - memset(ue_predictor_pf, 0, Nnp_full * sizeof(float)); - memset(ue_interpolation_pf0, 0, Nni0 * sizeof(float)); - memset(ue_interpolation_pf1, 0, Nni1 * sizeof(float)); - memset(ue_interpolation_pf2, 0, Nni2 * sizeof(float)); - - edm::FileInPath ueData(calibrationFile.data()); - std::string qpDataName = ueData.fullPath(); - std::ifstream in( qpDataName.c_str() ); - std::string line; - - while( std::getline( in, line)){ - if(!line.size() || line[0]=='#') { - continue; - } - std::istringstream linestream(line); - float val; - int bin0, bin1, bin2, bin3, bin4; - if(index < Nnp){ - // cout<<"predictor "<>bin0>>bin1>>bin2>>bin3>>bin4>>val; - ue_predictor_pf[bin0][bin1][bin2][bin3][bin4] = val; - }else if(index < Nnp + Nni0){ - // cout<<"inter_0 "<>bin0>>bin1>>val; - ue_interpolation_pf0[bin0][bin1] = val; - }else if(index < Nnp + Nni0 + Nni1){ - // cout<<"inter_1 "<>bin0>>bin1>>val; - ue_interpolation_pf1[bin0][bin1] = val; - }else if(index < Nnp + Nni0 + Nni1 + Nni2){ - // cout<<"inter_2 "<>bin0>>bin1>>val; - ue_interpolation_pf2[bin0][bin1] = val; - } - ++index; - } - } - - unsigned int index, - np[5], - ni0[2], - ni1[2], - ni2[2]; - - float ue_predictor_pf[3][15][5][2][82], - ue_interpolation_pf0[15][344], - ue_interpolation_pf1[15][344], - ue_interpolation_pf2[15][82]; - -}; - - -#endif - - - diff --git a/RecoJets/JetAnalyzers/doc/myJetAna.html b/RecoJets/JetAnalyzers/doc/myJetAna.html deleted file mode 100644 index 3fbc3e17294f7..0000000000000 --- a/RecoJets/JetAnalyzers/doc/myJetAna.html +++ /dev/null @@ -1,90 +0,0 @@ -

myJetAna

- -
-

Compile and Run

- -

- -

Checkout -

-  scramv1 project CMSSW CMSSW_2_1_10
-  cd CMSSW_2_1_10/src 
-  eval `scramv1 runtime -csh` 
-  cvs co RecoJets/JetAnalyzers
-
- -

Compile -

-  scramv1 b 
-
- -

Run -

-  cmsRun RecoJets/JetAnalyzers/test/cruzet4.py
-
- -

You will get a bunch of errors about missing files... but eventually you should get -printout which looks like: - -

-  Begin processing the 108006th record. Run 57381, Event 63185, LumiSection 4 at 14-Sep-2008 14:12:04 CDT
-  >>> processing event # run: 57381 event: 63185 time 5235845788462952912
-  Begin processing the 108007th record. Run 57381, Event 63186, LumiSection 4 at 14-Sep-2008 14:12:04 CDT
-  >>> processing event # run: 57381 event: 63186 time 5235845788462948185
-  Begin processing the 108008th record. Run 57381, Event 63187, LumiSection 4 at 14-Sep-2008 14:12:04 CDT
-  >>> processing event # run: 57381 event: 63187 time 5235845792757001089
-  Begin processing the 108009th record. Run 57381, Event 63188, LumiSection 4 at 14-Sep-2008 14:12:04 CDT
-
- -

You can stop the event processing by hitting Ctrl-c. The job should end and the output -files should be written. - -


-

Event Analysis

-

The example will run over the cruzet4 reconstructed files -and write out histograms to the file myhisto.root. - -

The code to analize events is located in: -

-  RecoJets/JetAnalyzers/src/myJetAna.cc
-  RecoJets/JetAnalyzers/interface/myJetAna.h
-
- -
-

Event Filter

- -The events passing the filter will be written to the file -FilteredEvents.root. - -

The code to filter events is located in: -

-  RecoJets/JetAnalyzers/src/myFilter.cc
-  RecoJets/JetAnalyzers/interface/myFilter.h
-
- -

The filter loops over the jets and selects events passing a minimum -jet pt requirement or events with jets that have some EM energy: -

-  for ( CaloJetCollection::const_iterator ijet=jets->begin(); ijet!=jets->end(); ijet++) {
-    if (ijet->pt() > 100.)                filter_Pt  = true;
-    if (ijet->emEnergyFraction() > 0.05)  filter_EMF = true;
-  }
-
- - - -
-

Scanning Events

- -

To view events you can use fireworks/cmsShow. This is a standalone -event display which works reasonably well. -

-  wget http://cern.ch/cms-sdt/fireworks/cmsShow21.tar.gz
-  tar xzf cmsShow21.tar.gz
-  cmsShow FilteredEvents.root
-
- -

If this does not work, refer to the instructions which can be found at: -WorkBookFireworks - - diff --git a/RecoJets/JetAnalyzers/interface/CaloTowerBoundries.h b/RecoJets/JetAnalyzers/interface/CaloTowerBoundries.h deleted file mode 100644 index 7790a185aaa0a..0000000000000 --- a/RecoJets/JetAnalyzers/interface/CaloTowerBoundries.h +++ /dev/null @@ -1,139 +0,0 @@ -// File: CaloTowerBoundaries.h -// Description: The eta boundaries of the CaloTowers used by JetAnalysis.cc -// Author: Anwar Bhatti -// Date: August 31, 2006 -// -#ifndef CALOTOWERETABOUNDRIES_HH -#define CALOTOWERETABOUNDRIES_HH - -const int NETA=82; -const float CaloTowerEtaBoundriesPositiveOnly[42]={0.000, - 0.087, - 0.174, - 0.261, - 0.348, - 0.435, - 0.522, - 0.609, - 0.696, - 0.783, - 0.879, - 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.853, - 2.964, - 3.139, - 3.314, - 3.489, - 3.664, - 3.839, - 4.013, - 4.191, - 4.363, - 4.538, - 4.716, - 4.889, - 5.191}; - - - const float CaloTowerEtaBoundries[83]={ - -5.191, - -4.889, - -4.716, - -4.538, - -4.363, - -4.191, - -4.013, - -3.839, - -3.664, - -3.489, - -3.314, - -3.139, - -2.964, - -2.853, - -2.650, - -2.500, - -2.322, - -2.172, - -2.043, - -1.930, - -1.830, - -1.740, - -1.653, - -1.566, - -1.479, - -1.392, - -1.305, - -1.218, - -1.131, - -1.044, - -0.957, - -0.879, - -0.783, - -0.696, - -0.609, - -0.522, - -0.435, - -0.348, - -0.261, - -0.174, - -0.087, - 0.000, - 0.087, - 0.174, - 0.261, - 0.348, - 0.435, - 0.522, - 0.609, - 0.696, - 0.783, - 0.879, - 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.853, - 2.964, - 3.139, - 3.314, - 3.489, - 3.664, - 3.839, - 4.013, - 4.191, - 4.363, - 4.538, - 4.716, - 4.889, - 5.191}; - -#endif diff --git a/RecoJets/JetAnalyzers/interface/MyCluster.h b/RecoJets/JetAnalyzers/interface/MyCluster.h deleted file mode 100644 index 631c52366317f..0000000000000 --- a/RecoJets/JetAnalyzers/interface/MyCluster.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef MYCLUSTER_H -#define MYCLUSTER_H -#include "CLHEP/Vector/LorentzVector.h" - -#include - -enum {ClusterEm=0,ClusterHd=1,ClusterEmHd=2,ClusterTower=3,RecHitEm=4,RecHitHd=5,CaloTowerEm=6,CaloTowerHd=7}; - -struct MatchParam{ - int index; - double distance; -}; - -struct CalCell{ - CLHEP::HepLorentzVector Momentum; - int pid; - bool used; -}; - - -struct CalCluster{ - CLHEP::HepLorentzVector Momentum; - double em; - double hd; - int type; - int ncells; - std::vector clusterCellList; - std::vector MatchedClusters; - std::vector SubClusterList; -}; - -class CellGreater { - public: - bool operator () (const CalCell& i, const CalCell& j) { - return (i.Momentum.e() > j.Momentum.e()); - } -}; - -class CellEtGreater { - public: - bool operator () (const CalCell& i, const CalCell& j) { - return (i.Momentum.perp() > j.Momentum.perp()); - } -}; - -class ClusterGreater { - public: - bool operator () (const CalCluster& i, const CalCluster& j) { - return (i.Momentum.e() > j.Momentum.e()); - } -}; - -class ClusterEtGreater { - public: - bool operator () (const CalCluster& i, const CalCluster& j) { - return (i.Momentum.perp() > j.Momentum.perp()); - } -}; -class ClusterPtGreater { - public: - - bool operator () (const CalCluster& i, const CalCluster& j) { - return (i.Momentum.perp() > j.Momentum.perp()); - } -}; - - -#endif diff --git a/RecoJets/JetAnalyzers/interface/myFilter.h b/RecoJets/JetAnalyzers/interface/myFilter.h deleted file mode 100644 index 43492e435f648..0000000000000 --- a/RecoJets/JetAnalyzers/interface/myFilter.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef RecoJets_myFilter_h -#define RecoJets_myFilter_h - -#include "FWCore/Framework/interface/EDFilter.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Utilities/interface/InputTag.h" - -#include - -class myFilter : public edm::EDFilter { - -public: - myFilter(const edm::ParameterSet& ); - virtual ~myFilter(); - virtual bool filter(edm::Event& e, edm::EventSetup const& c); - virtual void beginJob(); - virtual void endJob(); - -private: - - int _nEvent; - int _nTotal; - - int _acceptedEvt; - - int _passPt; - int _passNTrks; - int _passEMF; - int _passNJets; - int _passDiJet; - int _passNTowers; - int _passMET; - int _passMETSig; - int _passHighPtTower; - int _passNRBX; - int _passNHPDNoise; - int _passHLT; - int _passNPMTHits; - int _passNMultiPMTHits; - int _passPKAM; - int _passHFMET; - int _passNoiseSummary; - int _passNoiseSummaryEMF; - int _passNoiseSummaryE2E10; - int _passNoiseSummaryNHITS; - int _passNoiseSummaryADC0; - int _passNoiseSummaryNoOther; - int _passOERatio; - int _passTime; - int _passHFTime; - int _passHBHETime; - int _passHFFlagged; - int _passHFHighEnergy; - - int _NoiseResult[10]; - - std::string CaloJetAlgorithm; - edm::InputTag theTriggerResultsLabel; - edm::InputTag hcalNoiseSummaryTag_; -}; - -#endif diff --git a/RecoJets/JetAnalyzers/interface/myJetAna.h b/RecoJets/JetAnalyzers/interface/myJetAna.h deleted file mode 100755 index fb8ec0ff458e0..0000000000000 --- a/RecoJets/JetAnalyzers/interface/myJetAna.h +++ /dev/null @@ -1,487 +0,0 @@ -#ifndef RecoExamples_myJetAna_h -#define RecoExamples_myJetAna_h -#include -#include -#include -#include - -/* \class myJetAna - * - * \author Frank Chlebana - * - * \version 1 - * - */ -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" - -// class TFile; - -/**** -class RBX { - RBX(); - - private: - int nTowers; - int ieta; - int iphi; - float energy; - float time; -}; - -class RBXCollection { - - RBXCollection(); - void addRBX(RBX r) {rbx_.push_back(r)}; - - private: - std::vector rbx_; - -}; -*****/ - - -class myJetAna : public edm::EDAnalyzer { - -public: - myJetAna( const edm::ParameterSet & ); - -private: - void beginJob( ); - void analyze ( const edm::Event& , const edm::EventSetup& ); - void endJob(); - - std::string CaloJetAlgorithm; - std::string GenJetAlgorithm; - edm::InputTag theTriggerResultsLabel; - edm::InputTag hcalNoiseSummaryTag_; - std::string JetCorrectionService; - - int totBNC, nBNC[4000]; - - // --- Passed selection cuts - TH1F *h_pt; - TH1F *h_ptTower; - TH1F *h_ptRBX; - TH1F *h_ptHPD; - TH1F *h_et; - TH1F *h_eta; - TH1F *h_phi; - // --- - - // --- RecHits - TH1F *HBEneOOT; - TH1F *HEEneOOT; - TH1F *HFEneOOT; - TH1F *HOEneOOT; - - TH1F *HBEneOOTTh; - TH1F *HEEneOOTTh; - TH1F *HFEneOOTTh; - TH1F *HOEneOOTTh; - - TH1F *HBEneOOTTh1; - TH1F *HEEneOOTTh1; - TH1F *HFEneOOTTh1; - TH1F *HOEneOOTTh1; - - - TH1F *HBEneTThr; - TH1F *HEEneTThr; - TH1F *HFEneTThr; - - TH1F *HBEne; - TH1F *HBEneTh; - TH1F *HBEneTh1; - TH1F *HBEneX; - TH1F *HBEneY; - TH1F *HBTime; - TH1F *HBTimeTh; - TH1F *HBTimeTh1; - TH1F *HBTimeTh2; - TH1F *HBTimeTh3; - TH1F *HBTimeThR; - TH1F *HBTimeTh1R; - TH1F *HBTimeTh2R; - TH1F *HBTimeTh3R; - - TH1F *HBTimeFlagged; - TH1F *HBTimeThFlagged; - TH1F *HBTimeTh1Flagged; - TH1F *HBTimeTh2Flagged; - - TH1F *HBTimeFlagged2; - TH1F *HBTimeThFlagged2; - TH1F *HBTimeTh1Flagged2; - TH1F *HBTimeTh2Flagged2; - - TH1F *HBTimeX; - TH1F *HBTimeY; - TH1F *HEEne; - TH1F *HEEneTh; - TH1F *HEEneTh1; - TH1F *HEEneX; - TH1F *HEEneY; - TH1F *HEposEne; - TH1F *HEnegEne; - TH1F *HETime; - TH1F *HETimeTh; - TH1F *HETimeTh1; - TH1F *HETimeTh2; - TH1F *HETimeTh3; - TH1F *HETimeThR; - TH1F *HETimeTh1R; - TH1F *HETimeTh2R; - TH1F *HETimeTh3R; - - TH1F *HETimeFlagged; - TH1F *HETimeThFlagged; - TH1F *HETimeTh1Flagged; - TH1F *HETimeTh2Flagged; - - TH1F *HETimeFlagged2; - TH1F *HETimeThFlagged2; - TH1F *HETimeTh1Flagged2; - TH1F *HETimeTh2Flagged2; - - TH1F *HETimeX; - TH1F *HETimeY; - TH1F *HEposTime; - TH1F *HEnegTime; - TH1F *HFLSRatio; - TH1F *HFOERatio; - TH1F *HFEnePMT0; - TH1F *HFEnePMT1; - TH1F *HFEnePMT2; - TH1F *HFEne; - TH1F *HFEneFlagged; - TH1F *HFEneFlagged2; - TH1F *HFEneTh; - TH1F *HFEneTh1; - TH1F *HFTimePMT0; - TH1F *HFTimePMT1; - TH1F *HFTimePMT2; - TH1F *HFTime; - TH1F *PMTHits; - TH1F *HFTimeFlagged; - TH1F *HFTimeFlagged2; - TH1F *HFTimeThFlagged2; - TH1F *HFTimeTh1Flagged2; - TH1F *HFTimeTh2Flagged2; - TH1F *HFTimeTh3Flagged2; - TH1F *HFTimeFlagged3; - TH1F *HFTimeThFlagged3; - TH1F *HFTimeTh1Flagged3; - TH1F *HFTimeTh2Flagged3; - TH1F *HFTimeTh3Flagged3; - TH1F *HFTimeTh; - TH1F *HFTimeTh1; - TH1F *HFTimeTh2; - TH1F *HFTimeTh3; - TH1F *HFTimeThR; - TH1F *HFTimeTh1R; - TH1F *HFTimeTh2R; - TH1F *HFTimeTh3R; - TH1F *TrkMultFlagged0; - TH1F *TrkMultFlagged1; - TH1F *TrkMultFlagged2; - TH1F *TrkMultFlagged3; - TH1F *TrkMultFlagged4; - TH1F *TrkMultFlaggedM; - TH1F *HFTimeThFlagged; - TH1F *HFTimeTh2Flagged; - TH1F *HFTimeTh3Flagged; - TH1F *HFTimeThFlaggedR; - TH1F *HFTimeThFlaggedR1; - TH1F *HFTimeThFlaggedR2; - TH1F *HFTimeThFlaggedR3; - TH1F *HFTimeThFlaggedR4; - TH1F *HFTimeThFlaggedRM; - TH1F *HFEneP; - TH1F *HFTimeP; - TH1F *HFTimePMa; - TH1F *HFTimePM; - TH1F *HFEneM; - TH1F *HFTimeM; - TH1F *HFLEne; - TH1F *HFLEneNoS; - TH1F *HFLEneNoSFlagged; - TH1F *HFLEneNoSFlaggedN; - TH1F *HFLTime; - TH1F *HFSEneAll; - TH1F *HFSEneAllF; - TH1F *HFLEneAll; - TH1F *HFLEneAllF; - TH1F *HFSEne; - TH1F *HFSEneNoL; - TH1F *HFSEneNoLFlagged; - TH1F *HFSEneNoLFlaggedN; - TH2F *HFLvsS; - - TH2F *HBTvsE; - TH2F *HETvsE; - TH2F *HFTvsE; - TH2F *HFTvsEFlagged; - TH2F *HFTvsEFlagged2; - TH2F *HFTvsEThr; - TH2F *HFTvsEFlaggedThr; - TH2F *HFTvsEFlagged2Thr; - TH2F *HOTvsE; - - TH1F *HFSTime; - TH1F *HOEne; - TH1F *HOEneTh; - TH1F *HOEneTh1; - TH1F *HOTime; - TH1F *HOTimeTh; - TH1F *HFEtaFlagged; - TH1F *HFEtaFlaggedL; - TH1F *HFEtaFlaggedLN; - TH1F *HFEtaFlaggedS; - TH1F *HFEtaFlaggedSN; - - TProfile *HFEtaNFlagged; - TH2F *HOocc; - TH2F *HBocc; - TH2F *HEocc; - TH2F *HFocc; - TH2F *HFoccTime; - TH2F *HFEtaPhiNFlagged; - TH2F *HFoccFlagged; - TH2F *HFoccFlagged2; - TH2F *HOoccOOT; - TH2F *HBoccOOT; - TH2F *HEoccOOT; - TH2F *HFoccOOT; - TH1F *HOSEne; - TH1F *HOSTime; - TH1F *HOHEne; - TH1F *HOHTime; - TH1F *HOHr0Ene; - TH1F *HOHr0Time; - TH1F *HOHrm1Ene; - TH1F *HOHrm1Time; - TH1F *HOHrm2Ene; - TH1F *HOHrm2Time; - TH1F *HOHrp1Ene; - TH1F *HOHrp1Time; - TH1F *HOHrp2Ene; - TH1F *HOHrp2Time; - TH1F *EBEne; - TH1F *EBEneTh; - TH1F *EBEneX; - TH1F *EBEneY; - TH1F *EBTime; - TH1F *EBTimeTh; - TH1F *EBTimeX; - TH1F *EBTimeY; - TH1F *EEEne; - TH1F *EEEneTh; - TH1F *EEEneX; - TH1F *EEEneY; - TH1F *EEnegEne; - TH1F *EEposEne; - TH1F *EETime; - TH1F *EETimeTh; - TH1F *EETimeX; - TH1F *EETimeY; - TH1F *EEnegTime; - TH1F *EEposTime; - - TH2F *fedSize; - TH1F *totFedSize; - - TH1F *towerHadEnHB; - TH1F *towerHadEnHE; - TH1F *towerHadEnHF; - TH1F *towerHadEn; - TH1F *towerEmEnHB; - TH1F *towerEmEnHE; - TH1F *towerEmEnHF; - TH1F *towerEmEn; - TH1F *towerOuterEn; - - TH1F *towerEmFrac; - - TH1F *RBX_et; - TH1F *RBX_hadEnergy; - TH1F *RBX_hcalTime; - TH1F *RBX_nTowers; - TH1F *RBX_N; - - TH1F *HPD_et; - TH1F *HPD_hadEnergy; - TH1F *HPD_hcalTime; - TH1F *HPD_nTowers; - TH1F *HPD_N; - - // --- from reco calomet - TH1F *HFSumEt; - TH1F *HFMET; - - TH1F *SumEt; - TH1F *MET; - TH1F *OERMET; - TH1F *MET_Tower; - TH1F *MET_RBX; - TH1F *MET_HPD; - TH1F *METSig; - TH1F *MEx; - TH1F *MEy; - TH1F *METPhi; - // --- - - TH1F *SiClusters; - - // --- from reco vertexs - TH1F *h_Vx; - TH1F *h_Vy; - TH1F *h_Vz; - TH1F *h_VNTrks; - // --- - - // --- from reco tracks - TH1F *h_Trk_pt; - TH1F *h_Trk_NTrk; - // --- - - TH1F *hf_sumTowerAllEx; - TH1F *hf_sumTowerAllEy; - TH1F *hf_TowerJetEt; - - TH1F *ETime; - TH1F *HTime; - - TH1F *nTowers1; - TH1F *nTowers2; - TH1F *nTowers3; - TH1F *nTowers4; - TH1F *nTowersLeadJetPt1; - TH1F *nTowersLeadJetPt2; - TH1F *nTowersLeadJetPt3; - TH1F *nTowersLeadJetPt4; - - TH1F *totEneLeadJetEta1; - TH1F *totEneLeadJetEta2; - TH1F *totEneLeadJetEta3; - TH1F *hadEneLeadJetEta1; - TH1F *hadEneLeadJetEta2; - TH1F *hadEneLeadJetEta3; - TH1F *emEneLeadJetEta1; - TH1F *emEneLeadJetEta2; - TH1F *emEneLeadJetEta3; - - TH1F *hadFracEta1; - TH1F *hadFracEta2; - TH1F *hadFracEta3; - - TH1F *tMassGen; - - TH1F *dijetMass; - - TH1F *h_nCalJets; - TH1F *h_nGenJets; - - TH1F *caloEtaEt; - TH1F *caloEta; - TH1F *caloPhi; - - TH1F *hitEtaEt; - TH1F *hitEta; - TH1F *hitPhi; - - TH1F *h_nTowersCal; - TH1F *h_EMFracCal; - TH1F *h_ptCal; - TH1F *h_etaCal; - TH1F *h_phiCal; - - TH1F *h_ptGen; - TH1F *h_etaGen; - TH1F *h_phiGen; - - TH1F *h_ptGenL; - TH1F *h_etaGenL; - TH1F *h_phiGenL; - - TH1F *h_jetEt; - - TH1F *h_UnclusteredEt; - TH1F *h_UnclusteredEts; - TH1F *h_TotalUnclusteredEt; - - TH1F *h_UnclusteredE; - TH1F *h_TotalUnclusteredE; - - TH1F *h_ClusteredE; - TH1F *h_TotalClusteredE; - - TH1F *h_jet1Pt; - TH1F *h_jet2Pt; - TH1F *h_jet1Eta; - TH1F *h_jet2Eta; - TH1F *h_jet1PtHLT; - - TH1F *jetHOEne; - TH1F *jetEMFraction; - TH1F *NTowers; - - TH2F *h_EmEnergy; - TH2F *h_HadEnergy; - - TH1F *st_Pt; - TH1F *st_Constituents; - TH1F *st_Energy; - TH1F *st_EmEnergy; - TH1F *st_HadEnergy; - TH1F *st_OuterEnergy; - TH1F *st_Eta; - TH1F *st_Phi; - TH1F *st_iEta; - TH1F *st_iPhi; - TH1F *st_Frac; - - TH1F *NPass; - TH1F *NTotal; - TH1F *NTime; - - TH1F *HFRecHitEne; - TH1F *HFRecHitEneClean; - TH1F *HFRecHitTime; - - TH1F *HFLongShortPhi; - TH1F *HFLongShortEta; - TH1F *HFLongShortEne; - TH1F *HFLongShortTime; - - TH1F *HFDigiTimePhi; - TH1F *HFDigiTimeEta; - TH1F *HFDigiTimeEne; - TH1F *HFDigiTimeTime; - - TH1F *HFLongShortNHits; - TH1F *HFDigiTimeNHits; - - TH2F *HFvsZ; - TH2F *EBvHB; - TH2F *EEvHE; - TH2F *ECALvHCAL; - TH2F *ECALvHCALEta1; - TH2F *ECALvHCALEta2; - TH2F *ECALvHCALEta3; - TProfile *EMF_Phi; - TProfile *EMF_Eta; - TProfile *EMF_PhiX; - TProfile *EMF_EtaX; - - TProfile *HFTimeVsiEtaP; - TProfile *HFTimeVsiEtaM; - TProfile *HFTimeVsiEtaP5; - TProfile *HFTimeVsiEtaM5; - TProfile *HFTimeVsiEtaP20; - TProfile *HFTimeVsiEtaM20; -}; - -#endif diff --git a/RecoJets/JetAnalyzers/test/myFilter.cc b/RecoJets/JetAnalyzers/test/myFilter.cc deleted file mode 100644 index 3b5b9ff2df890..0000000000000 --- a/RecoJets/JetAnalyzers/test/myFilter.cc +++ /dev/null @@ -1,1024 +0,0 @@ -#include "RecoJets/JetAnalyzers/interface/myFilter.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/METReco/interface/HcalCaloFlagLabels.h" - -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "DataFormats/HcalRecHit/interface/HcalSourcePositionData.h" -#include "DataFormats/HcalDetId/interface/HcalSubdetector.h" - -#include "DataFormats/HLTReco/interface/TriggerObject.h" -// #include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" - -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" - -// #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" -#include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h" - -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" - -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" - -// #include "DataFormats/PhotonReco/interface/PhotonFwd.h" -// #include "DataFormats/PhotonReco/interface/Photon.h" - - -// include files -#include "DataFormats/METReco/interface/HcalNoiseSummary.h" - - -using namespace edm; -using namespace reco; -using namespace std; - -#define DEBUG false -#define INVALID 9999. - -typedef struct RBX_struct { - double et; - double hadEnergy; - double emEnergy; - float hcalTime; - float ecalTime; - int nTowers; -} RBX ; - -typedef struct HPD_struct { - double et; - double hadEnergy; - double emEnergy; - double time; - float hcalTime; - float ecalTime; - int nTowers; -} HPD ; - - - - -//enum HcalSubdetector { HcalEmpty=0, HcalBarrel=1, HcalEndcap=2, HcalOuter=3, HcalForward=4, HcalTriggerTower=5, HcalOther=7 }; - -//enum SectorId { HBplus=1, HBminus=2, -// HEplus=3, HEminus=4, -// HO2plus=5, HO1plus=6, HOzero=7, HO1minus=8, HO2minus=9, -// HFplus=10, HFminus=11 }; - - -myFilter::myFilter(const edm::ParameterSet& cfg) : - CaloJetAlgorithm( cfg.getParameter( "CaloJetAlgorithm" ) ), - hcalNoiseSummaryTag_(cfg.getParameter("hcalNoiseSummaryTag")) -{ - _nTotal = 0; - _nEvent = 0; - _acceptedEvt = 0; - _passPt = 0; - _passNJets = 0; - _passDiJet = 0; - _passNTrks = 0; - _passEMF = 0; - _passNTowers = 0; - _passMET = 0; - _passMETSig = 0; - _passHighPtTower = 0; - _passNRBX = 0; - _passNHPDNoise = 0; - _passHLT = 0; - _passNPMTHits = 0; - _passNMultiPMTHits = 0; - _passPKAM = 0; - _passHFMET = 0; - _passNoiseSummary = 0; - _passNoiseSummaryEMF = 0; - _passNoiseSummaryE2E10 = 0; - _passNoiseSummaryNHITS = 0; - _passNoiseSummaryNoOther = 0; - _passNoiseSummaryADC0 = 0; - _passOERatio = 0; - _passTime = 0; - _passHBHETime = 0; - _passHFTime = 0; - _passHFFlagged = 0; - _passHFHighEnergy = 0; - - for (int i=0; i<10; i++) _NoiseResult[i] = 0; - - theTriggerResultsLabel = cfg.getParameter("TriggerResultsLabel"); - -} - -myFilter::~myFilter() { -} - -void myFilter::beginJob() { -} - -void myFilter::endJob() { - - edm::LogInfo ("summary") << "=============================================================" ; - edm::LogVerbatim ("summary") << "myFilter: accepted " - << _acceptedEvt << " / " << _nEvent << " / " << _nTotal << " events" ; - edm::LogVerbatim ("summary") << "Pt = " << _passPt ; - edm::LogVerbatim ("summary") << "NJets = " << _passNJets ; - edm::LogVerbatim ("summary") << "DiJets = " << _passDiJet ; - edm::LogVerbatim ("summary") << "NTrks = " << _passNTrks ; - edm::LogVerbatim ("summary") << "EMF = " << _passEMF ; - edm::LogVerbatim ("summary") << "NTowers = " << _passNTowers ; - edm::LogVerbatim ("summary") << "MET = " << _passMET ; - edm::LogVerbatim ("summary") << "METSig = " << _passMETSig ; - edm::LogVerbatim ("summary") << "HighPtTower = " << _passHighPtTower ; - edm::LogVerbatim ("summary") << "NRBX = " << _passNRBX ; - edm::LogVerbatim ("summary") << "NHPDNoise = " << _passNHPDNoise ; - edm::LogVerbatim ("summary") << "NPMTHits = " << _passNPMTHits ; - edm::LogVerbatim ("summary") << "NMultPMTHits = " << _passNMultiPMTHits ; - edm::LogVerbatim ("summary") << "PKAM = " << _passPKAM ; - edm::LogVerbatim ("summary") << "HFMET = " << _passHFMET ; - edm::LogVerbatim ("summary") << "Noise Summary = " << _passNoiseSummary ; - edm::LogVerbatim ("summary") << "Noise Summary EMF = " << _passNoiseSummaryEMF ; - edm::LogVerbatim ("summary") << "Noise Summary E2E10 = " << _passNoiseSummaryE2E10 ; - edm::LogVerbatim ("summary") << "Noise Summary NHITS = " << _passNoiseSummaryNHITS ; - edm::LogVerbatim ("summary") << "Noise Summary ADC0 = " << _passNoiseSummaryADC0 ; - edm::LogVerbatim ("summary") << "Noise Summary NoOther = " << _passNoiseSummaryNoOther ; - edm::LogVerbatim ("summary") << "OERatio = " << _passOERatio ; - edm::LogVerbatim ("summary") << "Time = " << _passTime ; - edm::LogVerbatim ("summary") << "HF Time = " << _passHFTime ; - edm::LogVerbatim ("summary") << "HBHE Time = " << _passHBHETime ; - edm::LogVerbatim ("summary") << "HF Flagged = " << _passHFFlagged ; - edm::LogVerbatim ("summary") << "HF High Energy= " << _passHFHighEnergy ; - edm::LogVerbatim ("summary") << "=============================================================" ; - - - for (int i=0; i<10; i++) { - edm::LogVerbatim ("summary") << "Noise Results = " << _NoiseResult[i] ; - } - -} - -bool -myFilter::filter(edm::Event& evt, edm::EventSetup const& es) { - - double HFRecHit[100][100][2]; - - - double HFThreshold = 4.0; - //double HOThreshold = 1.0; - - - bool result = false; - bool filter_Pt = false; - bool filter_DiJet = false; - bool filter_NTrks = false; - bool filter_EMF = false; - bool filter_NJets = false; - //bool filter_NTowers = false; - bool filter_MET = false; - bool filter_METSig = false; - bool filter_HighPtTower = false; - bool filter_NRBX = false; - bool filter_NHPDNoise = false; - bool filter_HLT = false; - bool filter_NPMTHits = false; - bool filter_NMultiPMTHits = false; -// bool filter_PKAM = false; - bool filter_HFMET = false; - bool filter_NoiseSummary = false; - bool filter_NoiseSummaryEMF = false; - bool filter_NoiseSummaryE2E10 = false; - bool filter_NoiseSummaryNHITS = false; - bool filter_NoiseSummaryADC0 = false; - bool filter_NoiseSummaryNoOther = false; - bool filter_OERatio = false; - bool filter_Time = false; - bool filter_HFTime = false; - bool filter_HBHETime = false; - bool filter_HFFlagged = false; - bool filter_HFHighEnergy = false; - - - bool Pass = false; - if (evt.id().run() == 124009) { - if ( (evt.bunchCrossing() == 51) || - (evt.bunchCrossing() == 151) || - (evt.bunchCrossing() == 2824) ) { - Pass = true; - } - } - if (evt.id().run() == 124020) { - if ( (evt.bunchCrossing() == 51) || - (evt.bunchCrossing() == 151) || - (evt.bunchCrossing() == 2824) ) { - Pass = true; - } - } - if (evt.id().run() == 124024) { - if ( (evt.bunchCrossing() == 51) || - (evt.bunchCrossing() == 151) || - (evt.bunchCrossing() == 2824) ) { - Pass = true; - } - } - - if ( (evt.bunchCrossing() == 51) || - (evt.bunchCrossing() == 151) || - (evt.bunchCrossing() == 2824) ) { - Pass = true; - } - - - // *********************** - // *********************** - // get the Noise summary object - - edm::Handle summary_h; - evt.getByLabel(hcalNoiseSummaryTag_, summary_h); - if(!summary_h.isValid()) { - throw edm::Exception(edm::errors::ProductNotFound) << " could not find HcalNoiseSummary.\n"; - // return true; - } - const HcalNoiseSummary summary = *summary_h; - - if(summary.minE2Over10TS()<0.7) { - filter_NoiseSummaryE2E10 = true; - filter_NoiseSummary = true; - _NoiseResult[0]++; - } - if(summary.maxE2Over10TS()>0.96) { - filter_NoiseSummaryE2E10 = true; - filter_NoiseSummary = true; - _NoiseResult[1]++; - } - if(summary.maxHPDHits()>=17) { - filter_NoiseSummaryNHITS = true; - filter_NoiseSummary = true; - _NoiseResult[2]++; - } - if(summary.maxRBXHits()>=999) { - filter_NoiseSummary = true; - _NoiseResult[3]++; - } - if(summary.maxHPDNoOtherHits()>=10) { - filter_NoiseSummary = true; - filter_NoiseSummaryNoOther = true; - _NoiseResult[4]++; - } - if(summary.maxZeros()>=10) { - filter_NoiseSummaryADC0 = true; - filter_NoiseSummary = true; - _NoiseResult[5]++; - } - if(summary.min25GeVHitTime()<-9999.0) { - filter_NoiseSummary = true; - _NoiseResult[6]++; - } - if(summary.max25GeVHitTime()>9999.0) { - filter_NoiseSummary = true; - _NoiseResult[7]++; - } - if(summary.minRBXEMF()<0.01) { - filter_NoiseSummaryEMF = true; - // filter_NoiseSummary = true; - _NoiseResult[8]++; - } - - // if (filter_NoiseSummary) - // std::cout << ">>> Noise Filter = " << filter_NoiseSummary << std::endl; - - - // summary.passLooseNoiseFilter(); - // summary.passTightNoiseFilter(); - // summary.passHighLevelNoiseFilter(); - - - // *********************** - // *********************** - - for (int i=0; i<100; i++) { - for (int j=0; j<100; j++) { - HFRecHit[i][j][0] = -10.; - HFRecHit[i][j][1] = -10.; - } - } - - - double HFM_ETime, HFP_ETime; - double HFM_E, HFP_E; - double HF_PMM; - double MaxRecHitEne; - - MaxRecHitEne = 0; - HFM_ETime = 0.; - HFM_E = 0.; - HFP_ETime = 0.; - HFP_E = 0.; - int NPMTHits; - int NHFDigiTimeHits; - int NHFLongShortHits; - int nTime = 0; - - NPMTHits = 0; - NHFDigiTimeHits = 0; - NHFLongShortHits = 0; - - std::vector > colls; - evt.getManyByType(colls); - std::vector >::iterator i; - for (i=colls.begin(); i!=colls.end(); i++) { - for (HFRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) { - if (j->id().subdet() == HcalForward) { - - int myFlag; - myFlag= j->flagField(HcalCaloFlagLabels::HFLongShort); - if (myFlag==1) { - filter_HFFlagged=true; - NHFLongShortHits++; - } - myFlag= j->flagField(HcalCaloFlagLabels::HFDigiTime); - if (myFlag==1) { - filter_HFFlagged=true; - NHFDigiTimeHits++; - } - - if ( ( (j->flagField(HcalCaloFlagLabels::HFLongShort)) == 0) && - ( (j->flagField(HcalCaloFlagLabels::HFDigiTime)) == 0) ) { - if (j->energy() > MaxRecHitEne) MaxRecHitEne = j->energy(); - } - - - // if (filter_HFFlagged) { - // std::cout << "HF Flagged = " << _passHFFlagged << std::endl; - // } - - - // Long: depth = 1 - // Short: depth = 2 - float en = j->energy(); - float time = j->time(); - if ( (en > 20.) && (time > 10.)) { - nTime++; - } - int ieta = j->id().ieta(); - int iphi = j->id().iphi(); - int depth = j->id().depth(); - HFRecHit[ieta+41][iphi][depth-1] = en; - - // Exclude PMTs with crystals - if ( (j->id().iphi() == 67) && - ((j->id().ieta() == 29) || - ((j->id().ieta() == 30) && (j->id().depth() == 2)) || - ((j->id().ieta() == 32) && (j->id().depth() == 2)) || - ((j->id().ieta() == 35) && (j->id().depth() == 1)) || - ((j->id().ieta() == 36) && (j->id().depth() == 2)) || - ((j->id().ieta() == 37) && (j->id().depth() == 1)) || - ((j->id().ieta() == 38) && (j->id().depth() == 2)) ) ) { - } else { - if ( (j->flagField(0) != 0) && (j->energy() > 1.) ) { - NPMTHits++; - if (NPMTHits > 1) { - edm::LogInfo("myFilter") << ">>>> MultiHit: Run = " << evt.id().run() - << " Event = " << evt.id().event() - << " iEta = " << j->id().ieta() - << " iPhi = " << j->id().iphi() - << " depth = " << j->id().depth() - << " flag = " << j->flagField(0) - << " hits = " << NPMTHits - << " energy = " << j->energy(); - } - - } - } - - if (j->id().ieta()<0) { - if (j->energy() > HFThreshold) { - HFM_ETime += j->energy()*j->time(); - HFM_E += j->energy(); - } - } else { - if (j->energy() > HFThreshold) { - HFP_ETime += j->energy()*j->time(); - HFP_E += j->energy(); - } - } - - - } - } - break; - } - - if (MaxRecHitEne > 1000.) filter_HFHighEnergy = true; - - if (nTime > 0) filter_Time = true; - if (nTime > 0) filter_HFTime = true; - - - double OER, OddEne, EvenEne; - int nOdd, nEven; - - OER = 0.0; - for (int iphi=0; iphi<100; iphi++) { - OddEne = EvenEne = 0.; - nOdd = 0; - nEven = 0; - for (int ieta=0; ieta<100; ieta++) { - if (HFRecHit[ieta][iphi][0] > 1.0) { - if (ieta%2 == 0) { - EvenEne += HFRecHit[ieta][iphi][0]; - nEven++; - } else { - OddEne += HFRecHit[ieta][iphi][0]; - nOdd++; - } - } - if (HFRecHit[ieta][iphi][1] > 1.0) { - if (ieta%2 == 0) { - EvenEne += HFRecHit[ieta][iphi][1]; - nEven++; - } else { - OddEne += HFRecHit[ieta][iphi][1]; - nOdd++; - } - } - } - if (((OddEne + EvenEne) > 10.) && (nOdd > 1) && (nEven > 1)) { - OER = (OddEne - EvenEne) / (OddEne + EvenEne); - } - } - - - if (NPMTHits > 0) filter_NPMTHits = true; - if (NPMTHits > 1) filter_NMultiPMTHits = true; - // cout << "NPMTHits = " << NPMTHits << endl; - - - if ((HFP_E > 0.) && (HFM_E > 0.)) { - HF_PMM = (HFP_ETime / HFP_E) - (HFM_ETime / HFM_E); - } else { - HF_PMM = INVALID; - } - - - if (fabs(HF_PMM) < 10.) { - Pass = true; - } else { - Pass = false; - } - - _nTotal++; - Pass = true; - if (Pass) { - /*** - std::cout << ">>>> FIL: Run = " << evt.id().run() - << " Event = " << evt.id().event() - << " Bunch Crossing = " << evt.bunchCrossing() - << " Orbit Number = " << evt.orbitNumber() - << std::endl; - ***/ - // ********************************************************* - // --- Event Classification - // ********************************************************* - - RBX RBXColl[36]; - HPD HPDColl[144]; - - int evtType = 0; - - Handle caloTowers; - evt.getByLabel( "towerMaker", caloTowers ); - - for (int i=0;i<36;i++) { - RBXColl[i].et = 0; - RBXColl[i].hadEnergy = 0; - RBXColl[i].emEnergy = 0; - RBXColl[i].hcalTime = 0; - RBXColl[i].ecalTime = 0; - RBXColl[i].nTowers = 0; - } - for (int i=0;i<144;i++) { - HPDColl[i].et = 0; - HPDColl[i].hadEnergy = 0; - HPDColl[i].emEnergy = 0; - HPDColl[i].hcalTime = 0; - HPDColl[i].ecalTime = 0; - HPDColl[i].nTowers = 0; - } - - double HFMET = 0.0; - double HFsum_et = 0.0; - double HFsum_ex = 0.0; - double HFsum_ey = 0.0; - - for (CaloTowerCollection::const_iterator tower = caloTowers->begin(); - tower != caloTowers->end(); tower++) { - - if (tower->hadEnergy() < 0.) { - } - if (tower->emEnergy() < 0.) { - } - - - if (tower->et()>0.5) { - - int iRBX = tower->iphi(); - iRBX = iRBX-2; - if (iRBX == 0) iRBX = 17; - if (iRBX == -1) iRBX = 18; - iRBX = (iRBX-1)/4; - - if (tower->ieta() < 0) iRBX += 18; - if (iRBX < 36) { - RBXColl[iRBX].et += tower->et(); - RBXColl[iRBX].hadEnergy += tower->hadEnergy(); - RBXColl[iRBX].emEnergy += tower->emEnergy(); - RBXColl[iRBX].hcalTime += tower->hcalTime(); - RBXColl[iRBX].ecalTime += tower->ecalTime(); - RBXColl[iRBX].nTowers++; - } - /*** - std::cout << "iRBX = " << iRBX << " " - << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi() - << " et = " << tower->et() - << std::endl; - ***/ - int iHPD = tower->iphi(); - if (tower->ieta() < 0) iHPD = iHPD + 72; - if (iHPD < 144) { - HPDColl[iHPD].et += tower->et(); - HPDColl[iHPD].hadEnergy += tower->hadEnergy(); - HPDColl[iHPD].emEnergy += tower->emEnergy(); - HPDColl[iHPD].hcalTime += tower->hcalTime(); - HPDColl[iHPD].ecalTime += tower->ecalTime(); - HPDColl[iHPD].nTowers++; - } - /*** - std::cout << "iHPD = " << iHPD << " " - << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi() - << " et = " << tower->et() - << std::endl; - ***/ - - Double_t et = tower->et(); - Double_t phix = tower->phi(); - - if (fabs(tower->ieta()) > 29) { - HFsum_et += et; - HFsum_ex += et*cos(phix); - HFsum_ey += et*sin(phix); - } - - } - } - - HFMET = sqrt( HFsum_ex*HFsum_ex + HFsum_ey*HFsum_ey); - if ( (HFMET > 40.) && (NPMTHits == 0) ) filter_HFMET = true; - - // Loop over the RBX Collection - int nRBX = 0; - int nTowers = 0; - for (int i=0;i<36;i++) { - if (RBXColl[i].hadEnergy > 3.0) { - nRBX++; - nTowers = RBXColl[i].nTowers; - } - } - if ( (nRBX == 1) && (nTowers > 24) ) { - evtType = 1; - } - - // Loop over the HPD Collection - int nHPD = 0; - for (int i=0;i<144;i++) { - if (HPDColl[i].hadEnergy > 3.0) { - nHPD++; - nTowers = HPDColl[i].nTowers; - } - } - if ( (nHPD == 1) && (nTowers > 6) ) { - evtType = 2; - // cout << " nHPD = " << nHPD - // << " Towers = " << nTowers - // << " Type = " << evtType - // << endl; - } - - - - // ********************************************************* - // --- Access Trigger Info - // ********************************************************* - - // **** Get the TriggerResults container - Handle triggerResults; - evt.getByLabel(theTriggerResultsLabel, triggerResults); - - Int_t JetLoPass = 0; - - /**** - if (triggerResults.isValid()) { - if (DEBUG) std::cout << "trigger valid " << std::endl; - edm::TriggerNames triggerNames; // TriggerNames class - triggerNames.init(*triggerResults); - unsigned int n = triggerResults->size(); - for (unsigned int i=0; i!=n; i++) { - if ( triggerNames.triggerName(i) == "HLT_Jet30" ) { - JetLoPass = triggerResults->accept(i); - if (DEBUG) std::cout << "Found HLT_Jet30" << std::endl; - } - } - } - *****/ - - // ********************************************************* - // --- Vertex Selection - // ********************************************************* - - // ********************************************************* - // --- Pixel Track and Clusters - // ********************************************************* - /******* - // -- Tracks - edm::Handle > hTrackCollection; - evt.getByLabel("generalTracks", hTrackCollection); - - if (hTrackCollection.isValid()) { - const std::vector trackColl = *(hTrackCollection.product()); - nTk = trackColl.size(); - } - *******/ - - // ********************************************************* - // --- Pixel Clusters - // ********************************************************* - // -- Pixel cluster - /*** - edm::Handle hClusterColl; - evt.getByLabel("siPixelClusters", hClusterColl); - const reco::SiPixelCluster cC = *(hClusterColl.product()); - ***/ - - edm::Handle< edmNew::DetSetVector > hClusterColl; - evt.getByLabel("siPixelClusters", hClusterColl); - auto const & clustColl = *(hClusterColl.product()); - // nCl = clustColl.size(); - - /*** - int nCl = 0; - if (hClusterColl.isValid()) { - const edmNew::DetSetVector clustColl = *(hClusterColl.product()); - nCl = clustColl.size(); - } - ***/ - - // ********************************************************* - // --- Track Selection - // ********************************************************* - edm::Handle trackCollection; - // evt.getByLabel("ctfWithMaterialTracks", trackCollection); - evt.getByLabel("generalTracks", trackCollection); - - auto const & tC = *(trackCollection.product()); - // std::cout << "FIL: Reconstructed "<< tC.size() << " tracks" << std::endl ; - - if (tC.size() > 3) filter_NTrks = true; - - // h_Trk_NTrk->Fill(tC.size()); - - // for (reco::TrackCollection::const_iterator track=tC.begin(); track!=tC.end(); track++){ - // h_Trk_pt->Fill(track->pt()); - // } - - /**** - std::cout << "Track number "<< i << std::endl ; - std::cout << "\tmomentum: " << track->momentum()<< std::endl; - std::cout << "\tPT: " << track->pt()<< std::endl; - std::cout << "\tvertex: " << track->vertex()<< std::endl; - std::cout << "\timpact parameter: " << track->d0()<< std::endl; - std::cout << "\tcharge: " << track->charge()<< std::endl; - std::cout << "\tnormalizedChi2: " << track->normalizedChi2()<< std::endl; - - cout<<"\tFrom EXTRA : "<outerPt()<seedDirection() << std::endl; - ****/ - - - if ((tC.size() > 100) && (clustColl.size() > 1000)) { - _passPKAM++; -// filter_PKAM = true; - } - // std::cout << "N Tracks = " << tC.size() - // << " N Cluster = " << clustColl.size() << std::endl ; - - - - // ********************************************************* - // --- RecHits - // ********************************************************* - // Handle caloTowers; - // evt.getByLabel( "towerMaker", caloTowers ); - edm::Handle spd; - - int nHPDNoise = 0; - nTime = 0; - - std::vector > colls; - evt.getManyByType(colls); - std::vector >::iterator i; - for (i=colls.begin(); i!=colls.end(); i++) { - for (HBHERecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) { - // std::cout << *j << std::endl; - if (j->id().subdet() == HcalBarrel) { - // std::cout << "Barrel : " << j->id() << std::endl; - } - if (j->id().subdet() == HcalEndcap) { - } - - if (j->flagField(0) != 0) nHPDNoise++; - - float en = j->energy(); - float time = j->time(); - - if ( (en > 10.) && (time > 20.)) { - nTime++; - } - - /*** - std::cout << j->id() << " " - << j->id().subdet() << " " - << j->id().ieta() << " " - << j->id().iphi() << " " - << j->id().depth() << " " - << j->energy() << " " - << j->time() << std::endl; - ****/ - } - } - - if (nHPDNoise > 10) filter_NHPDNoise = true; - if (nTime > 0) filter_HBHETime = true; - - /*** - std::vector > colls; - evt.getManyByType(colls); - std::vector >::iterator i; - for (i=colls.begin(); i!=colls.end(); i++) { - for (HFRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) { - // std::cout << *j << std::endl; - } - } - - std::vector > colls; - evt.getManyByType(colls); - std::vector >::iterator i; - for (i=colls.begin(); i!=colls.end(); i++) { - for (HORecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) { - // std::cout << *j << std::endl; - } - } - ****/ - - - - // ********************************************************* - // --- CaloTower Selection - // ********************************************************* - // Handle caloTowers; - // evt.getByLabel( "towerMaker", caloTowers ); - - // --- Loop over towers and make a lists of used and unused towers - int nTow = 0; - for (CaloTowerCollection::const_iterator tower = caloTowers->begin(); - tower != caloTowers->end(); tower++) { - // std::cout << *tower << std::endl; - if (tower->et() > 0.5) { - nTow++; - /**** - std::cout << "Tower Et = " - << tower->et() << " " - << tower->emEnergy() << " EmEne = " - << tower->hadEnergy() << " HadEne = " - << tower->outerEnergy() << " ETime = " - << tower->ecalTime() << " HTime = " - << tower->hcalTime() << " ieta = " - << tower->ieta() << " iphi = " - << tower->iphi() << " " - << tower->iphi() / 4 - << endl; - ****/ - } - - } - /**** - std::cout << "Number of caloTowers = " - << caloTowers->size() - << " / " - << nTow - << std::endl; - ****/ - - // ********************************************************* - // --- Jet Selection - // ********************************************************* - - Handle jets; - evt.getByLabel( CaloJetAlgorithm, jets ); - int njet = 0; - int nDiJet = 0; - for ( CaloJetCollection::const_iterator ijet=jets->begin(); ijet!=jets->end(); ijet++) { - - if ( (ijet->pt() > 100.) && (JetLoPass != 0) ) { - filter_HLT = true; - } - - - if ((ijet->pt() > 100.) && (evtType == 0)) { - filter_HighPtTower = true; - } - - if (ijet->pt() > 50.) nDiJet++; - if (ijet->pt() > 50.) filter_Pt = true; - if (ijet->pt() > 10.) njet++; - if (ijet->pt() > 10.) { - if (ijet->emEnergyFraction() > 0.05) filter_EMF = true; - } - - // if (filter_EMF) { - // std::cout << "pt = " << ijet->pt() - // << " EMF = " << ijet->emEnergyFraction() << std::endl; - // } - - // std::cout << "pt = " << ijet->pt() << std::endl; - - } - - if (nDiJet > 1) filter_DiJet = true; - if (njet > 1) filter_NJets = true; - // if (filter_EMF) { - // std::cout << "NJets = " << njet << std::endl; - // } - - - // ********************************************************* - // --- MET Selection - // ********************************************************* - - Handle calometcoll; - evt.getByLabel("met", calometcoll); - double caloMET = 0; - if (calometcoll.isValid()) { - const CaloMETCollection *calometcol = calometcoll.product(); - const CaloMET *calomet; - calomet = &(calometcol->front()); - caloMET = calomet->pt(); - //double caloMETSig = calomet->mEtSig(); - //double caloSumET = calomet->sumEt(); - // if ((caloMET > 50.) && (evtType = 0)) filter_MET = true; - if (caloMET > 40.) filter_MET = true; - } - if ((std::abs(OER) > 0.9) && (caloMET > 20.0)) filter_OERatio = true; - if (nRBX > 3) filter_NRBX = true; - - // ********************************************************* - _nEvent++; - - // if ( (filter_HLT) || (filter_NJets) ) { - // result = true; - // _acceptedEvt++; - // } - - /*** - if ( (filter_Pt) || (filter_NTrks) || (filter_EMF) || (filter_NJets) || - (filter_MET) || (filter_METSig) || (filter_HighPtTower) ) { - result = true; - _acceptedEvt++; - } - ***/ - - // if ( (filter_Pt) || (filter_NJets) ) { - // result = true; - // _acceptedEvt++; - // } - - // if ((filter_PKAM) || (filter_HFMET) ||(filter_NMultiPMTHits) ) { - // if ( (filter_DiJet) || (filter_HFMET) ||(filter_NMultiPMTHits) ) { - // if ( (filter_NHPDNoise) && ( (filter_Pt) || (filter_MET) ) ) { - // result = true; - // _acceptedEvt++; - // } - - // if ( (filter_NoiseSummary) && ( (filter_Pt) || (filter_MET) ) ) { - // result = true; - // _acceptedEvt++; - // } - - // if (filter_NoiseSummaryEMF) { - // result = true; - // _acceptedEvt++; - // } - - // if (filter_Time) { - // if ( (filter_MET) && (!filter_NoiseSummary) ) { - - // if (filter_NoiseSummary) { - // result = true; - // _acceptedEvt++; - // } - - // if (filter_HFTime) { - // result = true; - // _acceptedEvt++; - // } - - // if (filter_HBHETime) { - // result = true; - // _acceptedEvt++; - // } - - - // if (!filter_NoiseSummary && filter_HBHETime) { - // result = true; - // _acceptedEvt++; - // } - - // if (filter_NoiseSummary && filter_NTrks) { - // result = true; - // _acceptedEvt++; - // } - - // if (!filter_NoiseSummaryADC0 && !filter_NoiseSummaryNHITS && - // filter_NoiseSummaryE2E10 && !filter_NoiseSummaryNoOther) { - // result = true; - // _acceptedEvt++; - // } - - - // if ((filter_HFFlagged) && ((NHFLongShortHits > 2) || (NHFDigiTimeHits > 2))) { - // result = true; - // _acceptedEvt++; - // } - - if (filter_HFHighEnergy) { - result = true; - _acceptedEvt++; - } - - if (filter_Pt) _passPt++; - if (filter_NJets) _passNJets++; - if (filter_DiJet) _passDiJet++; - if (filter_NTrks) _passNTrks++; - if (filter_EMF) _passEMF++; - if (filter_MET) _passMET++; - if (filter_METSig) _passMETSig++; - if (filter_HighPtTower) _passHighPtTower++; - if (filter_NRBX) _passNRBX++; - if (filter_NHPDNoise) _passNHPDNoise++; - if (filter_HLT) _passHLT++; - if (filter_NPMTHits) _passNPMTHits++; - if (filter_NMultiPMTHits) _passNMultiPMTHits++; - if (filter_HFMET) _passHFMET++; - if (filter_NoiseSummary) _passNoiseSummary++; - if (filter_NoiseSummaryEMF) _passNoiseSummaryEMF++; - if (filter_NoiseSummaryE2E10) _passNoiseSummaryE2E10++; - if (filter_NoiseSummaryNHITS) _passNoiseSummaryNHITS++; - if (filter_NoiseSummaryADC0) _passNoiseSummaryADC0++; - if (filter_NoiseSummaryNoOther) _passNoiseSummaryNoOther++; - if (filter_OERatio) _passOERatio++; - if (filter_Time) _passTime++; - if (filter_HFTime) _passHFTime++; - if (filter_HBHETime) _passHBHETime++; - if (filter_HFFlagged) _passHFFlagged++; - if (filter_HFHighEnergy) _passHFHighEnergy++; - - /**** - if ((evt.id().run() == 120020) && (evt.id().event() == 453)) { - result = true; - _acceptedEvt++; - } else { - result = false; - } - ****/ - - // result = true; - - } - - if (result) { - edm::LogInfo ("summary")<< "<<<< Event Passed myFilter" ; - } - return result; - -} -#include "FWCore/Framework/interface/MakerMacros.h" -DEFINE_FWK_MODULE(myFilter); diff --git a/RecoJets/JetAnalyzers/test/myJetAna.cc b/RecoJets/JetAnalyzers/test/myJetAna.cc deleted file mode 100644 index b3f10df9de1de..0000000000000 --- a/RecoJets/JetAnalyzers/test/myJetAna.cc +++ /dev/null @@ -1,2767 +0,0 @@ -// myJetAna.cc -// Description: Access Cruzet Data -// Author: Frank Chlebana -// Date: 24 - July - 2008 -// -#include "RecoJets/JetAnalyzers/interface/myJetAna.h" -#include "RecoJets/JetAlgorithms/interface/JetAlgoHelper.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/JetReco/interface/GenJet.h" -#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "DataFormats/METReco/interface/CaloMET.h" - -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/METReco/interface/HcalCaloFlagLabels.h" - -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "DataFormats/HcalRecHit/interface/HcalSourcePositionData.h" -#include "DataFormats/HcalDetId/interface/HcalSubdetector.h" - -#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/EcalDetId/interface/EBDetId.h" -#include "DataFormats/EcalDetId/interface/EEDetId.h" - -#include "FWCore/Framework/interface/ESHandle.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" - -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" - -#include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h" - -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" - -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" - -// #include "DataFormats/PhotonReco/interface/PhotonFwd.h" -// #include "DataFormats/PhotonReco/interface/Photon.h" - - -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/Math/interface/deltaPhi.h" -// #include "DataFormats/HepMCCandidate/interface/GenParticleCandidate.h" -#include "DataFormats/Candidate/interface/Candidate.h" -// #include "FWCore/Framework/interface/Handle.h" -#include "FWCore/Framework/interface/Event.h" -// #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" - -#include "DataFormats/HLTReco/interface/TriggerObject.h" -// #include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" - -// #include "DataFormats/Scalers/interface/DcsStatus.h" - -// include files -#include "DataFormats/METReco/interface/HcalNoiseSummary.h" - -#include "DataFormats/METReco/interface/HcalCaloFlagLabels.h" - - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include -#include -#include -#include -#include - -using namespace edm; -using namespace reco; -using namespace std; - - -#define INVALID 9999. -#define DEBUG false -#define MAXJETS 100 - -typedef struct RBX_struct { - double et; - double hadEnergy; - double emEnergy; - float hcalTime; - float ecalTime; - int nTowers; -} RBX ; - -typedef struct HPD_struct { - double et; - double hadEnergy; - double emEnergy; - double time; - float hcalTime; - float ecalTime; - int nTowers; -} HPD ; - - -// ************************ -// ************************ - -// Get the algorithm of the jet collections we will read from the .cfg file -// which defines the value of the strings CaloJetAlgorithm and GenJetAlgorithm. - -myJetAna::myJetAna( const ParameterSet & cfg ) : - CaloJetAlgorithm( cfg.getParameter( "CaloJetAlgorithm" ) ), - GenJetAlgorithm( cfg.getParameter( "GenJetAlgorithm" ) ), - hcalNoiseSummaryTag_(cfg.getParameter("hcalNoiseSummaryTag")) -{ - theTriggerResultsLabel = cfg.getParameter("TriggerResultsLabel"); -} - - -// ************************ -// ************************ - -void myJetAna::beginJob( ) { - - - - edm::Service fs; - - // --- passed selection cuts - h_pt = fs->make( "pt", "Jet p_{T}", 100, 0, 50 ); - h_ptRBX = fs->make( "ptRBX", "RBX: Jet p_{T}", 100, 0, 50 ); - h_ptHPD = fs->make( "ptHPD", "HPD: Jet p_{T}", 100, 0, 50 ); - h_ptTower = fs->make( "ptTower", "Jet p_{T}", 100, 0, 50 ); - h_et = fs->make( "et", "Jet E_{T}", 100, 0, 50 ); - h_eta = fs->make( "eta", "Jet #eta", 100, -5, 5 ); - h_phi = fs->make( "phi", "Jet #phi", 50, -M_PI, M_PI ); - // --- - - hitEtaEt = fs->make( "hitEtaEt", "RecHit #eta", 90, -45, 45 ); - hitEta = fs->make( "hitEta", "RecHit #eta", 90, -45, 45 ); - hitPhi = fs->make( "hitPhi", "RecHit #phi", 73, 0, 73 ); - - caloEtaEt = fs->make( "caloEtaEt", "CaloTower #eta", 100, -4, 4 ); - caloEta = fs->make( "caloEta", "CaloTower #eta", 100, -4, 4 ); - caloPhi = fs->make( "caloPhi", "CaloTower #phi", 50, -M_PI, M_PI ); - - dijetMass = fs->make("dijetMass","DiJet Mass",100,0,100); - - totEneLeadJetEta1 = fs->make("totEneLeadJetEta1","Total Energy Lead Jet Eta1 1",100,0,100); - totEneLeadJetEta2 = fs->make("totEneLeadJetEta2","Total Energy Lead Jet Eta2 1",150,0,150); - totEneLeadJetEta3 = fs->make("totEneLeadJetEta3","Total Energy Lead Jet Eta3 1",150,0,150); - - hadEneLeadJetEta1 = fs->make("hadEneLeadJetEta1","Hadronic Energy Lead Jet Eta1 1",50,0,50); - hadEneLeadJetEta2 = fs->make("hadEneLeadJetEta2","Hadronic Energy Lead Jet Eta2 1",100,0,100); - hadEneLeadJetEta3 = fs->make("hadEneLeadJetEta3","Hadronic Energy Lead Jet Eta3 1",100,0,100); - emEneLeadJetEta1 = fs->make("emEneLeadJetEta1","EM Energy Lead Jet Eta1 1",50,0,50); - emEneLeadJetEta2 = fs->make("emEneLeadJetEta2","EM Energy Lead Jet Eta2 1",100,0,100); - emEneLeadJetEta3 = fs->make("emEneLeadJetEta3","EM Energy Lead Jet Eta3 1",100,0,100); - - - hadFracEta1 = fs->make("hadFracEta11","Hadronic Fraction Eta1 Jet 1",100,0,1); - hadFracEta2 = fs->make("hadFracEta21","Hadronic Fraction Eta2 Jet 1",100,0,1); - hadFracEta3 = fs->make("hadFracEta31","Hadronic Fraction Eta3 Jet 1",100,0,1); - - HFSumEt = fs->make("HFSumEt","HFSumEt",100,0,100); - HFMET = fs->make("HFMET", "HFMET",120,0,120); - - SumEt = fs->make("SumEt","SumEt",100,0,100); - MET = fs->make("MET", "MET",120,0,120); - OERMET = fs->make("OERMET", "OERMET",120,0,120); - METSig = fs->make("METSig", "METSig",100,0,50); - MEx = fs->make("MEx", "MEx",100,-20,20); - MEy = fs->make("MEy", "MEy",100,-20,20); - METPhi = fs->make("METPhi", "METPhi",315,0,3.15); - MET_RBX = fs->make("MET_RBX", "MET",100,0,1000); - MET_HPD = fs->make("MET_HPD", "MET",100,0,1000); - MET_Tower = fs->make("MET_Tower", "MET",100,0,1000); - - SiClusters = fs->make("SiClusters", "SiClusters",150,0,1500); - - h_Vx = fs->make("Vx", "Vx",100,-0.5,0.5); - h_Vy = fs->make("Vy", "Vy",100,-0.5,0.5); - h_Vz = fs->make("Vz", "Vz",100,-20,20); - h_VNTrks = fs->make("VNTrks", "VNTrks",10,1,100); - - h_Trk_pt = fs->make("Trk_pt", "Trk_pt",100,0,20); - h_Trk_NTrk = fs->make("Trk_NTrk", "Trk_NTrk",150,0,150); - - hf_sumTowerAllEx = fs->make("sumTowerAllEx","Tower Ex",100,-1000,1000); - hf_sumTowerAllEy = fs->make("sumTowerAllEy","Tower Ey",100,-1000,1000); - - hf_TowerJetEt = fs->make("TowerJetEt","Tower/Jet Et 1",50,0,1); - - ETime = fs->make("ETime","Ecal Time",200,-200,200); - HTime = fs->make("HTime","Hcal Time",200,-200,200); - - towerHadEnHB = fs->make("towerHadEnHB" ,"HB: Calo Tower HAD Energy",210,-1,20); - towerHadEnHE = fs->make("towerHadEnHE" ,"HE: Calo Tower HAD Energy",510,-1,50); - towerHadEnHF = fs->make("towerHadEnHF" ,"HF: Calo Tower HAD Energy",510,-1,50); - - towerEmEnHB = fs->make("towerEmEnHB" ,"HB: Calo Tower EM Energy",210,-1,20); - towerEmEnHE = fs->make("towerEmEnHE" ,"HE: Calo Tower EM Energy",510,-1,50); - towerEmEnHF = fs->make("towerEmEnHF" ,"HF: Calo Tower EM Energy",510,-1,50); - - towerHadEn = fs->make("towerHadEn" ,"Hadronic Energy in Calo Tower",2000,-100,100); - towerEmEn = fs->make("towerEmEn" ,"EM Energy in Calo Tower",2000,-100,100); - towerOuterEn = fs->make("towerOuterEn" ,"HO Energy in Calo Tower",2000,-100,100); - - towerEmFrac = fs->make("towerEmFrac","EM Fraction of Energy in Calo Tower",100,-1.,1.); - - RBX_et = fs->make("RBX_et","ET in RBX",1000,-20,100); - RBX_hadEnergy = fs->make("RBX_hadEnergy","Hcal Energy in RBX",1000,-20,100); - RBX_hcalTime = fs->make("RBX_hcalTime","Hcal Time in RBX",200,-200,200); - RBX_nTowers = fs->make("RBX_nTowers","Number of Towers in RBX",75,0,75); - RBX_N = fs->make("RBX_N","Number of RBX",10,0,10); - - HPD_et = fs->make("HPD_et","ET in HPD",1000,-20,100); - HPD_hadEnergy = fs->make("HPD_hadEnergy","Hcal Energy in HPD",1000,-20,100); - HPD_hcalTime = fs->make("HPD_hcalTime","Hcal Time in HPD",200,-200,200); - HPD_nTowers = fs->make("HPD_nTowers","Number of Towers in HPD",20,0,20); - HPD_N = fs->make("HPD_N","Number of HPD",10,0,10); - - nTowers1 = fs->make("nTowers1","Number of Towers pt 0.5",100,0,200); - nTowers2 = fs->make("nTowers2","Number of Towers pt 1.0",100,0,200); - nTowers3 = fs->make("nTowers3","Number of Towers pt 1.5",100,0,200); - nTowers4 = fs->make("nTowers4","Number of Towers pt 2.0",100,0,200); - - nTowersLeadJetPt1 = fs->make("nTowersLeadJetPt1","Number of Towers in Lead Jet pt 0.5",100,0,100); - nTowersLeadJetPt2 = fs->make("nTowersLeadJetPt2","Number of Towers in Lead Jet pt 1.0",100,0,100); - nTowersLeadJetPt3 = fs->make("nTowersLeadJetPt3","Number of Towers in Lead Jet pt 1.5",100,0,100); - nTowersLeadJetPt4 = fs->make("nTowersLeadJetPt4","Number of Towers in Lead Jet pt 2.0",100,0,100); - - h_nCalJets = fs->make( "nCalJets", "Number of CalJets", 20, 0, 20 ); - - HBEneOOT = fs->make( "HBEneOOT", "HBEneOOT", 200, -5, 10 ); - HEEneOOT = fs->make( "HEEneOOT", "HEEneOOT", 200, -5, 10 ); - HFEneOOT = fs->make( "HFEneOOT", "HFEneOOT", 200, -5, 10 ); - HOEneOOT = fs->make( "HOEneOOT", "HOEneOOT", 200, -5, 10 ); - - HBEneOOTTh = fs->make( "HBEneOOTTh", "HBEneOOTTh", 200, -5, 10 ); - HEEneOOTTh = fs->make( "HEEneOOTTh", "HEEneOOTTh", 200, -5, 10 ); - HFEneOOTTh = fs->make( "HFEneOOTTh", "HFEneOOTTh", 200, -5, 10 ); - HOEneOOTTh = fs->make( "HOEneOOTTh", "HOEneOOTTh", 200, -5, 10 ); - - HBEneOOTTh1 = fs->make( "HBEneOOTTh1", "HBEneOOT", 200, -5, 10 ); - HEEneOOTTh1 = fs->make( "HEEneOOTTh1", "HEEneOOT", 200, -5, 10 ); - HFEneOOTTh1 = fs->make( "HFEneOOTTh1", "HFEneOOT", 200, -5, 10 ); - HOEneOOTTh1 = fs->make( "HOEneOOTTh1", "HOEneOOT", 200, -5, 10 ); - - HBEneTThr = fs->make( "HBEneTThr", "HBEneTThr", 105, -5, 100 ); - HEEneTThr = fs->make( "HEEneTThr", "HEEneTThr", 105, -5, 100 ); - HFEneTThr = fs->make( "HFEneTThr", "HFEneTThr", 105, -5, 100 ); - - - HBEne = fs->make( "HBEne", "HBEne", 205, -5, 200 ); - HBEneTh = fs->make( "HBEneTh", "HBEneTh", 205, -5, 200 ); - HBEneTh1 = fs->make( "HBEneTh1", "HBEneTh1", 205, -5, 200 ); - HBEneX = fs->make( "HBEneX", "HBEneX", 200, -5, 10 ); - HBEneY = fs->make( "HBEneY", "HBEnedY", 200, -5, 10 ); - HBTime = fs->make( "HBTime", "HBTime", 200, -100, 100 ); - HBTimeTh = fs->make( "HBTimeTh", "HBTimeTh", 200, -100, 100 ); - HBTimeTh1 = fs->make( "HBTimeTh1", "HBTimeTh1", 200, -100, 100 ); - HBTimeTh2 = fs->make( "HBTimeTh2", "HBTimeTh2", 200, -100, 100 ); - HBTimeTh3 = fs->make( "HBTimeTh3", "HBTimeTh3", 200, -100, 100 ); - HBTimeThR = fs->make( "HBTimeThR", "HBTimeThR", 200, -100, 100 ); - HBTimeTh1R = fs->make( "HBTimeTh1R", "HBTimeTh1R", 200, -100, 100 ); - HBTimeTh2R = fs->make( "HBTimeTh2R", "HBTimeTh2R", 200, -100, 100 ); - HBTimeTh3R = fs->make( "HBTimeTh3R", "HBTimeTh3R", 200, -100, 100 ); - - HBTimeFlagged = fs->make( "HBTimeFlagged", "HBTimeFlagged", 200, -100, 100 ); - HBTimeThFlagged = fs->make( "HBTimeThFlagged", "HBTimeThFlagged", 200, -100, 100 ); - HBTimeTh1Flagged = fs->make( "HBTimeTh1Flagged", "HBTimeTh1Flagged", 200, -100, 100 ); - HBTimeTh2Flagged = fs->make( "HBTimeTh2Flagged", "HBTimeTh2Flagged", 200, -100, 100 ); - - HBTimeFlagged2 = fs->make( "HBTimeFlagged2", "HBTimeFlagged2", 200, -100, 100 ); - HBTimeThFlagged2 = fs->make( "HBTimeThFlagged2", "HBTimeThFlagged2", 200, -100, 100 ); - HBTimeTh1Flagged2 = fs->make( "HBTimeTh1Flagged2", "HBTimeTh1Flagged2", 200, -100, 100 ); - HBTimeTh2Flagged2 = fs->make( "HBTimeTh2Flagged2", "HBTimeTh2Flagged2", 200, -100, 100 ); - - HBTimeX = fs->make( "HBTimeX", "HBTimeX", 200, -100, 100 ); - HBTimeY = fs->make( "HBTimeY", "HBTimeY", 200, -100, 100 ); - HEEne = fs->make( "HEEne", "HEEne", 205, -5, 200 ); - HEEneTh = fs->make( "HEEneTh", "HEEneTh", 205, -5, 200 ); - HEEneTh1 = fs->make( "HEEneTh1", "HEEneTh1", 205, -5, 200 ); - HEEneX = fs->make( "HEEneX", "HEEneX", 200, -5, 10 ); - HEEneY = fs->make( "HEEneY", "HEEneY", 200, -5, 10 ); - HEposEne = fs->make( "HEposEne", "HEposEne", 200, -5, 10 ); - HEnegEne = fs->make( "HEnegEne", "HEnegEne", 200, -5, 10 ); - HETime = fs->make( "HETime", "HETime", 200, -100, 100 ); - HETimeTh = fs->make( "HETimeTh", "HETimeTh", 200, -100, 100 ); - HETimeTh1 = fs->make( "HETimeTh1", "HETimeTh1", 200, -100, 100 ); - HETimeTh2 = fs->make( "HETimeTh2", "HETimeTh2", 200, -100, 100 ); - HETimeTh3 = fs->make( "HETimeTh3", "HETimeTh3", 200, -100, 100 ); - HETimeThR = fs->make( "HETimeThR", "HETimeThR", 200, -100, 100 ); - HETimeTh1R = fs->make( "HETimeTh1R", "HETimeTh1R", 200, -100, 100 ); - HETimeTh2R = fs->make( "HETimeTh2R", "HETimeTh2R", 200, -100, 100 ); - HETimeTh3R = fs->make( "HETimeTh3R", "HETimeTh3R", 200, -100, 100 ); - - HETimeFlagged = fs->make( "HETimeFlagged", "HETimeFlagged", 200, -100, 100 ); - HETimeThFlagged = fs->make( "HETimeThFlagged", "HETimeThFlagged", 200, -100, 100 ); - HETimeTh1Flagged = fs->make( "HETimeTh1Flagged", "HETimeTh1Flagged", 200, -100, 100 ); - HETimeTh2Flagged = fs->make( "HETimeTh2Flagged", "HETimeTh2Flagged", 200, -100, 100 ); - - HETimeFlagged2 = fs->make( "HETimeFlagged2", "HETimeFlagged2", 200, -100, 100 ); - HETimeThFlagged2 = fs->make( "HETimeThFlagged2", "HETimeThFlagged2", 200, -100, 100 ); - HETimeTh1Flagged2 = fs->make( "HETimeTh1Flagged2", "HETimeTh1Flagged2", 200, -100, 100 ); - HETimeTh2Flagged2 = fs->make( "HETimeTh2Flagged2", "HETimeTh2Flagged2", 200, -100, 100 ); - - HETimeX = fs->make( "HETimeX", "HETimeX", 200, -100, 100 ); - HETimeY = fs->make( "HETimeY", "HETimeY", 200, -100, 100 ); - HEposTime = fs->make( "HEposTime", "HEposTime", 200, -100, 100 ); - HEnegTime = fs->make( "HEnegTime", "HEnegTime", 200, -100, 100 ); - HOEne = fs->make( "HOEne", "HOEne", 200, -5, 10 ); - HOEneTh = fs->make( "HOEneTh", "HOEneTh", 200, -5, 10 ); - HOEneTh1 = fs->make( "HOEneTh1", "HOEneTh1", 200, -5, 10 ); - HOTime = fs->make( "HOTime", "HOTime", 200, -100, 100 ); - HOTimeTh = fs->make( "HOTimeTh", "HOTimeTh", 200, -100, 100 ); - - // Histos for separating SiPMs and HPDs in HO: - HOSEne = fs->make( "HOSEne", "HOSEne", 12000, -20, 100 ); - HOSTime = fs->make( "HOSTime", "HOSTime", 200, -100, 100 ); - HOHEne = fs->make( "HOHEne", "HOHEne", 12000, -20, 100 ); - HOHTime = fs->make( "HOHTime", "HOHTime", 200, -100, 100 ); - - HOHr0Ene = fs->make( "HOHr0Ene" , "HOHr0Ene", 12000, -20 , 100 ); - HOHr0Time = fs->make( "HOHr0Time" , "HOHr0Time", 200, -200, 200 ); - HOHrm1Ene = fs->make( "HOHrm1Ene" , "HOHrm1Ene", 12000, -20 , 100 ); - HOHrm1Time = fs->make( "HOHrm1Time", "HOHrm1Time", 200, -200, 200 ); - HOHrm2Ene = fs->make( "HOHrm2Ene" , "HOHrm2Ene", 12000, -20 , 100 ); - HOHrm2Time = fs->make( "HOHrm2Time", "HOHrm2Time", 200, -200, 200 ); - HOHrp1Ene = fs->make( "HOHrp1Ene" , "HOHrp1Ene", 12000, -20 , 100 ); - HOHrp1Time = fs->make( "HOHrp1Time", "HOHrp1Time", 200, -200, 200 ); - HOHrp2Ene = fs->make( "HOHrp2Ene" , "HOHrp2Ene", 12000, -20 , 100 ); - HOHrp2Time = fs->make( "HOHrp2Time", "HOHrp2Time", 200, -200, 200 ); - - HBTvsE = fs->make( "HBTvsE", "HBTvsE",305, -5, 300, 100, -100, 100); - HETvsE = fs->make( "HETvsE", "HETvsE",305, -5, 300, 100, -100, 100); - - HFTvsE = fs->make( "HFTvsE", "HFTvsE",305, -5, 300, 100, -100, 100); - HFTvsEFlagged = fs->make( "HFTvsEFlagged", "HFTvsEFlagged",305, -5, 300, 100, -100, 100); - HFTvsEFlagged2 = fs->make( "HFTvsEFlagged2", "HFTvsEFlagged2",305, -5, 300, 100, -100, 100); - - HFTvsEThr = fs->make( "HFTvsEThr", "HFTvsEThr",305, -5, 300, 100, -100, 100); - HFTvsEFlaggedThr = fs->make( "HFTvsEFlaggedThr", "HFTvsEFlaggedThr",305, -5, 300, 100, -100, 100); - HFTvsEFlagged2Thr = fs->make( "HFTvsEFlagged2Thr", "HFTvsEFlagged2Thr",305, -5, 300, 100, -100, 100); - - HOTvsE = fs->make( "HOTvsE", "HOTvsE",305, -5, 300, 100, -100, 100); - - HFvsZ = fs->make( "HFvsZ", "HFvsZ",100,-50,50,100,-50,50); - - - - HOocc = fs->make( "HOocc", "HOocc",85,-42.5,42.5,70,0.5,70.5); - HBocc = fs->make( "HBocc", "HBocc",85,-42.5,42.5,70,0.5,70.5); - HEocc = fs->make( "HEocc", "HEocc",85,-42.5,42.5,70,0.5,70.5); - HFocc = fs->make( "HFocc", "HFocc",85,-42.5,42.5,70,0.5,70.5); - HFoccTime = fs->make( "HFoccTime", "HFoccTime",85,-42.5,42.5,70,0.5,70.5); - HFoccFlagged = fs->make( "HFoccFlagged", "HFoccFlagged",85,-42.5,42.5,70,0.5,70.5); - HFoccFlagged2 = fs->make( "HFoccFlagged2", "HFoccFlagged2",85,-42.5,42.5,70,0.5,70.5); - - HFEtaPhiNFlagged = fs->make( "HFEtaPhiNFlagged", "HFEtaPhiNFlagged",85,-42.5,42.5,70,0.5,70.5); - - // HFEtaFlagged = fs->make( "HFEtaFlagged", "HFEtaFlagged",85,-42.5,42.5,0, 10000); - HFEtaFlagged = fs->make( "HFEtaFlagged", "HFEtaFlagged",85,-42.5,42.5); - HFEtaFlaggedL = fs->make( "HFEtaFlaggedL", "HFEtaFlaggedL",85,-42.5,42.5); - HFEtaFlaggedLN = fs->make( "HFEtaFlaggedLN", "HFEtaFlaggedLN",85,-42.5,42.5); - HFEtaFlaggedS = fs->make( "HFEtaFlaggedS", "HFEtaFlaggedS",85,-42.5,42.5); - HFEtaFlaggedSN = fs->make( "HFEtaFlaggedSN", "HFEtaFlaggedSN",85,-42.5,42.5); - - HFEtaNFlagged = fs->make( "HFEtaNFlagged", "HFEtaNFlagged",85,-42.5,42.5,0, 10000); - - HOoccOOT = fs->make( "HOoccOOT", "HOoccOOT",85,-42.5,42.5,70,0.5,70.5); - HBoccOOT = fs->make( "HBoccOOT", "HBoccOOT",85,-42.5,42.5,70,0.5,70.5); - HEoccOOT = fs->make( "HEoccOOT", "HEoccOOT",85,-42.5,42.5,70,0.5,70.5); - HFoccOOT = fs->make( "HFoccOOT", "HFoccOOT",85,-42.5,42.5,70,0.5,70.5); - - HFEnePMT0 = fs->make( "HFEnePMT0", "HFEnePMT0", 210, -10, 200 ); - HFEnePMT1 = fs->make( "HFEnePMT1", "HFEnePMT1", 210, -10, 200 ); - HFEnePMT2 = fs->make( "HFEnePMT2", "HFEnePMT2", 210, -10, 200 ); - HFTimePMT0 = fs->make( "HFTimePMT0", "HFTimePMT0", 200, -100, 100 ); - HFTimePMT1 = fs->make( "HFTimePMT1", "HFTimePMT1", 200, -100, 100 ); - HFTimePMT2 = fs->make( "HFTimePMT2", "HFTimePMT2", 200, -100, 100 ); - - HFEne = fs->make( "HFEne", "HFEne", 210, -10, 200 ); - HFEneFlagged = fs->make( "HFEneFlagged", "HFEneFlagged", 210, -10, 200 ); - HFEneFlagged2 = fs->make( "HFEneFlagged2", "HFEneFlagged2", 210, -10, 200 ); - HFEneTh = fs->make( "HFEneTh", "HFEneTh", 210, -10, 200 ); - HFEneTh1 = fs->make( "HFEneTh1", "HFEneTh1", 210, -10, 200 ); - HFEneP = fs->make( "HFEneP", "HFEneP", 200, -5, 10 ); - HFEneM = fs->make( "HFEneM", "HFEneM", 200, -5, 10 ); - HFTime = fs->make( "HFTime", "HFTime", 200, -100, 100 ); - PMTHits = fs->make( "PMTHits", "PMTHits", 10, 0, 10 ); - HFTimeFlagged = fs->make( "HFTimeFlagged", "HFTimeFlagged", 200, -100, 100 ); - - HFTimeFlagged2 = fs->make( "HFTimeFlagged2", "HFTimeFlagged2", 200, -100, 100 ); - HFTimeThFlagged2 = fs->make( "HFTimeThFlagged2", "HFTimeThFlagged2", 200, -100, 100 ); - HFTimeTh1Flagged2 = fs->make( "HFTimeTh1Flagged2", "HFTimeTh1Flagged2", 200, -100, 100 ); - HFTimeTh2Flagged2 = fs->make( "HFTimeTh2Flagged2", "HFTimeTh2Flagged2", 200, -100, 100 ); - HFTimeTh3Flagged2 = fs->make( "HFTimeTh3Flagged2", "HFTimeTh3Flagged2", 200, -100, 100 ); - - HFTimeFlagged3 = fs->make( "HFTimeFlagged3", "HFTimeFlagged3", 200, -100, 100 ); - HFTimeThFlagged3 = fs->make( "HFTimeThFlagged3", "HFTimeThFlagged3", 200, -100, 100 ); - HFTimeTh1Flagged3 = fs->make( "HFTimeTh1Flagged3", "HFTimeTh1Flagged3", 200, -100, 100 ); - HFTimeTh2Flagged3 = fs->make( "HFTimeTh2Flagged3", "HFTimeTh2Flagged3", 200, -100, 100 ); - HFTimeTh3Flagged3 = fs->make( "HFTimeTh3Flagged3", "HFTimeTh3Flagged3", 200, -100, 100 ); - - HFTimeThFlagged = fs->make( "HFTimeThFlagged", "HFTimeThFlagged", 200, -100, 100 ); - HFTimeTh2Flagged = fs->make( "HFTimeTh2Flagged", "HFTimeTh2Flagged", 200, -100, 100 ); - HFTimeTh3Flagged = fs->make( "HFTimeTh3Flagged", "HFTimeTh3Flagged", 200, -100, 100 ); - - HFTimeThFlaggedR = fs->make( "HFTimeThFlaggedR", "HFTimeThFlaggedR", 200, -100, 100 ); - HFTimeThFlaggedR1 = fs->make( "HFTimeThFlaggedR1", "HFTimeThFlaggedR1", 200, -100, 100 ); - HFTimeThFlaggedR2 = fs->make( "HFTimeThFlaggedR2", "HFTimeThFlaggedR2", 200, -100, 100 ); - HFTimeThFlaggedR3 = fs->make( "HFTimeThFlaggedR3", "HFTimeThFlaggedR3", 200, -100, 100 ); - HFTimeThFlaggedR4 = fs->make( "HFTimeThFlaggedR4", "HFTimeThFlaggedR4", 200, -100, 100 ); - HFTimeThFlaggedRM = fs->make( "HFTimeThFlaggedRM", "HFTimeThFlaggedRM", 200, -100, 100 ); - TrkMultFlagged0 = fs->make( "TrkMultFlagged0", "TrkMultFlagged0", 100, 0, 100 ); - TrkMultFlagged1 = fs->make( "TrkMultFlagged1", "TrkMultFlagged1", 100, 0, 100 ); - TrkMultFlagged2 = fs->make( "TrkMultFlagged2", "TrkMultFlagged2", 100, 0, 100 ); - TrkMultFlagged3 = fs->make( "TrkMultFlagged3", "TrkMultFlagged3", 100, 0, 100 ); - TrkMultFlagged4 = fs->make( "TrkMultFlagged4", "TrkMultFlagged4", 100, 0, 100 ); - TrkMultFlaggedM = fs->make( "TrkMultFlaggedM", "TrkMultFlaggedM", 100, 0, 100 ); - HFTimeTh = fs->make( "HFTimeTh", "HFTimeTh", 200, -100, 100 ); - HFTimeTh1 = fs->make( "HFTimeTh1", "HFTimeTh1", 200, -100, 100 ); - HFTimeTh2 = fs->make( "HFTimeTh2", "HFTimeTh2", 200, -100, 100 ); - HFTimeTh3 = fs->make( "HFTimeTh3", "HFTimeTh3", 200, -100, 100 ); - HFTimeThR = fs->make( "HFTimeThR", "HFTimeThR", 200, -100, 100 ); - HFTimeTh1R = fs->make( "HFTimeTh1R", "HFTimeTh1R", 200, -100, 100 ); - HFTimeTh2R = fs->make( "HFTimeTh2R", "HFTimeTh2R", 200, -100, 100 ); - HFTimeTh3R = fs->make( "HFTimeTh3R", "HFTimeTh3R", 200, -100, 100 ); - HFTimeP = fs->make( "HFTimeP", "HFTimeP", 100, -100, 50 ); - HFTimeM = fs->make( "HFTimeM", "HFTimeM", 100, -100, 50 ); - HFTimePMa = fs->make( "HFTimePMa", "HFTimePMa", 100, -100, 100 ); - HFTimePM = fs->make( "HFTimePM", "HFTimePM", 100, -100, 100 ); - - // Histos for separating HF long/short fibers: - HFLEneAll = fs->make( "HFLEneAll", "HFLEneAll", 210, -10, 200 ); - HFLEneAllF = fs->make( "HFLEneAllF", "HFLEneAllF", 210, -10, 200 ); - HFSEneAll = fs->make( "HFSEneAll", "HFSEneAll", 210, -10, 200 ); - HFSEneAllF = fs->make( "HFSEneAllF", "HFSEneAllF", 210, -10, 200 ); - HFLEne = fs->make( "HFLEne", "HFLEne", 200, -5, 10 ); - HFLTime = fs->make( "HFLTime", "HFLTime", 200, -100, 100 ); - HFSEne = fs->make( "HFSEne", "HFSEne", 200, -5, 10 ); - HFSTime = fs->make( "HFSTime", "HFSTime", 200, -100, 100 ); - HFLSRatio = fs->make( "HFLSRatio", "HFLSRatio", 220, -1.1, 1.1 ); - - HFOERatio = fs->make( "HFOERatio", "HFOERatio", 2200, -1.1, 1.1 ); - - HFLvsS = fs->make( "HFLvsS", "HFLvsS",220,-20,200,220,-20,200); - HFLEneNoS = fs->make( "HFLEneNoS", "HFLEneNoS", 205, -5, 200 ); - HFSEneNoL = fs->make( "HFSEneNoL", "HFSEneNoL", 205, -5, 200 ); - HFLEneNoSFlagged = fs->make( "HFLEneNoSFlagged", "HFLEneNoSFlagged", 205, -5, 200 ); - HFSEneNoLFlagged = fs->make( "HFSEneNoLFlagged", "HFSEneNoLFlagged", 205, -5, 200 ); - HFLEneNoSFlaggedN = fs->make( "HFLEneNoSFlaggedN", "HFLEneNoSFlaggedN", 205, -5, 200 ); - HFSEneNoLFlaggedN = fs->make( "HFSEneNoLFlaggedN", "HFSEneNoLFlaggedN", 205, -5, 200 ); - - - EBEne = fs->make( "EBEne", "EBEne", 200, -5, 10 ); - EBEneTh = fs->make( "EBEneTh", "EBEneTh", 200, -5, 10 ); - EBEneX = fs->make( "EBEneX", "EBEneX", 200, -5, 10 ); - EBEneY = fs->make( "EBEneY", "EBEneY", 200, -5, 10 ); - EBTime = fs->make( "EBTime", "EBTime", 200, -100, 100 ); - EBTimeTh = fs->make( "EBTimeTh", "EBTimeTh", 200, -100, 100 ); - EBTimeX = fs->make( "EBTimeX", "EBTimeX", 200, -100, 100 ); - EBTimeY = fs->make( "EBTimeY", "EBTimeY", 200, -100, 100 ); - EEEne = fs->make( "EEEne", "EEEne", 200, -5, 10 ); - EEEneTh = fs->make( "EEEneTh", "EEEneTh", 200, -5, 10 ); - EEEneX = fs->make( "EEEneX", "EEEneX", 200, -5, 10 ); - EEEneY = fs->make( "EEEneY", "EEEneY", 200, -5, 10 ); - EEnegEne = fs->make( "EEnegEne", "EEnegEne", 200, -5, 10 ); - EEposEne = fs->make( "EEposEne", "EEposEne", 200, -5, 10 ); - EETime = fs->make( "EETime", "EETime", 200, -100, 100 ); - EETimeTh = fs->make( "EETimeTh", "EETimeTh", 200, -100, 100 ); - EETimeX = fs->make( "EETimeX", "EETimeX", 200, -100, 100 ); - EETimeY = fs->make( "EETimeY", "EETimeY", 200, -100, 100 ); - EEnegTime = fs->make( "EEnegTime", "EEnegTime", 200, -100, 100 ); - EEposTime = fs->make( "EEposTime", "EEposTime", 200, -100, 100 ); - - h_nTowersCal = fs->make( "nTowersCal", "N Towers in Jet", 100, 0, 50 ); - h_EMFracCal = fs->make( "EMFracCal", "EM Fraction in Jet", 100, -1.1, 1.1 ); - h_ptCal = fs->make( "ptCal", "p_{T} of CalJet", 100, 0, 50 ); - h_etaCal = fs->make( "etaCal", "#eta of CalJet", 100, -4, 4 ); - h_phiCal = fs->make( "phiCal", "#phi of CalJet", 50, -M_PI, M_PI ); - - h_nGenJets = fs->make( "nGenJets", "Number of GenJets", 20, 0, 20 ); - - h_ptGen = fs->make( "ptGen", "p_{T} of GenJet", 100, 0, 50 ); - h_etaGen = fs->make( "etaGen", "#eta of GenJet", 100, -4, 4 ); - h_phiGen = fs->make( "phiGen", "#phi of GenJet", 50, -M_PI, M_PI ); - - h_ptGenL = fs->make( "ptGenL", "p_{T} of GenJetL", 100, 0, 50 ); - h_etaGenL = fs->make( "etaGenL", "#eta of GenJetL", 100, -4, 4 ); - h_phiGenL = fs->make( "phiGenL", "#phi of GenJetL", 50, -M_PI, M_PI ); - - h_jetEt = fs->make( "jetEt", "Total Jet Et", 100, 0, 3000 ); - - h_jet1Pt = fs->make( "jet1Pt", "Jet1 Pt", 100, 0, 1000 ); - h_jet2Pt = fs->make( "jet2Pt", "Jet2 Pt", 100, 0, 1000 ); - h_jet1Eta = fs->make( "jet1Eta", "Jet1 Eta", 50, -5, 5 ); - h_jet2Eta = fs->make( "jet2Eta", "Jet2 Eta", 50, -5, 5 ); - h_jet1PtHLT = fs->make( "jet1PtHLT", "Jet1 Pt HLT", 100, 0, 1000 ); - - h_TotalUnclusteredEt = fs->make( "TotalUnclusteredEt", "Total Unclustered Et", 100, 0, 500 ); - h_UnclusteredEt = fs->make( "UnclusteredEt", "Unclustered Et", 100, 0, 50 ); - h_UnclusteredEts = fs->make( "UnclusteredEts", "Unclustered Et", 100, 0, 2 ); - - h_ClusteredE = fs->make( "ClusteredE", "Clustered E", 200, 0, 20 ); - h_TotalClusteredE = fs->make( "TotalClusteredE", "Total Clustered E", 200, 0, 100 ); - h_UnclusteredE = fs->make( "UnclusteredE", "Unclustered E", 200, 0, 20 ); - h_TotalUnclusteredE = fs->make( "TotalUnclusteredE", "Total Unclustered E", 200, 0, 100 ); - - jetHOEne = fs->make("jetHOEne" ,"HO Energy in Jet",100, 0,100); - jetEMFraction = fs->make( "jetEMFraction", "Jet EM Fraction", 100, -1.1, 1.1 ); - NTowers = fs->make( "NTowers", "Number of Towers", 100, 0, 100 ); - - - h_EmEnergy = fs->make( "EmEnergy", "Em Energy", 90, -45, 45, 73, 0, 73 ); - h_HadEnergy = fs->make( "HadEnergy", "Had Energy", 90, -45, 45, 73, 0, 73 ); - - st_Pt = fs->make( "st_Pt", "Pt", 200, 0, 200 ); - st_Constituents = fs->make( "st_Constituents", "Constituents", 200, 0, 200 ); - st_Energy = fs->make( "st_Energy", "Tower Energy", 200, 0, 200 ); - st_EmEnergy = fs->make( "st_EmEnergy", "Tower EmEnergy", 200, 0, 200 ); - st_HadEnergy = fs->make( "st_HadEnergy", "Tower HadEnergy", 200, 0, 200 ); - st_OuterEnergy = fs->make( "st_OuterEnergy", "Tower OuterEnergy", 200, 0, 200 ); - st_Eta = fs->make( "st_Eta", "Eta", 100, -4, 4 ); - st_Phi = fs->make( "st_Phi", "Phi", 50, -M_PI, M_PI ); - st_iEta = fs->make( "st_iEta", "iEta", 60, -30, 30 ); - st_iPhi = fs->make( "st_iPhi", "iPhi", 80, 0, 80 ); - st_Frac = fs->make( "st_Frac", "Frac", 100, 0, 1 ); - - - EBvHB = fs->make( "EBvHB", "EB vs HB",1000,0,4500000.,1000,0,1000000.); - EEvHE = fs->make( "EEvHE", "EE vs HE",1000,0,4500000.,1000,0,200000.); - - ECALvHCAL = fs->make( "ECALvHCAL", "ECAL vs HCAL",100,0,20000000.,100,-500000,500000.); - ECALvHCALEta1 = fs->make( "ECALvHCALEta1", "ECAL vs HCALEta1",100,0,20000000.,100,-500000,500000.); - ECALvHCALEta2 = fs->make( "ECALvHCALEta2", "ECAL vs HCALEta2",100,0,20000000.,100,-500000,500000.); - ECALvHCALEta3 = fs->make( "ECALvHCALEta3", "ECAL vs HCALEta3",100,0,20000000.,100,-500000,500000.); - - EMF_Eta = fs->make("EMF_Eta","EMF Eta", 100, -50, 50, 0, 10); - EMF_Phi = fs->make("EMF_Phi","EMF Phi", 100, 0, 100, 0, 10); - EMF_EtaX = fs->make("EMF_EtaX","EMF EtaX", 100, -50, 50, 0, 10); - EMF_PhiX = fs->make("EMF_PhiX","EMF PhiX", 100, 0, 100, 0, 10); - - HFTimeVsiEtaP = fs->make("HFTimeVsiEtaP","HFTimeVsiEtaP", 13, 28.5, 41.5, -100, 100); - HFTimeVsiEtaM = fs->make("HFTimeVsiEtaM","HFTimeVsiEtaM", 13, -41.5, -28.5, -100, 100); - - HFTimeVsiEtaP5 = fs->make("HFTimeVsiEtaP5","HFTimeVsiEtaP5", 13, 28.5, 41.5, -100, 100); - HFTimeVsiEtaM5 = fs->make("HFTimeVsiEtaM5","HFTimeVsiEtaM5", 13, -41.5, -28.5, -100, 100); - - HFTimeVsiEtaP20 = fs->make("HFTimeVsiEtaP20","HFTimeVsiEtaP20", 13, 28.5, 41.5, -100, 100); - HFTimeVsiEtaM20 = fs->make("HFTimeVsiEtaM20","HFTimeVsiEtaM20", 13, -41.5, -28.5, -100, 100); - - NPass = fs->make( "NPass", "NPass", 3, -1, 1 ); - NTotal = fs->make( "NTotal", "NTotal", 3, -1, 1 ); - NTime = fs->make( "NTime", "NTime", 10, 0, 10 ); - - - HFRecHitEne = fs->make( "HFRecHitEne", "HFRecHitEne", 300, 0, 3000 ); - HFRecHitEneClean = fs->make( "HFRecHitEneClean", "HFRecHitEneClean", 300, 0, 3000 ); - HFRecHitTime = fs->make( "HFRecHitTime", "HFRecHitTime", 120, -60, 60 ); - - - HFLongShortPhi = fs->make( "HFLongShortPhi", "HFLongShortPhi", 73, 0, 73 ); - HFLongShortEta = fs->make( "HFLongShortEta", "HFLongShortEta", 90, -45, 45 ); - HFLongShortEne = fs->make( "HFLongShortEne", "HFLongShortEne", 300, 0, 3000 ); - HFLongShortTime = fs->make( "HFLongShortTime", "HFLongShortTime", 120, -60, 60 ); - HFLongShortNHits = fs->make( "HFLongShortNHits", "HFLongShortNHits", 30, 0, 30 ); - - HFDigiTimePhi = fs->make( "HFDigiTimePhi", "HFDigiTimePhi", 73, 0, 73 ); - HFDigiTimeEta = fs->make( "HFDigiTimeEta", "HFDigiTimeEta", 90, -45, 45 ); - HFDigiTimeEne = fs->make( "HFDigiTimeEne", "HFDigiTimeEne", 300, 0, 3000 ); - HFDigiTimeTime = fs->make( "HFDigiTimeTime", "HFDigiTimeTime", 120, -60, 60 ); - HFDigiTimeNHits = fs->make( "HFDigiTimeNHits", "HFDigiTimeNHits", 30, 0, 30 ); - - totBNC = 0; - for (int i=0; i<4000; i++) nBNC[i] = 0; - -} - -// ************************ -// ************************ -void myJetAna::analyze( const edm::Event& evt, const edm::EventSetup& es ) { - - using namespace edm; - - bool Pass, Pass_HFTime, Pass_DiJet, Pass_BunchCrossing, Pass_Vertex; - - int EtaOk10, EtaOk13, EtaOk40; - - double LeadMass; - - double HFRecHit[100][100][2]; - int HFRecHitFlag[100][100][2]; - - double towerEtCut, towerECut, towerE; - - towerEtCut = 1.0; - towerECut = 1.0; - - unsigned int StableRun = 123732; - - double HBHEThreshold = 2.0; - double HFThreshold = 2.0; - double HOThreshold = 2.0; - double EBEEThreshold = 2.0; - - double HBHEThreshold1 = 4.0; - double HFThreshold1 = 4.0; - double HOThreshold1 = 4.0; - //double EBEEThreshold1 = 4.0; - - double HBHEThreshold2 = 10.0; - double HFThreshold2 = 10.0; - //double HOThreshold2 = 10.0; - //double EBEEThreshold2 = 10.0; - - double HBHEThreshold3 = 40.0; - double HFThreshold3 = 40.0; - //double HOThreshold3 = 40.0; - //double EBEEThreshold3 = 40.0; - - float minJetPt = 20.; - float minJetPt10 = 10.; - int jetInd, allJetInd; - - // Handle dcsStatus; - // evt.getByLabel("scalersRawToDigi", dcsStatus); - // std::cout << dcsStatus << std::endl; - // if (dcsStatus.isValid()) { - // } - - // DcsStatus dcsStatus; - // Handle dcsStatus; - // evt.getByLabel("dcsStatus", dcsStatus); - - - math::XYZTLorentzVector p4tmp[2], p4cortmp[2]; - - // -------------------------------------------------------------- - // -------------------------------------------------------------- - - /*** - std::cout << ">>>> ANA: Run = " << evt.id().run() - << " Event = " << evt.id().event() - << " Bunch Crossing = " << evt.bunchCrossing() - << " Orbit Number = " << evt.orbitNumber() - << " Luminosity Block = " << evt.luminosityBlock() - << std::endl; - ***/ - - // ********************* - // *** Filter Event - // ********************* - Pass = false; - - /*** - if (evt.bunchCrossing()== 100) { - Pass = true; - } else { - Pass = false; - } - ***/ - - // *********************** - // *** Pass Trigger - // *********************** - - - // **** Get the TriggerResults container - Handle triggerResults; - evt.getByLabel(theTriggerResultsLabel, triggerResults); - // evt.getByLabel("TriggerResults::HLT", triggerResults); - - if (triggerResults.isValid()) { - edm::LogInfo("myJetAna") << "trigger valid " ; - // edm::TriggerNames triggerNames; // TriggerNames class - // triggerNames.init(*triggerResults); - unsigned int n = triggerResults->size(); - for (unsigned int i=0; i!=n; i++) { - - /*** - std::cout << ">>> Trigger Name (" << i << ") = " << triggerNames.triggerName(i) - << " Accept = " << triggerResults->accept(i) - << std::endl; - ***/ - /**** - if (triggerResults->accept(i) == 1) { - std::cout << "+++ Trigger Name (" << i << ") = " << triggerNames.triggerName(i) - << " Accept = " << triggerResults->accept(i) - << std::endl; - } - ****/ - - // if (DEBUG) std::cout << triggerNames.triggerName(i) << std::endl; - - // if ( (triggerNames.triggerName(i) == "HLT_ZeroBias") || - // (triggerNames.triggerName(i) == "HLT_MinBias") || - // (triggerNames.triggerName(i) == "HLT_MinBiasHcal") ) { - - } - - } else { - - edm::Handle *tr = new edm::Handle; - triggerResults = (*tr); - - // std::cout << "triggerResults is not valid" << std::endl; - // std::cout << triggerResults << std::endl; - // std::cout << triggerResults.isValid() << std::endl; - - edm::LogInfo("myJetAna") << "trigger not valid " << std::endl; - edm::LogInfo("myJetAna") << "TriggerResults::HLT not found, " - "automatically select events"; - - //return; - } - - - - /*** - Handle gtRecord; - evt.getByLabel("gtDigis",gtRecord); - const TechnicalTriggerWord tWord = gtRecord->technicalTriggerWord(); - - ***/ - - - // ************************* - // *** Pass Bunch Crossing - // ************************* - - // *** Check Luminosity Section - if (evt.id().run() == 122294) - if ( (evt.luminosityBlock() >= 37) && (evt.luminosityBlock() <= 43) ) - Pass = true; - if (evt.id().run() == 122314) - if ( (evt.luminosityBlock() >= 24) && (evt.luminosityBlock() <= 37) ) - Pass = true; - if (evt.id().run() == 123575) - Pass = true; - if (evt.id().run() == 123596) - Pass = true; - - // *********** - if (evt.id().run() == 124009) { - if ( (evt.bunchCrossing() == 51) || - (evt.bunchCrossing() == 151) || - (evt.bunchCrossing() == 2824) ) { - Pass = true; - } - } - - if (evt.id().run() == 124020) { - if ( (evt.bunchCrossing() == 51) || - (evt.bunchCrossing() == 151) || - (evt.bunchCrossing() == 2824) ) { - Pass = true; - } - } - - if (evt.id().run() == 124024) { - if ( (evt.bunchCrossing() == 51) || - (evt.bunchCrossing() == 151) || - (evt.bunchCrossing() == 2824) ) { - Pass = true; - } - } - - if ( (evt.bunchCrossing() == 51) || - (evt.bunchCrossing() == 151) || - (evt.bunchCrossing() == 2596) || - (evt.bunchCrossing() == 2724) || - (evt.bunchCrossing() == 2824) || - (evt.bunchCrossing() == 3487) ) { - Pass_BunchCrossing = true; - } else { - Pass_BunchCrossing = false; - } - - - // *********************** - // *** Pass HF Timing - // *********************** - - double HFM_ETime, HFP_ETime; - double HFM_E, HFP_E; - double HF_PMM; - - HFM_ETime = 0.; - HFM_E = 0.; - HFP_ETime = 0.; - HFP_E = 0.; - - for (int i=0; i<100; i++) { - for (int j=0; j<100; j++) { - HFRecHit[i][j][0] = -10.; - HFRecHit[i][j][1] = -10.; - HFRecHitFlag[i][j][0] = 0; - HFRecHitFlag[i][j][1] = 0; - } - } - - - int nTime = 0; - int NHFLongShortHits; - int NHFDigiTimeHits; - NHFLongShortHits = 0; - NHFDigiTimeHits = 0; - - // edm::Handle vertexCollection; - - std::vector > colls; - evt.getManyByType(colls); - - std::vector >::iterator i; - for (i=colls.begin(); i!=colls.end(); i++) { - - for (HFRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) { - if (j->id().subdet() == HcalForward) { - - HFRecHitEne->Fill(j->energy()); - if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 0) && - (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 0) ) { - HFRecHitEneClean->Fill(j->energy()); - } - - HFRecHitTime->Fill(j->time()); - - int myFlag; - myFlag= j->flagField(HcalCaloFlagLabels::HFLongShort); - if (myFlag==1) { - NHFLongShortHits++; - HFLongShortPhi->Fill(j->id().iphi()); - HFLongShortEta->Fill(j->id().ieta()); - HFLongShortEne->Fill(j->energy()); - HFLongShortTime->Fill(j->time()); - } - - myFlag= j->flagField(HcalCaloFlagLabels::HFDigiTime); - if (myFlag==1) { - NHFDigiTimeHits++; - HFDigiTimePhi->Fill(j->id().iphi()); - HFDigiTimeEta->Fill(j->id().ieta()); - HFDigiTimeEne->Fill(j->energy()); - HFDigiTimeTime->Fill(j->time()); - } - - - float en = j->energy(); - float time = j->time(); - if ((en > 20.) && (time>20.)) { - HFoccTime->Fill(j->id().ieta(),j->id().iphi()); - nTime++; - } - HcalDetId id(j->detid().rawId()); - int ieta = id.ieta(); - int iphi = id.iphi(); - int depth = id.depth(); - - - // Long: depth = 1 - // Short: depth = 2 - HFRecHit[ieta+41][iphi][depth-1] = en; - HFRecHitFlag[ieta+41][iphi][depth-1] = j->flagField(0); - - /**** - std::cout << "RecHit Flag = " - << j->flagField(0)a - << std::endl; - ***/ - - if (j->id().ieta()<0) { - if (j->energy() > HFThreshold) { - HFM_ETime += j->energy()*j->time(); - HFM_E += j->energy(); - } - } else { - if (j->energy() > HFThreshold) { - HFP_ETime += j->energy()*j->time(); - HFP_E += j->energy(); - } - } - - } - } - break; - } - - edm::LogInfo("myJetAna") << "N HF Hits" << NHFLongShortHits << " " << NHFDigiTimeHits ; - HFLongShortNHits->Fill(NHFLongShortHits); - HFDigiTimeNHits->Fill(NHFDigiTimeHits); - - NTime->Fill(nTime); - - double OER = 0, OddEne, EvenEne; - int nOdd, nEven; - - for (int iphi=0; iphi<100; iphi++) { - OddEne = EvenEne = 0.; - nOdd = 0; - nEven = 0; - for (int ieta=0; ieta<100; ieta++) { - if (HFRecHit[ieta][iphi][0] > 1.0) { - if (ieta%2 == 0) { - EvenEne += HFRecHit[ieta][iphi][0]; - nEven++; - } else { - OddEne += HFRecHit[ieta][iphi][0]; - nOdd++; - } - } - if (HFRecHit[ieta][iphi][1] > 1.0) { - if (ieta%2 == 0) { - EvenEne += HFRecHit[ieta][iphi][1]; - nEven++; - } else { - OddEne += HFRecHit[ieta][iphi][1]; - nOdd++; - } - } - } - if (((OddEne + EvenEne) > 10.) && (nOdd > 1) && (nEven > 1)) { - OER = (OddEne - EvenEne) / (OddEne + EvenEne); - HFOERatio->Fill(OER); - } - } - - if ((HFP_E > 0.) && (HFM_E > 0.)) { - HF_PMM = (HFP_ETime / HFP_E) - (HFM_ETime / HFM_E); - HFTimePMa->Fill(HF_PMM); - } else { - HF_PMM = INVALID; - } - - - if (fabs(HF_PMM) < 10.) { - Pass_HFTime = true; - } else { - Pass_HFTime = false; - } - - - // ************************** - // *** Pass DiJet Criteria - // ************************** - double highestPt; - double nextPt; - // double dphi; - int nDiJet, nJet; - - nJet = 0; - nDiJet = 0; - - Handle caloJets; - evt.getByLabel( CaloJetAlgorithm, caloJets ); - for( CaloJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) { - - // TODO: verify first two jets are the leading jets - if (nJet == 0) p4tmp[0] = cal->p4(); - if (nJet == 1) p4tmp[1] = cal->p4(); - - if ( (cal->pt() > 3.) && - (fabs(cal->eta()) < 3.0) ) { - nDiJet++; - } - nJet++; - - } - - - if (nDiJet > 1) { - //dphi = deltaPhi(p4tmp[0].phi(), p4tmp[1].phi()); - Pass_DiJet = true; - } else { - // dphi = INVALID; - Pass_DiJet = false; - } - - - // ************************** - // *** Pass Vertex - // ************************** - double VTX = 0.; - int nVTX; - - edm::Handle vertexCollection; - evt.getByLabel("offlinePrimaryVertices", vertexCollection); - const reco::VertexCollection vC = *(vertexCollection.product()); - - // std::cout << "Reconstructed "<< vC.size() << " vertices" << std::endl ; - - nVTX = vC.size(); - for (reco::VertexCollection::const_iterator vertex=vC.begin(); vertex!=vC.end(); vertex++){ - VTX = vertex->z(); - } - - if ( (fabs(VTX) < 20.) && (nVTX > 0) ){ - Pass_Vertex = true; - } else { - Pass_Vertex = false; - } - - // *********************** - // *********************** - - - nBNC[evt.bunchCrossing()]++; - totBNC++; - - // Pass = true; - - // *** Check for tracks - // edm::Handle trackCollection; - // evt.getByLabel("generalTracks", trackCollection); - // const reco::TrackCollection tC = *(trackCollection.product()); - // if ((Pass) && (tC.size()>1)) { - // } else { - // Pass = false; - // } - - - // ******************************** - // *** Pixel Clusters - // ******************************** - edm::Handle< edmNew::DetSetVector > hClusterColl; - evt.getByLabel("siPixelClusters", hClusterColl); - auto const & clustColl = *(hClusterColl.product()); - - edm::Handle trackCollection; - evt.getByLabel("generalTracks", trackCollection); - auto const & tC = *(trackCollection.product()); - - - // ************************** - // *** Event Passed Selection - // ************************** - - - if (evt.id().run() == 1) { - if ( (Pass_DiJet) && - (Pass_Vertex) ) { - Pass = true; - } else { - Pass = false; - } - //Pass = true; - - } else { - if ( (Pass_BunchCrossing) && - (Pass_HFTime) && - (Pass_Vertex) ) { - Pass = true; - } else { - Pass = false; - } - } - - /*** - std::cout << "+++ Result " - << " Event = " - << evt.id().run() - << " LS = " - << evt.luminosityBlock() - << " dphi = " - << dphi - << " Pass = " - << Pass - << std::endl; - ***/ - - NTotal->Fill(0); - - //Pass = false; - if ((tC.size() > 100) && (clustColl.size() > 1000)) Pass = true; - //Pass = true; - - /**** - if (Pass_HFTime) { - Pass = true; - } else { - Pass = false; - } - ****/ - - // ************************** - // *** Noise Summary Object - // ************************** - - edm::Handle summary_h; - evt.getByLabel(hcalNoiseSummaryTag_, summary_h); - if(!summary_h.isValid()) { - throw edm::Exception(edm::errors::ProductNotFound) << " could not find HcalNoiseSummary.\n"; - // return true; - } - - const HcalNoiseSummary summary = *summary_h; - - bool Pass_NoiseSummary; - Pass_NoiseSummary = true; - if(summary.minE2Over10TS()<0.7) { - Pass_NoiseSummary = false; - } - if(summary.maxE2Over10TS()>0.96) { - Pass_NoiseSummary = false; - } - if(summary.maxHPDHits()>=17) { - Pass_NoiseSummary = false; - } - if(summary.maxRBXHits()>=999) { - Pass_NoiseSummary = false; - } - if(summary.maxHPDNoOtherHits()>=10) { - Pass_NoiseSummary = false; - } - if(summary.maxZeros()>=10) { - Pass_NoiseSummary = false; - } - if(summary.min25GeVHitTime()<-9999.0) { - Pass_NoiseSummary = false; - } - if(summary.max25GeVHitTime()>9999.0) { - Pass_NoiseSummary = false; - } - if(summary.minRBXEMF()<0.01) { - } - - if (Pass_NoiseSummary) { - Pass = false; - } else { - Pass = true; - } - - - //Pass = true; - if (Pass) { - - NPass->Fill(0); - - // ********************* - // *** Classify Event - // ********************* - int evtType = 0; - - Handle caloTowers; - evt.getByLabel( "towerMaker", caloTowers ); - - RBX RBXColl[36]; - HPD HPDColl[144]; - - for (int i=0;i<36;i++) { - RBXColl[i].et = 0; - RBXColl[i].hadEnergy = 0; - RBXColl[i].emEnergy = 0; - RBXColl[i].hcalTime = 0; - RBXColl[i].ecalTime = 0; - RBXColl[i].nTowers = 0; - } - for (int i=0;i<144;i++) { - HPDColl[i].et = 0; - HPDColl[i].hadEnergy = 0; - HPDColl[i].emEnergy = 0; - HPDColl[i].hcalTime = 0; - HPDColl[i].ecalTime = 0; - HPDColl[i].nTowers = 0; - } - - double ETotal, emFrac; - double HCALTotalCaloTowerE, ECALTotalCaloTowerE; - double HCALTotalCaloTowerE_Eta1, ECALTotalCaloTowerE_Eta1; - double HCALTotalCaloTowerE_Eta2, ECALTotalCaloTowerE_Eta2; - double HCALTotalCaloTowerE_Eta3, ECALTotalCaloTowerE_Eta3; - - ETotal = 0.; - emFrac = 0.; - - HCALTotalCaloTowerE = 0; - ECALTotalCaloTowerE = 0; - HCALTotalCaloTowerE_Eta1 = 0.; - ECALTotalCaloTowerE_Eta1 = 0.; - HCALTotalCaloTowerE_Eta2 = 0.; - ECALTotalCaloTowerE_Eta2 = 0.; - HCALTotalCaloTowerE_Eta3 = 0.; - ECALTotalCaloTowerE_Eta3 = 0.; - - for (CaloTowerCollection::const_iterator tower = caloTowers->begin(); - tower != caloTowers->end(); tower++) { - ETotal += tower->hadEnergy(); - ETotal += tower->emEnergy(); - } - - for (CaloTowerCollection::const_iterator tower = caloTowers->begin(); - tower != caloTowers->end(); tower++) { - - // Raw tower energy without grouping or thresholds - if (abs(tower->ieta()) < 100) EMF_Eta->Fill(tower->ieta(), emFrac); - - if (abs(tower->ieta()) < 15) { - towerHadEnHB->Fill(tower->hadEnergy()); - towerEmEnHB->Fill(tower->emEnergy()); - } - if ( (abs(tower->ieta()) > 17) && ((abs(tower->ieta()) < 30)) ){ - towerHadEnHE->Fill(tower->hadEnergy()); - towerEmEnHE->Fill(tower->emEnergy()); - } - if (abs(tower->ieta()) > 29) { - towerHadEnHF->Fill(tower->hadEnergy()); - towerEmEnHF->Fill(tower->emEnergy()); - } - - towerHadEn->Fill(tower->hadEnergy()); - towerEmEn->Fill(tower->emEnergy()); - towerOuterEn->Fill(tower->outerEnergy()); - - // towerHadEt->Fill(tower->hadEt()); - // towerEmEt->Fill(tower->emEt()); - // towerOuterEt->Fill(tower->outerEt()); - - if ((tower->emEnergy()+tower->hadEnergy()) != 0) { - emFrac = tower->emEnergy()/(tower->emEnergy()+tower->hadEnergy()); - towerEmFrac->Fill(emFrac); - } else { - emFrac = 0.; - } - - /*** - std::cout << "ETotal = " << ETotal - << " EMF = " << emFrac - << " EM = " << tower->emEnergy() - << " Tot = " << tower->emEnergy()+tower->hadEnergy() - << " ieta/iphi = " << tower->ieta() << " / " << tower->iphi() - << std::endl; - ***/ - - if (abs(tower->iphi()) < 100) EMF_Phi->Fill(tower->iphi(), emFrac); - if (abs(tower->ieta()) < 100) EMF_Eta->Fill(tower->ieta(), emFrac); - if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) { - edm::LogInfo("myJetAna") << "Bunch Crossing = " << evt.bunchCrossing() - << " Orbit Number = " << evt.orbitNumber(); - - if (abs(tower->iphi()) < 100) EMF_PhiX->Fill(tower->iphi(), emFrac); - if (abs(tower->ieta()) < 100) EMF_EtaX->Fill(tower->ieta(), emFrac); - } - - HCALTotalCaloTowerE += tower->hadEnergy(); - ECALTotalCaloTowerE += tower->emEnergy(); - - towerE = tower->hadEnergy() + tower->emEnergy(); - if (tower->et() > towerEtCut) caloEtaEt->Fill(tower->eta()); - if (towerE > towerECut) caloEta->Fill(tower->eta()); - caloPhi->Fill(tower->phi()); - - if (fabs(tower->eta()) < 1.3) { - HCALTotalCaloTowerE_Eta1 += tower->hadEnergy(); - ECALTotalCaloTowerE_Eta1 += tower->emEnergy(); - } - if ((fabs(tower->eta()) >= 1.3) && (fabs(tower->eta()) < 2.5)) { - HCALTotalCaloTowerE_Eta2 += tower->hadEnergy(); - ECALTotalCaloTowerE_Eta2 += tower->emEnergy(); - } - if (fabs(tower->eta()) > 2.5) { - HCALTotalCaloTowerE_Eta3 += tower->hadEnergy(); - ECALTotalCaloTowerE_Eta3 += tower->emEnergy(); - } - - /*** - std::cout << "had = " << tower->hadEnergy() - << " em = " << tower->emEnergy() - << " fabs(eta) = " << fabs(tower->eta()) - << " ieta/iphi = " << tower->ieta() << " / " << tower->iphi() - << std::endl; - ***/ - - if ((tower->hadEnergy() + tower->emEnergy()) > 2.0) { - - int iRBX = tower->iphi(); - iRBX = iRBX-2; - if (iRBX == 0) iRBX = 17; - if (iRBX == -1) iRBX = 18; - iRBX = (iRBX-1)/4; - - if (tower->ieta() < 0) iRBX += 18; - if (iRBX < 36) { - RBXColl[iRBX].et += tower->et(); - RBXColl[iRBX].hadEnergy += tower->hadEnergy(); - RBXColl[iRBX].emEnergy += tower->emEnergy(); - RBXColl[iRBX].hcalTime += tower->hcalTime(); - RBXColl[iRBX].ecalTime += tower->ecalTime(); - RBXColl[iRBX].nTowers++; - } - /*** - std::cout << "iRBX = " << iRBX << " " - << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi() - << " et = " << tower->et() - << std::endl; - ***/ - int iHPD = tower->iphi(); - if (tower->ieta() < 0) iHPD = iHPD + 72; - if (iHPD < 144) { - HPDColl[iHPD].et += tower->et(); - HPDColl[iHPD].hadEnergy += tower->hadEnergy(); - HPDColl[iHPD].emEnergy += tower->emEnergy(); - HPDColl[iHPD].hcalTime += tower->hcalTime(); - HPDColl[iHPD].ecalTime += tower->ecalTime(); - HPDColl[iHPD].nTowers++; - } - /*** - std::cout << "iHPD = " << iHPD << " " - << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi() - << " et = " << tower->et() - << std::endl; - ***/ - - } - - } - - ECALvHCAL->Fill(HCALTotalCaloTowerE, ECALTotalCaloTowerE); - ECALvHCALEta1->Fill(HCALTotalCaloTowerE_Eta1, ECALTotalCaloTowerE_Eta1); - ECALvHCALEta2->Fill(HCALTotalCaloTowerE_Eta2, ECALTotalCaloTowerE_Eta2); - ECALvHCALEta3->Fill(HCALTotalCaloTowerE_Eta3, ECALTotalCaloTowerE_Eta3); - - /*** - std::cout << " Total CaloTower Energy : " - << " ETotal= " << ETotal - << " HCAL= " << HCALTotalCaloTowerE - << " ECAL= " << ECALTotalCaloTowerE - << std::endl; - ***/ - - /*** - << " HCAL Eta1 = " << HCALTotalCaloTowerE_Eta1 - << " ECAL= " << ECALTotalCaloTowerE_Eta1 - << " HCAL Eta2 = " << HCALTotalCaloTowerE_Eta2 - << " ECAL= " << ECALTotalCaloTowerE_Eta2 - << " HCAL Eta3 = " << HCALTotalCaloTowerE_Eta3 - << " ECAL= " << ECALTotalCaloTowerE_Eta3 - << std::endl; - ***/ - - - // Loop over the RBX Collection - int nRBX = 0; - int nTowers = 0; - for (int i=0;i<36;i++) { - RBX_et->Fill(RBXColl[i].et); - RBX_hadEnergy->Fill(RBXColl[i].hadEnergy); - RBX_hcalTime->Fill(RBXColl[i].hcalTime / RBXColl[i].nTowers); - RBX_nTowers->Fill(RBXColl[i].nTowers); - if (RBXColl[i].hadEnergy > 3.0) { - nRBX++; - nTowers = RBXColl[i].nTowers; - } - } - RBX_N->Fill(nRBX); - if ( (nRBX == 1) && (nTowers > 24) ) { - evtType = 1; - } - - // Loop over the HPD Collection - int nHPD = 0; - for (int i=0;i<144;i++) { - HPD_et->Fill(HPDColl[i].et); - HPD_hadEnergy->Fill(HPDColl[i].hadEnergy); - HPD_hcalTime->Fill(HPDColl[i].hcalTime / HPDColl[i].nTowers); - HPD_nTowers->Fill(HPDColl[i].nTowers); - if (HPDColl[i].hadEnergy > 3.0) { - nHPD++; - nTowers = HPDColl[i].nTowers; - } - } - HPD_N->Fill(nHPD); - if ( (nHPD == 1) && (nTowers > 6) ) { - evtType = 2; - edm::LogInfo("category") << " nHPD = " << nHPD - << " Towers = " << nTowers - << " Type = " << evtType ; - } - - // ************************************************************** - // ** Access Trigger Information - // ************************************************************** - - // **** Get the TriggerResults container - Handle triggerResults; - evt.getByLabel(theTriggerResultsLabel, triggerResults); - - Int_t JetLoPass = 0; - - if (triggerResults.isValid()) { - edm::LogInfo("myJetAna") << "trigger valid " ; - // edm::TriggerNames triggerNames; // TriggerNames class - // triggerNames.init(*triggerResults); - unsigned int n = triggerResults->size(); - for (unsigned int i=0; i!=n; i++) { - - /*** - std::cout << " Trigger Name = " << triggerNames.triggerName(i) - << " Accept = " << triggerResults->accept(i) - << std::endl; - ***/ - - // if (DEBUG) std::cout << triggerNames.triggerName(i) << std::endl; - - /*** - if ( triggerNames.triggerName(i) == "HLT_Jet30" ) { - JetLoPass = triggerResults->accept(i); - if (DEBUG) std::cout << "Found HLT_Jet30 " - << JetLoPass - << std::endl; - } - ***/ - - } - - } else { - - edm::Handle *tr = new edm::Handle; - triggerResults = (*tr); - - // std::cout << "triggerResults is not valid" << std::endl; - // std::cout << triggerResults << std::endl; - // std::cout << triggerResults.isValid() << std::endl; - - edm::LogInfo("myJetAna") << "trigger not valid "; - edm::LogInfo("myJetAna") << "TriggerResults::HLT not found, " - "automatically select events"; - //return; - } - - /**** - Handle gtRecord_h; - evt.getByType (gtRecord_h); // assume only one L1 trigger record here - const L1GlobalTriggerReadoutRecord* gtRecord = gtRecord_h.failedToGet () ? 0 : &*gtRecord_h; - - if (gtRecord) { // object is available - for (int l1bit = 0; l1bit < 128; ++l1bit) { - if (gtRecord->decisionWord() [l1bit]) h_L1TrigBit->Fill (l1bit); - } - } - ****/ - - - - - // ************************************************************** - // ** Loop over the two leading CaloJets and fill some histograms - // ************************************************************** - Handle caloJets; - evt.getByLabel( CaloJetAlgorithm, caloJets ); - - - jetInd = 0; - allJetInd = 0; - - EtaOk10 = 0; - EtaOk13 = 0; - EtaOk40 = 0; - - // const JetCorrector* corrector = - // JetCorrector::getJetCorrector (JetCorrectionService, es); - - - highestPt = 0.0; - nextPt = 0.0; - - for( CaloJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) { - - // double scale = corrector->correction (*cal); - double scale = 1.0; - double corPt = scale*cal->pt(); - // double corPt = cal->pt(); - // cout << "Pt = " << cal->pt() << endl; - - if (corPt>highestPt) { - nextPt = highestPt; - p4cortmp[1] = p4cortmp[0]; - highestPt = corPt; - p4cortmp[0] = scale*cal->p4(); - } else if (corPt>nextPt) { - nextPt = corPt; - p4cortmp[1] = scale*cal->p4(); - } - - allJetInd++; - if (allJetInd == 1) { - h_jet1Pt->Fill( cal->pt() ); - h_jet1Eta->Fill( cal->eta() ); - if (JetLoPass != 0) h_jet1PtHLT->Fill( cal->pt() ); - p4tmp[0] = cal->p4(); - if ( fabs(cal->eta()) < 1.0) EtaOk10++; - if ( fabs(cal->eta()) < 1.3) EtaOk13++; - if ( fabs(cal->eta()) < 4.0) EtaOk40++; - } - if (allJetInd == 2) { - h_jet2Pt->Fill( cal->pt() ); - h_jet2Eta->Fill( cal->eta() ); - p4tmp[1] = cal->p4(); - if ( fabs(cal->eta()) < 1.0) EtaOk10++; - if ( fabs(cal->eta()) < 1.3) EtaOk13++; - if ( fabs(cal->eta()) < 4.0) EtaOk40++; - } - - if ( cal->pt() > minJetPt) { - const std::vector jetCaloRefs = cal->getCaloConstituents(); - int nConstituents = jetCaloRefs.size(); - h_nTowersCal->Fill(nConstituents); - h_EMFracCal->Fill(cal->emEnergyFraction()); - h_ptCal->Fill( cal->pt() ); - h_etaCal->Fill( cal->eta() ); - h_phiCal->Fill( cal->phi() ); - jetInd++; - } - } - - h_nCalJets->Fill( jetInd ); - - if (jetInd > 1) { - LeadMass = (p4tmp[0]+p4tmp[1]).mass(); - dijetMass->Fill( LeadMass ); - } - - - // ****************** - // *** Jet Properties - // ****************** - - int nTow1, nTow2, nTow3, nTow4; - // Handle jets; - // evt.getByLabel( CaloJetAlgorithm, jets ); - - // ********************************************************* - // --- Loop over jets and make a list of all the used towers - int jjet = 0; - for ( CaloJetCollection::const_iterator ijet=caloJets->begin(); ijet!=caloJets->end(); ijet++) { - jjet++; - - float hadEne = ijet->hadEnergyInHB() + ijet->hadEnergyInHO() + - ijet->hadEnergyInHE() + ijet->hadEnergyInHF(); - float emEne = ijet->emEnergyInEB() + ijet->emEnergyInEE() + ijet->emEnergyInHF(); - float had = ijet->energyFractionHadronic(); - float j_et = ijet->et(); - - // *** Barrel - if (fabs(ijet->eta()) < 1.3) { - totEneLeadJetEta1->Fill(hadEne+emEne); - hadEneLeadJetEta1->Fill(ijet->hadEnergyInHB()); - emEneLeadJetEta1->Fill(ijet->emEnergyInEB()); - if (ijet->pt() > minJetPt10) hadFracEta1->Fill(had); - } - - // *** EndCap - if ((fabs(ijet->eta()) > 1.3) && (fabs(ijet->eta()) < 3.) ) { - totEneLeadJetEta2->Fill(hadEne+emEne); - hadEneLeadJetEta2->Fill(ijet->hadEnergyInHE()); - emEneLeadJetEta2->Fill(ijet->emEnergyInEE()); - if (ijet->pt() > minJetPt10) hadFracEta2->Fill(had); - } - - // *** Forward - if (fabs(ijet->eta()) > 3.) { - totEneLeadJetEta3->Fill(hadEne+emEne); - hadEneLeadJetEta3->Fill(hadEne); - emEneLeadJetEta3->Fill(emEne); - if (ijet->pt() > minJetPt10) hadFracEta3->Fill(had); - } - - // *** CaloTowers in Jet - const std::vector jetCaloRefs = ijet->getCaloConstituents(); - int nConstituents = jetCaloRefs.size(); - NTowers->Fill(nConstituents); - - if (jjet == 1) { - - nTow1 = nTow2 = nTow3 = nTow4 = 0; - for (int i = 0; i et(); - - if (et > 0.5) nTow1++; - if (et > 1.0) nTow2++; - if (et > 1.5) nTow3++; - if (et > 2.0) nTow4++; - - hf_TowerJetEt->Fill(et/j_et); - - } - - nTowersLeadJetPt1->Fill(nTow1); - nTowersLeadJetPt2->Fill(nTow2); - nTowersLeadJetPt3->Fill(nTow3); - nTowersLeadJetPt4->Fill(nTow4); - - } - - } - - - // ********************** - // *** Unclustered Energy - // ********************** - - double SumPtJet(0); - - double SumEtNotJets(0); - double SumEtJets(0); - double SumEtTowers(0); - double TotalClusteredE(0); - double TotalUnclusteredE(0); - - double sumJetPx(0); - double sumJetPy(0); - - double sumTowerAllPx(0); - double sumTowerAllPy(0); - - double sumTowerAllEx(0); - double sumTowerAllEy(0); - - // double HCALTotalE; - double HBTotalE, HETotalE, HOTotalE, HFTotalE; - // double ECALTotalE; - double EBTotalE, EETotalE; - - std::vector UsedTowerList; - std::vector TowerUsedInJets; - std::vector TowerNotUsedInJets; - - // ********************* - // *** Hcal recHits - // ********************* - - edm::Handle spd; - - // HCALTotalE = 0.; - HBTotalE = HETotalE = HOTotalE = HFTotalE = 0.; - std::vector > colls; - evt.getManyByType(colls); - std::vector >::iterator i; - for (i=colls.begin(); i!=colls.end(); i++) { - - - for (HBHERecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) { - // std::cout << *j << std::endl; - if (j->id().subdet() == HcalBarrel) { - HBEne->Fill(j->energy()); - HBTime->Fill(j->time()); - if (!Pass_NoiseSummary) HBTimeFlagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HBTimeFlagged->Fill(j->time()); - HBTvsE->Fill(j->energy(), j->time()); - - if (j->time() > 20.) HBEneTThr->Fill(j->energy()); - - if ((j->time()<-25.) || (j->time()>75.)) { - HBEneOOT->Fill(j->energy()); - if (j->energy() > HBHEThreshold) HBEneOOTTh->Fill(j->energy()); - if (j->energy() > HBHEThreshold1) HBEneOOTTh1->Fill(j->energy()); - } - if (j->energy() > HBHEThreshold) { - HBEneTh->Fill(j->energy()); - HBTimeTh->Fill(j->time()); - if (!Pass_NoiseSummary) HBTimeThFlagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HBTimeThFlagged->Fill(j->time()); - - if (evt.id().run() >= StableRun) HBTimeThR->Fill(j->time()); - HBTotalE += j->energy(); - HBocc->Fill(j->id().ieta(),j->id().iphi()); - hitEta->Fill(j->id().ieta()); - hitPhi->Fill(j->id().iphi()); - } - if (j->energy() > HBHEThreshold1) { - HBEneTh1->Fill(j->energy()); - HBTimeTh1->Fill(j->time()); - if (!Pass_NoiseSummary) HBTimeTh1Flagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HBTimeTh1Flagged->Fill(j->time()); - - if (evt.id().run() >= StableRun) HBTimeTh1R->Fill(j->time()); - if ((j->time()<-25.) || (j->time()>75.)) { - HBoccOOT->Fill(j->id().ieta(),j->id().iphi()); - } - } - if (j->energy() > HBHEThreshold2) { - HBTimeTh2->Fill(j->time()); - if (!Pass_NoiseSummary) HBTimeTh2Flagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HBTimeTh2Flagged->Fill(j->time()); - - if (evt.id().run() >= StableRun) HBTimeTh2R->Fill(j->time()); - } - if (j->energy() > HBHEThreshold3) { - HBTimeTh3->Fill(j->time()); - if (evt.id().run() >= StableRun) HBTimeTh3R->Fill(j->time()); - } - if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) { - HBEneX->Fill(j->energy()); - if (j->energy() > HBHEThreshold) HBTimeX->Fill(j->time()); - } - if ( (evt.id().run() == 120020) && (evt.id().event() == 457) ) { - HBEneY->Fill(j->energy()); - if (j->energy() > HBHEThreshold) HBTimeY->Fill(j->time()); - } - } - if (j->id().subdet() == HcalEndcap) { - HEEne->Fill(j->energy()); - HETime->Fill(j->time()); - if (!Pass_NoiseSummary) HETimeFlagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HETimeFlagged->Fill(j->time()); - HETvsE->Fill(j->energy(), j->time()); - - if (j->time() > 20.) HEEneTThr->Fill(j->energy()); - - if ((j->time()<-25.) || (j->time()>75.)) { - HEEneOOT->Fill(j->energy()); - if (j->energy() > HBHEThreshold) HEEneOOTTh->Fill(j->energy()); - if (j->energy() > HBHEThreshold1) HEEneOOTTh1->Fill(j->energy()); - } - - if (j->energy() > HBHEThreshold) { - HEEneTh->Fill(j->energy()); - HETimeTh->Fill(j->time()); - if (!Pass_NoiseSummary) HETimeThFlagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HETimeThFlagged->Fill(j->time()); - - if (evt.id().run() >= StableRun) HETimeThR->Fill(j->time()); - HETotalE += j->energy(); - HEocc->Fill(j->id().ieta(),j->id().iphi()); - hitEta->Fill(j->id().ieta()); - hitPhi->Fill(j->id().iphi()); - } - if (j->energy() > HBHEThreshold1) { - HEEneTh1->Fill(j->energy()); - HETimeTh1->Fill(j->time()); - if (!Pass_NoiseSummary) HETimeTh1Flagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HETimeTh1Flagged->Fill(j->time()); - if (evt.id().run() >= StableRun) HETimeTh1R->Fill(j->time()); - if ((j->time()<-25.) || (j->time()>75.)) { - HEoccOOT->Fill(j->id().ieta(),j->id().iphi()); - } - } - if (j->energy() > HBHEThreshold2) { - HETimeTh2->Fill(j->time()); - if (!Pass_NoiseSummary) HETimeTh2Flagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HETimeTh2Flagged->Fill(j->time()); - if (evt.id().run() >= StableRun) HETimeTh2R->Fill(j->time()); - } - if (j->energy() > HBHEThreshold3) { - HETimeTh3->Fill(j->time()); - if (evt.id().run() >= StableRun) HETimeTh3R->Fill(j->time()); - } - - if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) { - HEEneX->Fill(j->energy()); - if (j->energy() > HBHEThreshold) HETimeX->Fill(j->time()); - } - if ( (evt.id().run() == 120020) && (evt.id().event() == 457) ) { - HEEneY->Fill(j->energy()); - if (j->energy() > HBHEThreshold) HETimeY->Fill(j->time()); - } - - // Fill +-HE separately - if (j->id().ieta()<0) { - HEnegEne->Fill(j->energy()); - if (j->energy() > HBHEThreshold) { - HEnegTime->Fill(j->time()); - } - } else { - HEposEne->Fill(j->energy()); - if (j->energy() > HBHEThreshold) { - HEposTime->Fill(j->time()); - } - } - - } - - /*** - std::cout << j->id() << " " - << j->id().subdet() << " " - << j->id().ieta() << " " - << j->id().iphi() << " " - << j->id().depth() << " " - << j->energy() << " " - << j->time() << std::endl; - ****/ - } - } - - - HFM_ETime = 0.; - HFM_E = 0.; - HFP_ETime = 0.; - HFP_E = 0.; - - int NPMTHits; - NPMTHits = 0; - std::vector > collsNPMT; - evt.getManyByType(collsNPMT); - std::vector >::iterator iNPMT; - for (iNPMT=collsNPMT.begin(); iNPMT!=collsNPMT.end(); iNPMT++) { - for (HFRecHitCollection::const_iterator j=(*iNPMT)->begin(); j!=(*iNPMT)->end(); j++) { - if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) || - (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) { - NPMTHits++; - } - } - break; - } - PMTHits->Fill(NPMTHits); - - - std::vector > collsHFRecHit; - evt.getManyByType(collsHFRecHit); - std::vector >::iterator iHFRecHit; - for (iHFRecHit=collsHFRecHit.begin(); iHFRecHit!=collsHFRecHit.end(); iHFRecHit++) { - for (HFRecHitCollection::const_iterator j=(*iHFRecHit)->begin(); j!=(*iHFRecHit)->end(); j++) { - - /**** - float en = j->energy(); - HcalDetId id(j->detid().rawId()); - int ieta = id.ieta(); - int iphi = id.iphi(); - int depth = id.depth(); - *****/ - - // std::cout << *j << std::endl; - - if (j->id().subdet() == HcalForward) { - - if (NPMTHits == 1) { - if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) || - (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) { - HFEtaFlagged->Fill(j->id().ieta()); - if (j->id().depth() == 1) HFEtaFlaggedL->Fill(j->id().ieta()); - if (j->id().depth() == 2) HFEtaFlaggedS->Fill(j->id().ieta()); - } else { - HFEtaNFlagged->Fill(j->id().ieta(), j->energy()); - HFEtaPhiNFlagged->Fill(j->id().ieta(),j->id().iphi(),j->energy()); - } - } - if (j->energy() > 20.) { - if (NPMTHits == 0) { - HFEnePMT0->Fill(j->energy()); - HFTimePMT0->Fill(j->time()); - } - if (NPMTHits == 1) { - if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) || - (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) { - HFEnePMT1->Fill(j->energy()); - HFTimePMT1->Fill(j->time()); - } - } - if (NPMTHits > 1) { - if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) || - (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) { - HFEnePMT2->Fill(j->energy()); - HFTimePMT2->Fill(j->time()); - } - } - } - - HFTimeVsiEtaP->Fill(j->id().ieta(), j->time()); - HFTimeVsiEtaM->Fill(j->id().ieta(), j->time()); - - if (j->energy() > 5.) { - HFTimeVsiEtaP5->Fill(j->id().ieta(), j->time()); - HFTimeVsiEtaM5->Fill(j->id().ieta(), j->time()); - } - - if (j->energy() > 20.) { - HFTimeVsiEtaP20->Fill(j->id().ieta(), j->time()); - HFTimeVsiEtaM20->Fill(j->id().ieta(), j->time()); - } - - HFEne->Fill(j->energy()); - HFTime->Fill(j->time()); - HFTvsE->Fill(j->energy(), j->time()); - - if (j->time() > 20.) HFEneTThr->Fill(j->energy()); - - if (j->energy() > 10.) HFTvsEThr->Fill(j->energy(), j->time()); - - if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1)|| - (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) { - HFEneFlagged->Fill(j->energy()); - HFoccFlagged->Fill(j->id().ieta(),j->id().iphi()); - HFTimeFlagged->Fill(j->time()); - HFTvsEFlagged->Fill(j->energy(), j->time()); - - // std::cout << "Flagged: " << j->energy() << " " - // << j->time() - // << std::endl; - } - - - if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) { - HFEneFlagged2->Fill(j->energy()); - HFoccFlagged2->Fill(j->id().ieta(),j->id().iphi()); - HFTimeFlagged2->Fill(j->time()); - HFTvsEFlagged2->Fill(j->energy(), j->time()); - if (j->energy() > 10.) HFTvsEFlagged2Thr->Fill(j->energy(), j->time()); - } - - if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) { - HFTimeFlagged3->Fill(j->time()); - } - - if (j->energy() > HFThreshold) { - HFEneTh->Fill(j->energy()); - HFTimeTh->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) HFTimeThFlagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) HFTimeThFlagged3->Fill(j->time()); - - if (evt.id().run() >= StableRun) HFTimeThR->Fill(j->time()); - if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1)|| - (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) { - - HFTimeThFlagged->Fill(j->time()); - - if (j->energy() > HFThreshold2) HFTimeTh2Flagged->Fill(j->time()); - if (j->energy() > HFThreshold3) HFTimeTh3Flagged->Fill(j->time()); - - if (evt.id().run() >= StableRun) { - HFTimeThFlaggedR->Fill(j->time()); - if (NPMTHits == 1) HFTimeThFlaggedR1->Fill(j->time()); - if (NPMTHits == 2) HFTimeThFlaggedR2->Fill(j->time()); - if (NPMTHits == 3) HFTimeThFlaggedR3->Fill(j->time()); - if (NPMTHits == 4) HFTimeThFlaggedR4->Fill(j->time()); - if (NPMTHits > 1) HFTimeThFlaggedRM->Fill(j->time()); - } - } - HFTotalE += j->energy(); - HFocc->Fill(j->id().ieta(),j->id().iphi()); - hitEta->Fill(j->id().ieta()); - hitPhi->Fill(j->id().iphi()); - } - - if (j->energy() > HFThreshold1) { - HFEneTh1->Fill(j->energy()); - HFTimeTh1->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) HFTimeTh1Flagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) HFTimeTh1Flagged3->Fill(j->time()); - if (evt.id().run() >= StableRun) HFTimeTh1R->Fill(j->time()); - if ((j->time()<-20.) || (j->time()>20.)) { - HFoccOOT->Fill(j->id().ieta(),j->id().iphi()); - } - } - if (j->energy() > HFThreshold2) { - HFTimeTh2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) HFTimeTh2Flagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) HFTimeTh2Flagged3->Fill(j->time()); - if (evt.id().run() >= StableRun) HFTimeTh2R->Fill(j->time()); - } - if (j->energy() > HFThreshold3) { - HFTimeTh3->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) HFTimeTh3Flagged2->Fill(j->time()); - if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) HFTimeTh3Flagged3->Fill(j->time()); - if (evt.id().run() >= StableRun) HFTimeTh3R->Fill(j->time()); - } - - if (j->id().ieta()<0) { - if (j->energy() > HFThreshold) { - // HFTimeM->Fill(j->time()); - HFEneM->Fill(j->energy()); - HFM_ETime += j->energy()*j->time(); - HFM_E += j->energy(); - } - } else { - if (j->energy() > HFThreshold) { - // HFTimeP->Fill(j->time()); - HFEneP->Fill(j->energy()); - HFP_ETime += j->energy()*j->time(); - HFP_E += j->energy(); - } - } - - // Long and short fibers - if (j->id().depth() == 1){ - HFLEne->Fill(j->energy()); - if (j->energy() > HFThreshold) HFLTime->Fill(j->time()); - } else { - HFSEne->Fill(j->energy()); - if (j->energy() > HFThreshold) HFSTime->Fill(j->time()); - } - } - } - break; - - } - - - - - for (int ieta=0; ieta<100; ieta++) { - for (int iphi=0; iphi<100; iphi++) { - double longF, shortF; - if (HFRecHit[ieta][iphi][0] == -10.) { - longF = 0.; - } else { - longF = HFRecHit[ieta][iphi][0]; - } - if (HFRecHit[ieta][iphi][1] == -10.) { - shortF = 0.; - } else { - shortF = HFRecHit[ieta][iphi][1]; - } - // if ((longF > HFThreshold) || (shortF > HFThreshold)) HFLSRatio->Fill((longF-shortF)/(longF+shortF)); - - if (longF > 0.) HFLEneAll->Fill(longF); - if (shortF > 0.) HFSEneAll->Fill(shortF); - - - if ((longF > 20.) || (shortF > 20.)) { - double R = (longF-shortF)/(longF+shortF); - HFLSRatio->Fill(R); - if (fabs(R) > 0.995) { - - // if (longF > 110.) { - // if (longF > 50.) { - if (longF > (162.4-10.19*abs(ieta-41)+.21*abs(ieta-41)*abs(ieta-41)) ) { - HFEtaFlaggedLN->Fill(ieta-41); - - HFLEneAllF->Fill(longF); - - if (shortF == 0.) HFLEneNoSFlaggedN->Fill(longF); - } - // if (shortF > 70.) { - // if (shortF > 50.) { - if (shortF > (129.9-6.61*abs(ieta-41)+0.1153*abs(ieta-41)*abs(ieta-41)) ) { - HFEtaFlaggedSN->Fill(ieta-41); - - HFSEneAllF->Fill(shortF); - - if (longF == 0.) HFSEneNoLFlaggedN->Fill(shortF); - } - } - } - /*** - cout << "HF LS Ratio long= " - << longF - << " short= " - << shortF - << endl; - ***/ - - HFLvsS->Fill(HFRecHit[ieta][iphi][1], HFRecHit[ieta][iphi][0]); - if ( (HFRecHit[ieta][iphi][1] == -10.) && (HFRecHit[ieta][iphi][0] != -10.) ) { - HFLEneNoS->Fill(HFRecHit[ieta][iphi][0]); - if (HFRecHitFlag[ieta][iphi][0] !=0 ) HFLEneNoSFlagged->Fill(HFRecHit[ieta][iphi][0]); - } - if ( (HFRecHit[ieta][iphi][0] == -10.) && (HFRecHit[ieta][iphi][1] != -10.) ) { - HFSEneNoL->Fill(HFRecHit[ieta][iphi][1]); - if (HFRecHitFlag[ieta][iphi][1] !=0 ) HFSEneNoLFlagged->Fill(HFRecHit[ieta][iphi][1]); - } - - } - } - - if (HFP_E > 0.) HFTimeP->Fill(HFP_ETime / HFP_E); - if (HFM_E > 0.) HFTimeM->Fill(HFM_ETime / HFM_E); - - if ((HFP_E > 0.) && (HFM_E > 0.)) { - HF_PMM = (HFP_ETime / HFP_E) - (HFM_ETime / HFM_E); - HFTimePM->Fill(HF_PMM); - } else { - HF_PMM = INVALID; - } - - - - std::vector > collsHORecHit; - evt.getManyByType(collsHORecHit); - std::vector >::iterator iHORecHit; - for (iHORecHit=collsHORecHit.begin(); iHORecHit!=collsHORecHit.end(); iHORecHit++) { - for (HORecHitCollection::const_iterator j=(*iHORecHit)->begin(); j!=(*iHORecHit)->end(); j++) { - if (j->id().subdet() == HcalOuter) { - HOEne->Fill(j->energy()); - HOTime->Fill(j->time()); - HOTvsE->Fill(j->energy(), j->time()); - if (j->energy() > HOThreshold1) { - HOEneTh1->Fill(j->energy()); - } - if (j->energy() > HOThreshold) { - HOEneTh->Fill(j->energy()); - HOTimeTh->Fill(j->time()); - HOTotalE += j->energy(); - HOocc->Fill(j->id().ieta(),j->id().iphi()); - } - - // Separate SiPMs and HPDs: - if (((j->id().iphi()>=59 && j->id().iphi()<=70 && - j->id().ieta()>=11 && j->id().ieta()<=15) || - (j->id().iphi()>=47 && j->id().iphi()<=58 && - j->id().ieta()>=5 && j->id().ieta()<=10))) - { - HOSEne->Fill(j->energy()); - if (j->energy() > HOThreshold) HOSTime->Fill(j->time()); - } else if ((j->id().iphi()<59 || j->id().iphi()>70 || - j->id().ieta()<11 || j->id().ieta()>15) && - (j->id().iphi()<47 || j->id().iphi()>58 || - j->id().ieta()<5 || j->id().ieta()>10)) - { - HOHEne->Fill(j->energy()); - if (j->energy() > HOThreshold) HOHTime->Fill(j->time()); - // Separate rings -1,-2,0,1,2 in HPDs: - if (j->id().ieta()<= -11){ - HOHrm2Ene->Fill(j->energy()); - if (j->energy() > HOThreshold) HOHrm2Time->Fill(j->time()); - } else if (j->id().ieta()>= -10 && j->id().ieta() <= -5) { - HOHrm1Ene->Fill(j->energy()); - if (j->energy() > HOThreshold) HOHrm1Time->Fill(j->time()); - } else if (j->id().ieta()>= -4 && j->id().ieta() <= 4) { - HOHr0Ene->Fill(j->energy()); - if (j->energy() > HOThreshold) HOHr0Time->Fill(j->time()); - } else if (j->id().ieta()>= 5 && j->id().ieta() <= 10) { - HOHrp1Ene->Fill(j->energy()); - if (j->energy() > HOThreshold) HOHrp1Time->Fill(j->time()); - } else if (j->id().ieta()>= 11) { - HOHrp2Ene->Fill(j->energy()); - if (j->energy() > HOThreshold) HOHrp2Time->Fill(j->time()); - } else { - edm::LogInfo("myJetAna") << "Finding events that are in no ring !?!" ; - edm::LogInfo("myJetAna") << "eta = " << j->id().ieta() ; - - } - } else { - edm::LogInfo("myJetAna") << "Finding events that are neither SiPM nor HPD!?"; - } - - - - } - // std::cout << *j << std::endl; - } - } - - // HCALTotalE = HBTotalE + HETotalE + HFTotalE + HOTotalE; - // ECALTotalE = 0.; - EBTotalE = EETotalE = 0.; - - - std::vector > collsEcalRecHit; - evt.getManyByType(collsEcalRecHit); - std::vector >::iterator iEcalRecHit; - for (iEcalRecHit=collsEcalRecHit.begin(); iEcalRecHit!=collsEcalRecHit.end(); iEcalRecHit++) { - for (EcalRecHitCollection::const_iterator j=(*iEcalRecHit)->begin(); j!=(*iEcalRecHit)->end(); j++) { - if (j->id().subdetId() == EcalBarrel) { - EBEne->Fill(j->energy()); - EBTime->Fill(j->time()); - if (j->energy() > EBEEThreshold) { - EBEneTh->Fill(j->energy()); - EBTimeTh->Fill(j->time()); - } - if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) { - EBEneX->Fill(j->energy()); - EBTimeX->Fill(j->time()); - } - if ( (evt.id().run() == 120020) && (evt.id().event() == 457) ) { - EBEneY->Fill(j->energy()); - EBTimeY->Fill(j->time()); - } - EBTotalE += j->energy(); - } - if (j->id().subdetId() == EcalEndcap) { - EEEne->Fill(j->energy()); - EETime->Fill(j->time()); - if (j->energy() > EBEEThreshold) { - EEEneTh->Fill(j->energy()); - EETimeTh->Fill(j->time()); - } - if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) { - EEEneX->Fill(j->energy()); - EETimeX->Fill(j->time()); - } - if ( (evt.id().run() == 120020) && (evt.id().event() == 457 ) ) { - EEEneY->Fill(j->energy()); - EETimeY->Fill(j->time()); - } - EETotalE += j->energy(); - } - // std::cout << *j << std::endl; - // std::cout << "EB ID = " << j->id().subdetId() << "/" << EcalBarrel << std::endl; - } - } - - EBvHB->Fill(HBTotalE, EBTotalE); - EEvHE->Fill(HETotalE, EETotalE); - - /***** - std::vector > colls; - evt.getManyByType(colls); - std::vector >::iterator i; - - for (i=colls.begin(); i!=colls.end(); i++) { - for (EBRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) { - // if (j->id().subdetId() == EcalBarrel) { - EBEne->Fill(j->energy()); - EBTime->Fill(j->time()); - // EBTotalE = j->energy(); - // } - // std::cout << *j << std::endl; - // std::cout << "EB ID = " << j->id().subdetId() << "/" << EcalBarrel << std::endl; - } - } - - std::vector > colls; - evt.getManyByType(colls); - std::vector >::iterator i; - for (i=colls.begin(); i!=colls.end(); i++) { - for (EERecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) { - // if (j->id().subdetId() == EcalEndcap) { - EEEne->Fill(j->energy()); - EETime->Fill(j->time()); - // EETotalE = j->energy(); - // Separate +-EE; - EEDetId EEid = EEDetId(j->id()); - if (!EEid.positiveZ()) - { - EEnegEne->Fill(j->energy()); - EEnegTime->Fill(j->time()); - }else{ - EEposEne->Fill(j->energy()); - EEposTime->Fill(j->time()); - } - // } - // std::cout << *j << std::endl; - } - } - ******/ - - // ECALTotalE = EBTotalE + EETotalE; - - if ( (EBTotalE > 320000) && (EBTotalE < 330000) && - (HBTotalE > 2700000) && (HBTotalE < 2800000) ) { - - edm::LogInfo("myJetAna") << "Off Axis! " ; - - } - - /*** - std::cout << " Rechits: Total Energy : " - << " HCAL= " << HCALTotalE - << " ECAL= " << ECALTotalE - << " HB = " << HBTotalE - << " EB = " << EBTotalE - << std::endl; - ***/ - - - // ********************* - // *** CaloTowers - // ********************* - // Handle caloTowers; - // evt.getByLabel( "towerMaker", caloTowers ); - - nTow1 = nTow2 = nTow3 = nTow4 = 0; - - double sum_et = 0.0; - double sum_ex = 0.0; - double sum_ey = 0.0; - - double HFsum_et = 0.0; - double HFsum_ex = 0.0; - double HFsum_ey = 0.0; - // double sum_ez = 0.0; - - - // std::cout<<">>>> Run " << evt.id().run() << " Event " << evt.id().event() << std::endl; - // --- Loop over towers and make a lists of used and unused towers - for (CaloTowerCollection::const_iterator tower = caloTowers->begin(); - tower != caloTowers->end(); tower++) { - - Double_t et = tower->et(); - Double_t phix = tower->phi(); - - if (et > 0.5) nTow1++; - if (et > 1.0) nTow2++; - if (et > 1.5) nTow3++; - if (et > 2.0) nTow4++; - - // if ( (fabs(tower->ieta() > 42)) || (fabs(tower->iphi()) > 72) ) { - // std::cout << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi() << std::endl; - // } - - if (tower->emEnergy() > 2.0) { - h_EmEnergy->Fill (tower->ieta(), tower->iphi(), tower->emEnergy()); - } - if (tower->hadEnergy() > 2.0) { - h_HadEnergy->Fill (tower->ieta(), tower->iphi(), tower->hadEnergy()); - } - - if (fabs(tower->ieta()) > 29) { - HFsum_et += et; - HFsum_ex += et*cos(phix); - HFsum_ey += et*sin(phix); - } - - - if (et>0.5) { - - ETime->Fill(tower->ecalTime()); - HTime->Fill(tower->hcalTime()); - - // ******** - // double theta = tower->theta(); - // double e = tower->energy(); - // double et = e*sin(theta); - // double et = tower->emEt() + tower->hadEt(); - // sum_ez += e*cos(theta); - sum_et += et; - sum_ex += et*cos(phix); - sum_ey += et*sin(phix); - // ******** - - Double_t phi = tower->phi(); - SumEtTowers += tower->et(); - - sumTowerAllEx += et*cos(phi); - sumTowerAllEy += et*sin(phi); - - } - - } - - // SumEt->Fill(sum_et); - // MET->Fill(sqrt( sum_ex*sum_ex + sum_ey*sum_ey)); - - HFSumEt->Fill(HFsum_et); - HFMET->Fill(sqrt( HFsum_ex*HFsum_ex + HFsum_ey*HFsum_ey)); - - hf_sumTowerAllEx->Fill(sumTowerAllEx); - hf_sumTowerAllEy->Fill(sumTowerAllEy); - - nTowers1->Fill(nTow1); - nTowers2->Fill(nTow2); - nTowers3->Fill(nTow3); - nTowers4->Fill(nTow4); - - - // ********************* - // ********************* - - UsedTowerList.clear(); - TowerUsedInJets.clear(); - TowerNotUsedInJets.clear(); - - // --- Loop over jets and make a list of all the used towers - // evt.getByLabel( CaloJetAlgorithm, jets ); - for ( CaloJetCollection::const_iterator ijet=caloJets->begin(); ijet!=caloJets->end(); ijet++) { - - Double_t jetPt = ijet->pt(); - Double_t jetEta = ijet->eta(); - Double_t jetPhi = ijet->phi(); - - // if (jetPt>5.0) { - - Double_t jetPx = jetPt*cos(jetPhi); - Double_t jetPy = jetPt*sin(jetPhi); - - sumJetPx +=jetPx; - sumJetPy +=jetPy; - - const std::vector jetCaloRefs = ijet->getCaloConstituents(); - int nConstituents = jetCaloRefs.size(); - for (int i = 0; i 80.0) && (fabs(jetEta) < 1.3) ){ - st_Pt->Fill( jetPt ); - int nConstituents = ijet->getCaloConstituents().size(); - st_Constituents->Fill( nConstituents ); - - float maxEne = 0.; - float totEne = 0.; - - for(unsigned twr=0; twrgetCaloConstituents().size(); ++twr){ - CaloTowerPtr tower = (ijet->getCaloConstituents())[twr]; - // CaloTowerDetId id = tower->id(); - if( tower->et()>0. ){ - - if (tower->energy() > maxEne) maxEne = tower->energy(); - totEne += tower->energy(); - - st_Energy->Fill( tower->energy() ); - st_EmEnergy->Fill( tower->emEnergy() ); - st_HadEnergy->Fill( tower->hadEnergy() ); - st_OuterEnergy->Fill( tower->outerEnergy() ); - - st_Eta->Fill( tower->eta() ); - st_Phi->Fill( tower->phi() ); - - st_iEta->Fill( tower->ieta() ); - st_iPhi->Fill( tower->iphi() ); - - /**** - std::cout << ">>> Towers : " - << " " << tower->energy() - << " " << tower->emEnergy() - << " " << tower->hadEnergy() - << " " << tower->outerEnergy() - << " " << tower->et() - << " " << tower->emEt() - << " " << tower->hadEt() - << " " << tower->outerEt() - << " " << tower->eta() - << " " << tower->phi() - << std::endl; - ****/ - } - } - st_Frac->Fill( maxEne / totEne ); - - } - - } - - int NTowersUsed = UsedTowerList.size(); - - // --- Loop over towers and make a lists of used and unused towers - for (CaloTowerCollection::const_iterator tower = caloTowers->begin(); - tower != caloTowers->end(); tower++) { - - CaloTower t = *tower; - Double_t et = tower->et(); - - if(et>0) { - - Double_t phi = tower->phi(); - SumEtTowers += tower->et(); - - sumTowerAllPx += et*cos(phi); - sumTowerAllPy += et*sin(phi); - - bool used = false; - - for(int i=0; iid() == UsedTowerList[i]->id()){ - used=true; - break; - } - } - - if (used) { - TowerUsedInJets.push_back(t); - } else { - TowerNotUsedInJets.push_back(t); - } - } - } - - int nUsed = TowerUsedInJets.size(); - int nNotUsed = TowerNotUsedInJets.size(); - - SumEtJets = 0; - SumEtNotJets = 0; - TotalClusteredE = 0; - TotalUnclusteredE = 0; - - for(int i=0;iFill(TowerUsedInJets[i].energy()); - if (TowerUsedInJets[i].energy() > 1.0) - TotalClusteredE += TowerUsedInJets[i].energy(); - } - h_jetEt->Fill(SumEtJets); - - for(int i=0;i 0.5) - SumEtNotJets += TowerNotUsedInJets[i].et(); - h_UnclusteredEt->Fill(TowerNotUsedInJets[i].et()); - h_UnclusteredEts->Fill(TowerNotUsedInJets[i].et()); - h_UnclusteredE->Fill(TowerNotUsedInJets[i].energy()); - if (TowerNotUsedInJets[i].energy() > 1.0) - TotalUnclusteredE += TowerNotUsedInJets[i].energy(); - } - - h_TotalClusteredE->Fill(TotalClusteredE); - h_TotalUnclusteredE->Fill(TotalUnclusteredE); - h_TotalUnclusteredEt->Fill(SumEtNotJets); - - // ******************************** - // *** CaloMET - // ******************************** - - edm::Handle calometcoll; - evt.getByLabel("met", calometcoll); - if (calometcoll.isValid()) { - const CaloMETCollection *calometcol = calometcoll.product(); - const CaloMET *calomet; - calomet = &(calometcol->front()); - - double caloSumET = calomet->sumEt(); - double caloMET = calomet->pt(); - double caloMETSig = calomet->mEtSig(); - double caloMEx = calomet->px(); - double caloMEy = calomet->py(); - double caloMETPhi = calomet->phi(); - - SumEt->Fill(caloSumET); - MET->Fill(caloMET); - if (std::abs(OER) > 0.8) OERMET->Fill(caloMET); - - if (evtType == 0) MET_Tower->Fill(caloMET); - if (evtType == 1) MET_RBX->Fill(caloMET); - if (evtType == 2) MET_HPD->Fill(caloMET); - METSig->Fill(caloMETSig); - MEx->Fill(caloMEx); - MEy->Fill(caloMEy); - METPhi->Fill(caloMETPhi); - - /*** - double caloEz = calomet->e_longitudinal(); - - double caloMaxEtInEMTowers = calomet->maxEtInEmTowers(); - double caloMaxEtInHadTowers = calomet->maxEtInHadTowers(); - double caloEtFractionHadronic = calomet->etFractionHadronic(); - double caloEmEtFraction = calomet->emEtFraction(); - - double caloHadEtInHB = calomet->hadEtInHB(); - double caloHadEtInHO = calomet->hadEtInHO(); - double caloHadEtInHE = calomet->hadEtInHE(); - double caloHadEtInHF = calomet->hadEtInHF(); - double caloEmEtInEB = calomet->emEtInEB(); - double caloEmEtInEE = calomet->emEtInEE(); - double caloEmEtInHF = calomet->emEtInHF(); - ****/ - } - - // ******************************** - // *** Vertex - // ******************************** - VTX = INVALID; - - edm::Handle vertexCollection; - evt.getByLabel("offlinePrimaryVertices", vertexCollection); - const reco::VertexCollection vC = *(vertexCollection.product()); - - // std::cout << "Reconstructed "<< vC.size() << " vertices" << std::endl ; - nVTX = vC.size(); - //double vertex_numTrks; - for (reco::VertexCollection::const_iterator vertex=vC.begin(); vertex!=vC.end(); vertex++){ - - h_Vx->Fill(vertex->x()); - h_Vy->Fill(vertex->y()); - h_Vz->Fill(vertex->z()); - VTX = vertex->z(); - // vertex_numTrks = vertex->tracksSize(); - // h_VNTrks->Fill(vertex_numTrks); - - } - - if ((HF_PMM != INVALID) || (nVTX > 0)) { - HFvsZ->Fill(HF_PMM,VTX); - } - - // ******************************** - // *** Pixel Clusters - // ******************************** - // edm::Handle< edmNew::DetSetVector > hClusterColl; - // evt.getByLabel("siPixelClusters", hClusterColl); - // const edmNew::DetSetVector clustColl = *(hClusterColl.product()); - - SiClusters->Fill(clustColl.size()); - - // ******************************** - // *** Tracks - // ******************************** - // edm::Handle trackCollection; - // evt.getByLabel("ctfWithMaterialTracks", trackCollection); - // evt.getByLabel("generalTracks", trackCollection); - // const reco::TrackCollection tC = *(trackCollection.product()); - - // std::cout << "ANA: Reconstructed "<< tC.size() << " tracks" << std::endl ; - - // ************************************* - /***** - //Get the Vertex Collection - edm::Handle > verticies; evt.getByLabel("offlinePrimaryVertices", verticies); - - //Fill the variables - int _ntracksw5 = 0; - for (std::vector::const_iterator it = verticies->begin(); it != verticies->end(); ++it) { - - // ntracks->push_back(int(it->tracksSize())); //all tracks considered for vertexing - // isvalid->push_back(int(it->isValid())); - // isfake->push_back(int(it->isFake())); - - if(it->tracksSize() > 0) { - std::vector::const_iterator trackIt; - for( trackIt = it->tracks_begin(); trackIt != it->tracks_end(); trackIt++) { - if(fabs((**trackIt).charge()) <= 1.) { - //tracks that contribute with more than 0.5 weight in vertex reconstruction - if (it->trackWeight(*trackIt) >= 0.5 ) - _ntracksw5++; - } - } - } - } - *****/ - // ************************************* - - - h_Trk_NTrk->Fill(tC.size()); - if (NPMTHits == 0) TrkMultFlagged0->Fill(tC.size()); - if (NPMTHits == 1) TrkMultFlagged1->Fill(tC.size()); - if (NPMTHits == 2) TrkMultFlagged2->Fill(tC.size()); - if (NPMTHits == 3) TrkMultFlagged3->Fill(tC.size()); - if (NPMTHits == 4) TrkMultFlagged4->Fill(tC.size()); - if (NPMTHits > 1) TrkMultFlaggedM->Fill(tC.size()); - for (reco::TrackCollection::const_iterator track=tC.begin(); track!=tC.end(); track++){ - h_Trk_pt->Fill(track->pt()); - } - - - /**** - std::cout << "Track number "<< i << std::endl ; - std::cout << "\tmomentum: " << track->momentum()<< std::endl; - std::cout << "\tPT: " << track->pt()<< std::endl; - std::cout << "\tvertex: " << track->vertex()<< std::endl; - std::cout << "\timpact parameter: " << track->d0()<< std::endl; - std::cout << "\tcharge: " << track->charge()<< std::endl; - std::cout << "\tnormalizedChi2: " << track->normalizedChi2()<< std::endl; - - cout<<"\tFrom EXTRA : "<outerPt()<seedDirection() << std::endl; - ****/ - - // ******************************** - // *** Photons - // ******************************** - /*** - edm::Handle photonCollection; - evt.getByLabel("photons", photonCollection); - const reco::PhotonCollection pC = *(photonCollection.product()); - - std::cout << "Reconstructed "<< pC.size() << " photons" << std::endl ; - for (reco::PhotonCollection::const_iterator photon=pC.begin(); photon!=pC.end(); photon++){ - } - ***/ - - // ******************************** - // *** Muons - // ******************************** - /*** - edm::Handle muonCollection; - evt.getByLabel("muons", muonCollection); - - const reco::MuonCollection mC = *(muonCollection.product()); - - std::cout << "Reconstructed "<< mC.size() << " muons" << std::endl ; - for (reco::MuonCollection::const_iterator muon=mC.begin(); muon!=mC.end(); muon++){ - } - ***/ - - - - - // ******************************** - // *** Events passing seletion cuts - // ******************************** - - // --- Cosmic Cleanup - // --- Vertex - // --- Eta - - int iJet; - iJet = 0; - for( CaloJetCollection::const_iterator ijet = caloJets->begin(); ijet != caloJets->end(); ++ ijet ) { - - // if ( (fabs(ijet->eta()) < 1.3) && - // (fabs(ijet->pt()) > 20.) ) { - - // (ijet->emEnergyFraction() > 0.01) && - // (ijet->emEnergyFraction() > 0.99) ) { - - iJet++; - // if (iJet == 1) { - // cout << " CaloJet: Event Type = " << evtType - // << " pt = " << ijet->pt() - // << endl; - // } - h_pt->Fill(ijet->pt()); - if (evtType == 0) h_ptTower->Fill(ijet->pt()); - if (evtType == 1) h_ptRBX->Fill(ijet->pt()); - if (evtType == 2) h_ptHPD->Fill(ijet->pt()); - h_et->Fill(ijet->et()); - h_eta->Fill(ijet->eta()); - h_phi->Fill(ijet->phi()); - - jetHOEne->Fill(ijet->hadEnergyInHO()); - jetEMFraction->Fill(ijet->emEnergyFraction()); - - // } - } - - - - //***************************** - //*** Get the GenJet collection - //***************************** - - /************** - Handle genJets; - evt.getByLabel( GenJetAlgorithm, genJets ); - - //Loop over the two leading GenJets and fill some histograms - jetInd = 0; - allJetInd = 0; - for( GenJetCollection::const_iterator gen = genJets->begin(); gen != genJets->end(); ++ gen ) { - allJetInd++; - if (allJetInd == 1) { - p4tmp[0] = gen->p4(); - } - if (allJetInd == 2) { - p4tmp[1] = gen->p4(); - } - - if ( (allJetInd == 1) || (allJetInd == 2) ) { - h_ptGenL->Fill( gen->pt() ); - h_etaGenL->Fill( gen->eta() ); - h_phiGenL->Fill( gen->phi() ); - } - - if ( gen->pt() > minJetPt) { - // std::cout << "GEN JET1 #" << jetInd << std::endl << gen->print() << std::endl; - h_ptGen->Fill( gen->pt() ); - h_etaGen->Fill( gen->eta() ); - h_phiGen->Fill( gen->phi() ); - jetInd++; - } - } - - h_nGenJets->Fill( jetInd ); - *******/ - } - -} - -// *********************************** -// *********************************** -void myJetAna::endJob() { - - for (int i=0; i<4000; i++) { - if (((float)nBNC[i]/(float)totBNC) > 0.05) { - edm::LogInfo("myJetAna") << "+++ " << i << " " - << ((float)nBNC[i]/(float)totBNC) << " " - << nBNC[i] << " " - << totBNC ; - } - } - - -} -#include "FWCore/Framework/interface/MakerMacros.h" -DEFINE_FWK_MODULE(myJetAna); diff --git a/RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitLeadingEdgeAlgo.h b/RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitLeadingEdgeAlgo.h deleted file mode 100644 index bc04da2de59ec..0000000000000 --- a/RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitLeadingEdgeAlgo.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitLeadingEdgeAlgo_HH -#define RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitLeadingEdgeAlgo_HH - -/** \class EcalUncalibRecHitLeadingEdgeAlgo - * Template used to compute amplitude using the leading edge sample - * - * $Id: EcalUncalibRecHitLeadingEdgeAlgo.h - * $Date: - * $Revision: - * \author F. Ferri, M. Malberti - */ - -#include "Math/SVector.h" -#include "Math/SMatrix.h" -#include "RecoLocalCalo/EcalRecAlgos/interface/EcalUncalibRecHitRecAbsAlgo.h" - -#include "DataFormats/EcalDetId/interface/EBDetId.h" - -#include "FWCore/MessageLogger/interface/MessageLogger.h" - - -template < class C > class EcalUncalibRecHitLeadingEdgeAlgo : public EcalUncalibRecHitRecAbsAlgo < C > { - public: - // destructor - EcalUncalibRecHitLeadingEdgeAlgo < C > () : leadingSample_(0), shape_(0) { }; - virtual ~ EcalUncalibRecHitLeadingEdgeAlgo < C > () { }; - - void setLeadingEdgeSample( int isample ) { leadingSample_ = isample; } - int getLeadingEdgeSample() { return leadingSample_; } - - void setPulseShape( std::vector & shape ) { shape_ = shape; } - std::vector & getPulseShape() { return shape_; } - - /// Compute parameters - virtual EcalUncalibratedRecHit makeRecHit(const C & dataFrame, - const double *pedestals, - const double *gainRatios, - const EcalWeightSet::EcalWeightMatrix** weights, - const EcalWeightSet::EcalChi2WeightMatrix** chi2Matrix - ) - { - double amplitude_(-1.), pedestal_(-1.), jitter_(-1.), chi2_(-1.); - - // compute amplitude - amplitude_ = double (((double) (dataFrame.sample( leadingSample_ ).adc() - - pedestals[ dataFrame.sample( leadingSample_ ).gainId() - 1]) * - saturationCorrection( leadingSample_ ) * - gainRatios[ dataFrame.sample( leadingSample_ ).gainId() - 1] )); - - - - return EcalUncalibratedRecHit(dataFrame.id(), amplitude_, pedestal_, jitter_, chi2_); - } - - // saturation correction - double saturationCorrection(int unsaturatedSample) - { - if ( unsaturatedSample > 0 && unsaturatedSample < (int)shape_.size() ) { - return 1./ shape_[ unsaturatedSample ]; - } else { - edm::LogError("EcalUncalibRecHitLeadingEdgeAlgo") << "Invalid sample " << unsaturatedSample - << " for a shape vector of size " << shape_.size(); - return 0; - } - } - - private: - int leadingSample_; - std::vector< double > shape_; -}; -#endif diff --git a/RecoMuon/TrackingTools/interface/MuonSeedDetLayer.h b/RecoMuon/TrackingTools/interface/MuonSeedDetLayer.h deleted file mode 100644 index ec7d35e185207..0000000000000 --- a/RecoMuon/TrackingTools/interface/MuonSeedDetLayer.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef TrackingTools_MuonSeedDetLayer_H -#define TrackingTools_MuonSeedDetLayer_H - -/** \class MuonSeedDetLayer - * - * Muon seed detector layer - * Helper class for seed generation - * - * - * - * \author N. Neumeister Purdue University - */ - -#include "TrackingTools/DetLayers/interface/DetLayer.h" -#include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" - -// --------------------- -// -- Class Interface -- -// --------------------- - -class MuonSeedDetLayer { - - public: - - /// constructor - MuonSeedDetLayer(const DetLayer* layer, - GlobalPoint& point, - int id, - TrajectoryStateOnSurface& state) : - theLayer(layer), thePoint(point), theID(id), theState(state) {} - - /// destructor - virtual ~MuonSeedDetLayer() {} - - /// return layer - const DetLayer* layer() const { return theLayer; } - - /// return impact point - const GlobalPoint& point() const { return thePoint; } - - /// return layer identifyer - int id() const { return theID; } - - /// return trajectory state on layer - const TrajectoryStateOnSurface& state() const { return theState; } - - /// return radius of impact point - double radius() const { return sqrt(thePoint.x()*thePoint.x()+thePoint.y()*thePoint.y()); } - - /// return z coordinate of impact point - double z() const { return thePoint.z(); } - - /// sort - static bool getHigherR( const MuonSeedDetLayer first, const MuonSeedDetLayer second ) { - return first.radius() < second.radius(); - } - - /// sort - static bool getLowerR( const MuonSeedDetLayer first, const MuonSeedDetLayer second ) { - return first.radius() > second.radius(); - } - - private: - - const DetLayer* theLayer; - GlobalPoint thePoint; - int theID; - TrajectoryStateOnSurface theState; -}; -#endif - diff --git a/RecoTracker/SpecialSeedGenerators/interface/EtaPhiMeasurementEstimator.h b/RecoTracker/SpecialSeedGenerators/interface/EtaPhiMeasurementEstimator.h deleted file mode 100755 index 09c7cfafd0cb2..0000000000000 --- a/RecoTracker/SpecialSeedGenerators/interface/EtaPhiMeasurementEstimator.h +++ /dev/null @@ -1 +0,0 @@ -#error diff --git a/RecoTracker/TkMSParametrization/interface/rangesIntersect.h b/RecoTracker/TkMSParametrization/interface/rangesIntersect.h deleted file mode 100644 index e8ff66cc732ac..0000000000000 --- a/RecoTracker/TkMSParametrization/interface/rangesIntersect.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef rangesIntersect_H -#define rangesIntersect_H - -/** Utility for checking efficiently if two one-dimantional intervals - * intersect. - * Precondition: the intervals are not empty, i.e. for i in a,b - * i.first <= i.second. - * The Range template argument is expected to have the std::pair - * interface, i.e. for Range instance r r.first is the beginning of - * the interval and r.second is the end of the interval. - */ - -template -inline bool rangesIntersect( const Range& a, const Range& b) { - if ( a.first > b.second || b.first > a.second) return false; - else return true; -} - -template -inline bool rangesIntersect( const Range& a, const Range& b, - const Less& less) { - if ( less(b.second,a.first) || less(a.second,b.first)) return false; - else return true; -} -#endif diff --git a/RecoTracker/TrackProducer/interface/GsfTrackProducerAlgorithm.h b/RecoTracker/TrackProducer/interface/GsfTrackProducerAlgorithm.h deleted file mode 100644 index 8f3f2b08aa428..0000000000000 --- a/RecoTracker/TrackProducer/interface/GsfTrackProducerAlgorithm.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef GsfTrackProducerAlgorithm_h -#define GsfTrackProducerAlgorithm_h - -// -// Package: RecoTracker/TrackProducer -// Class: GsfTrackProducerAlgorithm -// -// -// Original Author: Giuseppe Cerati -// Created: Thu Mar 9 17:29:31 CET 2006 -// -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/Event.h" -#include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h" -// #include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/TrackReco/interface/TrackExtra.h" -#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" -#include "DataFormats/GsfTrackReco/interface/GsfTrackExtra.h" -#include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h" - -class MagneticField; -class TrackingGeometry; -class TrajectoryFitter; -class Propagator; -class Trajectory; -class TrajectoryStateOnSurface; -class TransientTrackingRecHitBuilder; - - -class GsfTrackProducerAlgorithm { - - public: - typedef std::pair > AlgoProduct; - typedef std::vector< AlgoProduct > AlgoProductCollection; - - GsfTrackProducerAlgorithm(const edm::ParameterSet& conf) : - conf_(conf) - { } - - ~GsfTrackProducerAlgorithm() {} - - void runWithCandidate(const TrackingGeometry *, - const MagneticField *, - const TrackCandidateCollection&, - const TrajectoryFitter *, - const Propagator *, - const TransientTrackingRecHitBuilder*, - AlgoProductCollection &); - - void runWithTrack(const TrackingGeometry *, - const MagneticField *, - const reco::TrackCollection&, - const TrajectoryFitter *, - const Propagator *, - const TransientTrackingRecHitBuilder*, - AlgoProductCollection &); - - bool buildTrack(const TrajectoryFitter *, - const Propagator *, - AlgoProductCollection& , - TransientTrackingRecHit::RecHitContainer&, - TrajectoryStateOnSurface& , - const TrajectorySeed&, - float); - - private: - edm::ParameterSet conf_; -}; - -#endif diff --git a/RecoTracker/TransientTrackingRecHit/interface/GSTransientTrackingRecHit.h b/RecoTracker/TransientTrackingRecHit/interface/GSTransientTrackingRecHit.h deleted file mode 100644 index 512cc7ffe9a9c..0000000000000 --- a/RecoTracker/TransientTrackingRecHit/interface/GSTransientTrackingRecHit.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef GSTransientTrackingRecHit_H -#define GSTransientTrackingRecHit_H - -#include "TrackingTools/TransientTrackingRecHit/interface/TValidTrackingRecHit.h" -#include "DataFormats/CLHEP/interface/AlgebraicObjects.h" - -#endif - diff --git a/RecoVertex/ConfigurableVertexReco/interface/ReconstructorFromLinPtFinder.h b/RecoVertex/ConfigurableVertexReco/interface/ReconstructorFromLinPtFinder.h deleted file mode 100644 index c1c0550c5c64d..0000000000000 --- a/RecoVertex/ConfigurableVertexReco/interface/ReconstructorFromLinPtFinder.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef _ReconstructorFromLinPtFinder_H_ -#define _ReconstructorFromLinPtFinder_H_ - -#include "RecoVertex/VertexPrimitives/interface/VertexReconstructor.h" -#include "RecoVertex/VertexTools/interface/LinearizationPointFinder.h" - -/** - * Wrap any LinearizationPointFinder into the VertexReconstructor interface - */ - -class ReconstructorFromLinPtFinder : public VertexReconstructor -{ - public: - ReconstructorFromLinPtFinder ( const LinearizationPointFinder &, int verbose=0 ); - ReconstructorFromLinPtFinder ( const ReconstructorFromLinPtFinder & o ); - ~ReconstructorFromLinPtFinder(); - std::vector < TransientVertex > vertices ( const std::vector < reco::TransientTrack > & ) const; - - ReconstructorFromLinPtFinder * clone () const; - - private: - const LinearizationPointFinder * theLinPtFinder; - int theVerbosity; -}; - -#endif diff --git a/RecoVertex/KinematicFit/interface/CombinedKinematicConstraintT.h b/RecoVertex/KinematicFit/interface/CombinedKinematicConstraintT.h deleted file mode 100644 index 6fd7f59075588..0000000000000 --- a/RecoVertex/KinematicFit/interface/CombinedKinematicConstraintT.h +++ /dev/null @@ -1,218 +0,0 @@ -#ifndef CombinedKinematicConstraintT_H -#define CombinedKinematicConstraintT_H - -#include "RecoVertex/KinematicFitPrimitives/interface/MultiTrackKinematicConstraintT.h" -#include "RecoVertex/KinematicFitPrimitives/interface/KinematicState.h" -#include "DataFormats/CLHEP/interface/AlgebraicObjects.h" -#include "RecoVertex/VertexPrimitives/interface/VertexException.h" - -// this is generic: to be moved elsewhere -#include -#include -#include -#include - -// run time iteration -template -struct do_iterate -{ - template - static void call(TupleType& t, F f) - { - f(std::get(t)); - do_iterate::call(t,f); - } - template - static void call(TupleType const & t, F f) - { - f(std::get(t)); - do_iterate::call(t,f); - } - - -}; - -template -struct do_iterate -{ - template - static void call(TupleType&, F) - {} - template - static void call(TupleType const &, F) - {} -}; - -template -void iterate_tuple(TupleType& t, F f) -{ - do_iterate::value>::call(t,f); -} - -template -void iterate_tuple(TupleType const& t, F f) -{ - do_iterate::value>::call(t,f); -} - - -namespace combinedConstraintHelpers { - - // a bit less generic - template::value> - struct totDim { - typedef typename std::tuple_element::type Elem; - enum { nDim = Elem::nDim + totDim::nDim}; - }; - - template - struct totDim { - enum { nDim=0}; - }; - - template - void sum2(T& x, T y) { x+=y;} - - // mind: iteration is backward... - template - struct Place { - int offset; - Place() : offset(DIM) {} - ~Place() { - assert(offset==DIM || offset==0); - } - }; - - template - struct PlaceValue : public Place { - PlaceValue(ROOT::Math::SVector & iret) : ret(iret){} - ROOT::Math::SVector & ret; - template - void operator()(C const & cs) { - this->offset -= C::nDim; - ret.Place_at(cs.value(),this->offset); - } - }; - - template - struct PlaceParDer : public Place { - PlaceParDer(ROOT::Math::SMatrix & iret) : ret(iret){} - ROOT::Math::SMatrix & ret; - template - void operator()(C const & cs) { - this->offset -= C::nDim; - ret.Place_at(cs.parametersDerivative(),this->offset,0); - } - }; - - template - struct PlacePosDer : public Place { - PlacePosDer(ROOT::Math::SMatrix & iret) : ret(iret){} - ROOT::Math::SMatrix & ret; - template - void operator()(C const & cs) { - this->offset -= C::nDim; - ret.Place_at(cs.positionDerivative(),this->offset,0); - } - }; - - -} - - -/** - * This class combines several user defined constraints (by expanding the vector d and the matrices D and E). - * Usage: - * Add each constraint to a std::tuple. - * This tuple has to be used in the constructor: - * - * The produced object can be used by KinematicConstrainedVertexFitter.fit() - * - * Lars Perchalla, Philip Sauerland, Dec 2009 - */ - -// maybe a variadic template will be better -template< class TupleType, int NTRK > -class CombinedKinematicConstraintT : public MultiTrackKinematicConstraintT::nDim>{ - - // need compile time assert on NTRK -public: - typedef MultiTrackKinematicConstraintBaseT base; - typedef MultiTrackKinematicConstraintT::nDim> super; - typedef typename super::valueType valueType; - typedef typename super::parametersDerivativeType parametersDerivativeType; - typedef typename super::positionDerivativeType positionDerivativeType; - - typedef TupleType Constraints; - - //FIXME - enum {DIM = super::nDim}; - - -public: - CombinedKinematicConstraintT(Constraints const & iconstraints): constraints(constraints){ - } - - // initialize the constraint so it can precompute common qualtities to the three next call - virtual void init(const std::vector& states, - const GlobalPoint& point, const GlobalVector& mf) { - iterate_tuple(constraints, - std::bind(&base::init,std::placeholders::_1,std::ref(states),std::ref(point), std::ref(mf))); - } - - -private: - /** - * fills a vector of values of the combined constraint - * equations at the point where the input - * particles are defined. - */ - void fillValue() const{ - combinedConstraintHelpers::PlaceValue helper(super::vl()); - iterate_tuple(constraints,std::ref(helper)); - } - - /** - * Returns a matrix of derivatives of the combined - * constraint equations w.r.t. - * particle parameters - */ - void fillParametersDerivative() const{ - combinedConstraintHelpers::PlaceParDer helper(super::jac_d()); - iterate_tuple(constraints,std::ref(helper)); - } - - /** - * Returns a matrix of derivatives of - * constraint equations w.r.t. - * vertex position - */ - void fillPositionDerivative() const{ - combinedConstraintHelpers::PlacePosDer helper(super::jac_e()); - iterate_tuple(constraints,std::ref(helper)); - } - -public: - /** - * Number of equations per track used for the combined fit - */ - virtual int numberOfEquations() const { - int tot=0; - iterate_tuple(constraints,std::bind(combinedConstraintHelpers::sum2,std::ref(tot), - std::bind(&base::numberOfEquations,std::placeholders::_1) - ) - ); - return tot; - } - - virtual CombinedKinematicConstraintT * clone() const - { - return new CombinedKinematicConstraintT(*this); - } - -private: - Constraints constraints; - -}; - -#endif diff --git a/RecoVertex/LinearizationPointFinders/interface/MonteCarloLinearizationPointFinder.h b/RecoVertex/LinearizationPointFinders/interface/MonteCarloLinearizationPointFinder.h deleted file mode 100644 index 2bf14e32ea432..0000000000000 --- a/RecoVertex/LinearizationPointFinders/interface/MonteCarloLinearizationPointFinder.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef MonteCarloLinearizationPointFinder_H -#define MonteCarloLinearizationPointFinder_H - -#include "RecoVertex/VertexTools/interface/LinearizationPointFinder.h" -#include "TrackingTools/TransientTrack/interface/TransientTrack.h" - - /** - * A linearization point finder that can be fed with the result. - * Naturally, this is for debugging only. - */ - -class MonteCarloLinearizationPointFinder : public LinearizationPointFinder -{ -public: - MonteCarloLinearizationPointFinder(); - - /** - * The method that allows cheating - */ - void setPoint ( const GlobalPoint & pos ); - - virtual GlobalPoint getLinearizationPoint(const std::vector & ) const; - virtual GlobalPoint getLinearizationPoint(const std::vector & ) const; - - virtual MonteCarloLinearizationPointFinder * clone() const - { - return new MonteCarloLinearizationPointFinder ( * this ); - }; -private: - GlobalPoint thePt; -}; - -#endif diff --git a/RecoVertex/LinearizationPointFinders/src/MonteCarloLinearizationPointFinder.cc b/RecoVertex/LinearizationPointFinders/src/MonteCarloLinearizationPointFinder.cc deleted file mode 100644 index b8edf6ea962a0..0000000000000 --- a/RecoVertex/LinearizationPointFinders/src/MonteCarloLinearizationPointFinder.cc +++ /dev/null @@ -1,28 +0,0 @@ -#if 0 - -#include "RecoVertex/LinearizationPointFinders/interface/MonteCarloLinearizationPointFinder.h" -#include "TrackingTools/TransientTrack/interface/TransientTrack.h" -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" - -MonteCarloLinearizationPointFinder::MonteCarloLinearizationPointFinder() : - thePt ( GlobalPoint(0.,0.,0.) ) {} - -void MonteCarloLinearizationPointFinder::setPoint ( const GlobalPoint & pos ) -{ - thePt = pos; -} - -GlobalPoint MonteCarloLinearizationPointFinder::getLinearizationPoint( - const std::vector & tracks ) const -{ - return getLinearizationPoint ( std::vector < reco::TransientTrack > () ); -} - -GlobalPoint MonteCarloLinearizationPointFinder::getLinearizationPoint( - const std::vector & tracks ) const -{ - // std::cout << "[MonteCarloLinearizationPointFinder] point " << thePt << std::endl; - return thePt; -} - -#endif diff --git a/SimCalorimetry/CaloSimAlgos/interface/CaloVNoisifier.h b/SimCalorimetry/CaloSimAlgos/interface/CaloVNoisifier.h deleted file mode 100644 index 37930e78cc8fc..0000000000000 --- a/SimCalorimetry/CaloSimAlgos/interface/CaloVNoisifier.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef CaloSimAlgos_CaloVNoisifier_h -#define CaloSimAlgos_CaloVNoisifier_h - -/** - \class CaloVNoisifier - - \brief adds noise to the given frame - -*/ - -class CaloSamples; - -class CaloVNoisifier -{ -public: - virtual void noisify(CaloSamples & frame) const=0; -}; - -#endif diff --git a/SimDataFormats/RPCDigiSimLink/interface/RPCDigiSimLinkfwd.h b/SimDataFormats/RPCDigiSimLink/interface/RPCDigiSimLinkfwd.h deleted file mode 100644 index b9579f5a5992b..0000000000000 --- a/SimDataFormats/RPCDigiSimLink/interface/RPCDigiSimLinkfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef RPCOBJECTS_RPCDIGISIMLINKFWD_H -#define RPCOBJECTS_RPCDIGISIMLINKFWD_H -class RPCDigiSimLink; -#endif // RPCOBJECTS_RPCDIGISIMLINKFWD_H diff --git a/SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLinkfwd.h b/SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLinkfwd.h deleted file mode 100644 index 4616dda3dcef4..0000000000000 --- a/SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLinkfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TRACKINGOBJECTS_PIXELDIGISIMLINKFWD_H -#define TRACKINGOBJECTS_PIXELDIGISIMLINKFWD_H -class PixelDigiSimLink; -#endif // TRACKINGOBJECTS_PIXELDIGISIMLINKFWD_H diff --git a/SimDataFormats/TrackerDigiSimLink/interface/StripCompactDigiSimLinksfwd.h b/SimDataFormats/TrackerDigiSimLink/interface/StripCompactDigiSimLinksfwd.h deleted file mode 100644 index 8f6512456343e..0000000000000 --- a/SimDataFormats/TrackerDigiSimLink/interface/StripCompactDigiSimLinksfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef SimDataFormats_TrackerDigiSimLink_StripCompactDigiSimLinksfwd_h -#define SimDataFormats_TrackerDigiSimLink_StripCompactDigiSimLinksfwd_h -class StripCompactDigiSimLinks; -#endif diff --git a/SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLinkfwd.h b/SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLinkfwd.h deleted file mode 100644 index a9c6e5113cac3..0000000000000 --- a/SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLinkfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TRACKINGOBJECTS_STRIPDIGISIMLINKFWD_H -#define TRACKINGOBJECTS_STRIPDIGISIMLINKFWD_H -class StripDigiSimLink; -#endif // TRACKINGOBJECTS_STRIPDIGISIMLINKFWD_H diff --git a/SimG4CMS/Calo/interface/HcalTestHistoClass.h b/SimG4CMS/Calo/interface/HcalTestHistoClass.h deleted file mode 100644 index 37c51ed6ec083..0000000000000 --- a/SimG4CMS/Calo/interface/HcalTestHistoClass.h +++ /dev/null @@ -1 +0,0 @@ -#include "SimDataFormats/CaloTest/interface/HcalTestHistoClass.h" diff --git a/SimG4Core/Application/interface/DDDWorldObserver.h b/SimG4Core/Application/interface/DDDWorldObserver.h deleted file mode 100644 index 5a53aa9cef5e1..0000000000000 --- a/SimG4Core/Application/interface/DDDWorldObserver.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef SimG4Core_DDDWorldObserver_H -#define SimG4Core_DDDWorldObserver_H - -#include "SimG4Core/Notification/interface/Observer.h" -#include "SimG4Core/Geometry/interface/DDDWorld.h" - -#include - -template -class DDDWorldObserver : public Observer -{ -public: - virtual void update(const DDDWorld * w) - { - std::cout << " DDDWorldObserver: in update " << std::endl; - if (w!=0) - std::cout << " DDDWorldObserver: got DDDWorld! " << std::endl; - } -}; - -#endif diff --git a/SimG4Core/Notification/interface/ComponentBuilder.h b/SimG4Core/Notification/interface/ComponentBuilder.h deleted file mode 100644 index 3ab73485c8161..0000000000000 --- a/SimG4Core/Notification/interface/ComponentBuilder.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef SimG4Core_ComponentBuilder_H -#define SimG4Core_ComponentBuilder_H - -#include - -template class ComponentBuilder -{ -public: - virtual C * constructComponent(T) = 0; - virtual std::string myName() = 0; -}; - -#endif - diff --git a/SimG4Core/Notification/interface/ComponentFactoryByName.h b/SimG4Core/Notification/interface/ComponentFactoryByName.h deleted file mode 100644 index be6226ac0f08c..0000000000000 --- a/SimG4Core/Notification/interface/ComponentFactoryByName.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SimG4Core_ComponentFactoryByName_H -#define SimG4Core_ComponentFactoryByName_H - -#include "FWCore/Utilities/interface/Exception.h" - -#include -#include - -template -class ComponentFactoryByName -{ -public: - static B * getBuilder(const std::string & name) - { - if (myMap().size() == 0) { - throw cms::Exception("SimG4CoreNotification", " ComponentFactoryByName::getBuilder: No Builder registered to the Factory."); - } - if (myMap().find(name) == myMap().end()) { - throw cms::Exception("SimG4CoreNotification", " ComponentFactoryByName::getBuilder: The Component "+name+" is not registered to the Factory."); - } - return (myMap()[name]); - } - static void setBuilder(B * in , const std::string & name) - { - if (name.empty()) { - throw cms::Exception("SimG4CoreNotification", " ComponentFactoryByName::setBuilder: The registration of Components without name is not allowed."); - } - myMap()[name] = in; - } - typedef std::map BuilderMapType; -protected: - static BuilderMapType & myMap() - { - static BuilderMapType me_; - return me_; - } -}; - -#endif - - - diff --git a/SimG4Core/Notification/interface/DispatchableG4Step.h b/SimG4Core/Notification/interface/DispatchableG4Step.h deleted file mode 100644 index 297b5f6d17d0e..0000000000000 --- a/SimG4Core/Notification/interface/DispatchableG4Step.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SimG4Core_DispatchableG4Step_H -#define SimG4Core_DispatchableG4Step_H - -#include "G4Step.hh" - -typedef G4Step DispatchableG4Step; - -#endif diff --git a/SimG4Core/Notification/interface/OwnIt.h b/SimG4Core/Notification/interface/OwnIt.h deleted file mode 100644 index 9ea056188d008..0000000000000 --- a/SimG4Core/Notification/interface/OwnIt.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef OwnIt_H -#define OwnIt_H -/** a very very simple auto_ptr. - if static get destrying at the end avoiding - fake memory leaks... - */ -template -class OwnIt { -public: - typedef OwnIt self; - OwnIt(T * p=0) : it(p){} - - ~OwnIt() { reset();} - inline self& operator=(T * p) { if (it) delete it; it=p; return * this;} - inline T * get() const { return it;} - inline void reset() { if (it) { delete it; it=0; } } - -private: - T * it; - -}; - -#endif // OwnIt_H diff --git a/TopQuarkAnalysis/TopTools/interface/TopologyWorker.h b/TopQuarkAnalysis/TopTools/interface/TopologyWorker.h deleted file mode 100644 index 101c5bbd43b46..0000000000000 --- a/TopQuarkAnalysis/TopTools/interface/TopologyWorker.h +++ /dev/null @@ -1,1718 +0,0 @@ -// -*- C++ -*- -// -// Package: TopTools -// Class: TopologyWorker -// -/**\class TopologyWorker TopologyWorker.cc TopQuarkAnalysis/TopTools/interface/TopologyWorker.h - - Description: - - Implementation: - - This class contains the topological methods as used in D0 (all hadronic) analyses. -*/ -#ifndef __TOPTOOLSTOPOLOGYWORKER__ -#define __TOPTOOLSTOPOLOGYWORKER__ - -#warning The TopologyWorker class is currently not supported anymore! There might be issues in its implementation. -#warning If you are still using it or planned to do so, please contact the admins of the corresponding CMSSW package. -#warning You can find their e-mail adresses in: cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/TopQuarkAnalysis/TopTools/.admin/ - -#include "TF1.h" -#include "TMath.h" -#include "TClass.h" -#include "TString.h" -#include "TRandom.h" -#include "TMatrixD.h" -#include "TLorentzVector.h" - -#include -#include - -class TopologyWorker -{ -public: - TopologyWorker(){;} - TopologyWorker(bool boost); - virtual ~TopologyWorker(){;} - - void clear(void){m_np=0;m_np2=0;return;} - - void setPartList(TObjArray* e1, TObjArray* e2); - void setVerbose(bool loud){m_verbose=loud; return;} - - void setThMomPower(double tp); - double getThMomPower(); - void setFast(int nf); - int getFast(); - - TVector3 thrustAxis(); - TVector3 majorAxis(); - TVector3 minorAxis(); - - TVector3 thrust(); - // thrust :: Corresponding thrust, major, and minor value. - - double oblateness(); - double get_sphericity(); - double get_aplanarity(); - double get_h10(); - double get_h20(); - double get_h30(); - double get_h40(); - double get_h50(); - double get_h60(); - - - void planes_sphe(double& pnorm,double& p2, double& p3); - void planes_sphe_wei(double& pnorm,double& p2, double& p3); - void planes_thrust(double& pnorm,double& p2, double& p3); - void sumangles(float& sdeta, float& sdr); - - double get_ht() {return m_ht;} - double get_ht3() {return m_ht3;} - double get_et0() {return m_et0;} - double get_sqrts() {return m_sqrts;} - double get_njetW() {return m_njetsweighed;} - double get_et56() {return m_et56;} - double get_centrality() { return m_centrality;} - -private: - bool m_verbose; - void getetaphi(double px, double py, double pz, double& eta, double& phi); - double ulAngle(double x, double y); - double sign(double a, double b); - void ludbrb(TMatrix *mom, - double the, - double phi, - double bx, - double by, - double bz); - - int iPow(int man, int exp); - - double m_dSphMomPower; - // PARU(41): Power of momentum dependence in sphericity finder. - - double m_dDeltaThPower; - // PARU(42): Power of momentum dependence in thrust finder. - - int m_iFast; - // MSTU(44): # of initial fastest particles choosen to start search. - - double m_dConv; - // PARU(48): Convergence criteria for axis maximization. - - int m_iGood; - // MSTU(45): # different starting configurations that must - // converge before axis is accepted as correct. - - TMatrix m_dAxes; - // data: results - // m_dAxes[1] is the Thrust axis. - // m_dAxes[2] is the Major axis. - // m_dAxes[3] is the Minor axis. - - TVector3 m_ThrustAxis; - TVector3 m_MajorAxis; - TVector3 m_MinorAxis; - TVector3 m_Thrust; - - TRandom m_random; - - TMatrix m_mom; - TMatrix m_mom2; - - double m_dThrust[4]; - double m_dOblateness; - int m_np; - int m_np2; - bool m_sanda_called; - bool m_fowo_called; - bool m_boost; - bool m_sumangles_called; - double m_sph; - double m_apl; - double m_h10; - double m_h20; - double m_h30; - double m_h40; - double m_h50; - double m_h60; - double m_ht; - double m_ht3; - double m_et0; - double m_sqrts; - double m_njetsweighed; - double m_et56; - double m_centrality; - - void sanda(); - void fowo(); - static int m_maxpart; - - void CalcWmul(); - void CalcSqrts(); - void CalcHTstuff(); - double CalcPt(int i) { return sqrt(pow(m_mom(i,1),2)+pow(m_mom(i,2),2));} - double CalcPt2(int i) { return sqrt(pow(m_mom2(i,1),2)+pow(m_mom2(i,2),2));} - double CalcEta(int i) {double eta, phi;getetaphi(m_mom(i,1),m_mom(i,2),m_mom(i,3),eta,phi); return eta;} - double CalcEta2(int i) {double eta, phi; getetaphi(m_mom2(i,1),m_mom2(i,2),m_mom2(i,3),eta,phi); return eta;} - -}; - -class LessThan { - public : - // retrieve tru info MC stuff - bool operator () (const TLorentzVector & tl1, const TLorentzVector & - tl2) - const { - return tl2.Pt() < tl1.Pt(); - } -}; - -Int_t TopologyWorker::m_maxpart = 1000; - -TopologyWorker::TopologyWorker(bool boost): - m_dSphMomPower(2.0),m_dDeltaThPower(0), - m_iFast(4),m_dConv(0.0001),m_iGood(2) -{ - m_dAxes.ResizeTo(4,4); - m_mom.ResizeTo(m_maxpart,6); - m_mom2.ResizeTo(m_maxpart,6); - m_np=-1; - m_np2=-1; - m_sanda_called=false; - m_fowo_called=false; - m_sumangles_called=false; - m_verbose=false; - m_boost=boost; - m_sph=-1; - m_apl=-1; - m_h10=-1; - m_h20=-1; - m_h30=-1; - m_h40=-1; - m_sqrts=0; - m_ht=0; - m_ht3=0; - m_et56=0; - m_njetsweighed=0; - m_et0=0; -} -//______________________________________________________________ - - -// Input the particle 3(4)-vector list -// e: 3-vector TVector3 ..(px,py,pz) or -// 4-vector TLorentzVector ..(px,py,pz,E) -// Even input the TLorentzVector, we don't use Energy -// -void TopologyWorker::setPartList(TObjArray* e1, TObjArray* e2) -{ - //To make this look like normal physics notation the - //zeroth element of each array, mom[i][0], will be ignored - //and operations will be on elements 1,2,3... - TMatrix mom(m_maxpart,6); - TMatrix mom2(m_maxpart,6); - double tmax = 0; - double phi = 0.; - double the = 0.; - double sgn; - TMatrix fast(m_iFast + 1,6); - TMatrix work(11,6); - double tdi[4] = {0.,0.,0.,0.}; - double tds; - double tpr[4] = {0.,0.,0.,0.}; - double thp; - double thps; - double pxtot=0; - double pytot=0; - double pztot=0; - double etot=0; - - TMatrix temp(3,5); - Int_t np = 0; - Int_t numElements = e1->GetEntries(); - Int_t numElements2 = e2->GetEntries(); - - // trying to sort... - - - - m_np=0; - for(Int_t elem=0;elemAt(elem); - if(m_verbose){ - std::cerr << "TopologyWorker:SetPartList(): adding jet " << elem << "." << std::endl; - } - if (np >= m_maxpart) { - printf("Too many particles input to TopologyWorker"); - return; - } - if(m_verbose){ - std::cout << "getting name of object..." << std::endl; - } - TString nam(o->IsA()->GetName()); - if(m_verbose){ - std::cout << "TopologyWorker::setPartList(): object is of type " << nam << std::endl; - } - if (nam.Contains("TVector3")) { - TVector3 v(((TVector3 *) o)->X(), - ((TVector3 *) o)->Y(), - ((TVector3 *) o)->Z()); - mom(np,1) = v.X(); - mom(np,2) = v.Y(); - mom(np,3) = v.Z(); - mom(np,4) = v.Mag(); - } - else if (nam.Contains("TLorentzVector")) { - TVector3 v(((TLorentzVector *) o)->X(), - ((TLorentzVector *) o)->Y(), - ((TLorentzVector *) o)->Z()); - mom(np,1) = v.X(); - mom(np,2) = v.Y(); - mom(np,3) = v.Z(); - mom(np,4) = ((TLorentzVector *) o)->T(); - } - else { - printf("TopologyWorker::setEvent input is not a TVector3 or a TLorentzVector\n"); - continue; - } - - - if ( TMath::Abs( m_dDeltaThPower ) <= 0.001 ) { - mom(np,5) = 1.0; - } - else { - mom(np,5) = TMath::Power(mom(np,4),m_dDeltaThPower); - } - tmax = tmax + mom(np,4)*mom(np,5); - pxtot+=mom(np,1); - pytot+=mom(np,2); - pztot+=mom(np,3); - etot+=mom(np,4); - np++; - m_np=np; - } - Int_t np2=0; - // second jet array.... only use some values here. - for(Int_t elem=0;elemAt(elem); - if (np2 >= m_maxpart) { - printf("Too many particles input to TopologyWorker"); - return; - } - - TString nam(o->IsA()->GetName()); - if (nam.Contains("TVector3")) { - TVector3 v(((TVector3 *) o)->X(), - ((TVector3 *) o)->Y(), - ((TVector3 *) o)->Z()); - mom2(np2,1) = v.X(); - mom2(np2,2) = v.Y(); - mom2(np2,3) = v.Z(); - mom2(np2,4) = v.Mag(); - } - else if (nam.Contains("TLorentzVector")) { - TVector3 v(((TLorentzVector *) o)->X(), - ((TLorentzVector *) o)->Y(), - ((TLorentzVector *) o)->Z()); - mom2(np2,1) = v.X(); - mom2(np2,2) = v.Y(); - mom2(np2,3) = v.Z(); - mom2(np2,4) = ((TLorentzVector *) o)->T(); - // cout << "mom2: " << mom2(np2,1) << ", " << mom2(np2,2)<<", " << mom2(np2,3)<<", " << mom2(np2,4)<< endl; - } - else { - printf("TopologyWorker::setEvent Second vector input is not a TVector3 or a TLorentzVector\n"); - continue; - } - np2++; - m_np2=np2; - } - m_mom2=mom2; - - if (m_boost && m_np>1) { - printf("TopologyWorker::setEvent Only boosting first vector so watch out when you do this!!!"); - TVector3 booze(-pxtot/etot,-pytot/etot,-pztot/etot); - TLorentzVector l1; - for (int k=0; k -1; ifas-- ) { - if ( mom(i,4) > fast(ifas,4) ) { - for ( Int_t j = 1; j < 6; j++ ) { - fast(ifas+1,j) = fast(ifas,j); - if ( ifas == 0 ) fast(ifas,j) = mom(i,j); - } - } - else { - for ( Int_t j = 1; j < 6; j++ ) { - fast(ifas+1,j) = mom(i,j); - } - break; - } - } - } - // Find axis with highest thrust (case 1)/ highest major (case 2). - for ( Int_t ie = 0; ie < work.GetNrows(); ie++ ) { - work(ie,4) = 0.; - } - Int_t p = TMath::Min( m_iFast, np ) - 1; - // Don't trust Math.pow to give right answer always. - // Want nc = 2**p. - Int_t nc = iPow(2,p); - for ( Int_t n = 0; n < nc; n++ ) { - for ( Int_t j = 1; j < 4; j++ ) { - tdi[j] = 0.; - } - for ( Int_t i = 0; i < TMath::Min(m_iFast,n); i++ ) { - sgn = fast(i,5); - if (iPow(2,(i+1))*((n+iPow(2,i))/iPow(2,(i+1))) >= i+1){ - sgn = -sgn; - } - for ( Int_t j = 1; j < 5-pass; j++ ) { - tdi[j] = tdi[j] + sgn*fast(i,j); - } - } - tds = tdi[1]*tdi[1] + tdi[2]*tdi[2] + tdi[3]*tdi[3]; - for ( Int_t iw = TMath::Min(n,9); iw > -1; iw--) { - if( tds > work(iw,4) ) { - for ( Int_t j = 1; j < 5; j++ ) { - work(iw+1,j) = work(iw,j); - if ( iw == 0 ) { - if ( j < 4 ) { - work(iw,j) = tdi[j]; - } - else { - work(iw,j) = tds; - } - } - } - } - else { - for ( Int_t j = 1; j < 4; j++ ) { - work(iw+1,j) = tdi[j]; - } - work(iw+1,4) = tds; - } - } - } - // Iterate direction of axis until stable maximum. - m_dThrust[pass] = 0; - thp = -99999.; - Int_t nagree = 0; - for ( Int_t iw = 0; - iw < TMath::Min(nc,10) && nagree < m_iGood; iw++ ){ - thp = 0.; - thps = -99999.; - while ( thp > thps + m_dConv ) { - thps = thp; - for ( Int_t j = 1; j < 4; j++ ) { - if ( thp <= 1E-10 ) { - tdi[j] = work(iw,j); - } - else { - tdi[j] = tpr[j]; - tpr[j] = 0; - } - } - for ( Int_t i = 0; i < np; i++ ) { - sgn = sign(mom(i,5), - tdi[1]*mom(i,1) + - tdi[2]*mom(i,2) + - tdi[3]*mom(i,3)); - for ( Int_t j = 1; j < 5 - pass; j++ ){ - tpr[j] = tpr[j] + sgn*mom(i,j); - } - } - thp = TMath::Sqrt(tpr[1]*tpr[1] - + tpr[2]*tpr[2] - + tpr[3]*tpr[3])/tmax; - } - // Save good axis. Try new initial axis until enough - // tries agree. - if ( thp < m_dThrust[pass] - m_dConv ) { - break; - } - if ( thp > m_dThrust[pass] + m_dConv ) { - nagree = 0; - sgn = iPow( -1, (Int_t)TMath::Nint(m_random.Rndm()) ); - for ( Int_t j = 1; j < 4; j++ ) { - m_dAxes(pass,j) = sgn*tpr[j]/(tmax*thp); - } - m_dThrust[pass] = thp; - } - nagree = nagree + 1; - } - } - // Find minor axis and value by orthogonality. - sgn = iPow( -1, (Int_t)TMath::Nint(m_random.Rndm())); - m_dAxes(3,1) = -sgn*m_dAxes(2,2); - m_dAxes(3,2) = sgn*m_dAxes(2,1); - m_dAxes(3,3) = 0.; - thp = 0.; - for ( Int_t i = 0; i < np; i++ ) { - thp += mom(i,5)*TMath::Abs(m_dAxes(3,1)*mom(i,1) + - m_dAxes(3,2)*mom(i,2)); - } - m_dThrust[3] = thp/tmax; - // Rotate back to original coordinate system. - for ( Int_t i6 = 0; i6 < 3; i6++ ) { - for ( Int_t j = 1; j < 4; j++ ) { - temp(i6,j) = m_dAxes(i6+1,j); - } - temp(i6,4) = 0; - } - ludbrb(&temp,the,phi,0.,0.,0.); - for ( Int_t i7 = 0; i7 < 3; i7++ ) { - for ( Int_t j = 1; j < 4; j++ ) { - m_dAxes(i7+1,j) = temp(i7,j); - } - } - m_dOblateness = m_dThrust[2] - m_dThrust[3]; - - // more stuff: - - // calculate weighed jet multiplicity(); - CalcWmul(); - CalcHTstuff(); - CalcSqrts(); - -} -//______________________________________________________________ - -// Setting and getting parameters. - -void TopologyWorker::setThMomPower(double tp) -{ - // Error if sp not positive. - if ( tp > 0. ) m_dDeltaThPower = tp - 1.0; - return; -} -//______________________________________________________________ - -double TopologyWorker::getThMomPower() -{ - return 1.0 + m_dDeltaThPower; -} -//______________________________________________________________ - -void TopologyWorker::setFast(Int_t nf) -{ - // Error if sp not positive. - if ( nf > 3 ) m_iFast = nf; - return; -} -//______________________________________________________________ - -Int_t TopologyWorker::getFast() -{ - return m_iFast; -} -//______________________________________________________________ - -// Returning results - -TVector3 TopologyWorker::thrustAxis() { - TVector3 m_ThrustAxis(m_dAxes(1,1),m_dAxes(1,2),m_dAxes(1,3)); - return m_ThrustAxis; -} -//______________________________________________________________ - -TVector3 TopologyWorker::majorAxis() { - TVector3 m_MajorAxis(m_dAxes(2,1),m_dAxes(2,2),m_dAxes(2,3)); - return m_MajorAxis; -} -//______________________________________________________________ - -TVector3 TopologyWorker::minorAxis() { - TVector3 m_MinorAxis(m_dAxes(3,1),m_dAxes(3,2),m_dAxes(3,3)); - return m_MinorAxis; -} -//______________________________________________________________ - -TVector3 TopologyWorker::thrust() { - TVector3 m_Thrust(m_dThrust[1],m_dThrust[2],m_dThrust[3]); - return m_Thrust; -} -//______________________________________________________________ - -double TopologyWorker::oblateness() { - return m_dOblateness; -} -//______________________________________________________________ - -// utilities(from Jetset): -double TopologyWorker::ulAngle(double x, double y) -{ - double ulangl = 0; - double r = TMath::Sqrt(x*x + y*y); - if ( r < 1.0E-20 ) { - return ulangl; - } - if ( TMath::Abs(x)/r < 0.8 ) { - ulangl = sign(TMath::ACos(x/r),y); - } - else { - ulangl = TMath::ASin(y/r); - if ( x < 0. && ulangl >= 0. ) { - ulangl = TMath::Pi() - ulangl; - } - else if ( x < 0. ) { - ulangl = -TMath::Pi() - ulangl; - } - } - return ulangl; -} -//______________________________________________________________ - -double TopologyWorker::sign(double a, double b) { - if ( b < 0 ) { - return -TMath::Abs(a); - } - else { - return TMath::Abs(a); - } -} -//______________________________________________________________ - -void TopologyWorker::ludbrb(TMatrix* mom, - double the, - double phi, - double bx, - double by, - double bz) -{ - // Ignore "zeroth" elements in rot,pr,dp. - // Trying to use physics-like notation. - TMatrix rot(4,4); - double pr[4]; - double dp[5]; - Int_t np = mom->GetNrows(); - if ( the*the + phi*phi > 1.0E-20 ) - { - rot(1,1) = TMath::Cos(the)*TMath::Cos(phi); - rot(1,2) = -TMath::Sin(phi); - rot(1,3) = TMath::Sin(the)*TMath::Cos(phi); - rot(2,1) = TMath::Cos(the)*TMath::Sin(phi); - rot(2,2) = TMath::Cos(phi); - rot(2,3) = TMath::Sin(the)*TMath::Sin(phi); - rot(3,1) = -TMath::Sin(the); - rot(3,2) = 0.0; - rot(3,3) = TMath::Cos(the); - for ( Int_t i = 0; i < np; i++ ) - { - for ( Int_t j = 1; j < 4; j++ ) - { - pr[j] = (*mom)(i,j); - (*mom)(i,j) = 0; - } - for ( Int_t jb = 1; jb < 4; jb++) - { - for ( Int_t k = 1; k < 4; k++) - { - (*mom)(i,jb) = (*mom)(i,jb) + rot(jb,k)*pr[k]; - } - } - } - double beta = TMath::Sqrt( bx*bx + by*by + bz*bz ); - if ( beta*beta > 1.0E-20 ) - { - if ( beta > 0.99999999 ) - { - //send message: boost too large, resetting to <~1.0. - bx = bx*(0.99999999/beta); - by = by*(0.99999999/beta); - bz = bz*(0.99999999/beta); - beta = 0.99999999; - } - double gamma = 1.0/TMath::Sqrt(1.0 - beta*beta); - for ( Int_t i = 0; i < np; i++ ) - { - for ( Int_t j = 1; j < 5; j++ ) - { - dp[j] = (*mom)(i,j); - } - double bp = bx*dp[1] + by*dp[2] + bz*dp[3]; - double gbp = gamma*(gamma*bp/(1.0 + gamma) + dp[4]); - (*mom)(i,1) = dp[1] + gbp*bx; - (*mom)(i,2) = dp[2] + gbp*by; - (*mom)(i,3) = dp[3] + gbp*bz; - (*mom)(i,4) = gamma*(dp[4] + bp); - } - } - } - return; -} - - - -// APLANARITY and SPHERICITY - -void TopologyWorker::sanda() { - float SPH=-1; - float APL=-1; - m_sanda_called=true; - //======================================================================= - // By M.Vreeswijk, (core was fortran, stolen from somewhere) - // Purpose: to perform sphericity tensor analysis to give sphericity - // and aplanarity. - // - // Needs: Array (standard from root-tuples): GTRACK_px, py, pz - // The number of tracks in these arrays: GTRACK_ijet - // In addition: Array GTRACK_ijet contains a jet number 'ijet' - // (if you wish to change this, simply change code) - // - // Uses: TVector3 and TLorentzVector classes - // - // Output: Sphericity SPH and Aplanarity APL - //======================================================================= -// C...Calculate matrix to be diagonalized. - float P[1000][6]; - double SM[4][4],SV[4][4]; - double PA,PWT,PS,SQ,SR,SP,SMAX,SGN; - int NP; - int J, J1, J2, I, N, JA, JB, J3, JC, JB1, JB2; - JA=JB=JC=0; - double RL; - float rlu,rlu1; - // - // --- get the input form GTRACK arrays - // - N=m_np; - NP=0; - for (I=1;I 1E-5) { - -// C...Find first and last eigenvector by solving equation system. - for (I=1;I<4;I=I+2) { // 240 - for (J1=1;J1<4;J1++) { // 180 - SV[J1][J1]=SM[J1][J1]-P[N+I][4]; - for (J2=J1+1;J2<4;J2++) { // 170 - SV[J1][J2]=SM[J1][J2]; - SV[J2][J1]=SM[J1][J2]; - } - } // 180 - SMAX=0.; - for (J1=1;J1<4;J1++) { // 200 - for (J2=1;J2<4;J2++) { // 190 - if(std::fabs(SV[J1][J2])>SMAX) { // 190 - JA=J1; - JB=J2; - SMAX=std::fabs(SV[J1][J2]); - } - } // 190 - } // 200 - SMAX=0.; - for (J3=JA+1;J3SMAX) { // GOTO 210 - JC=J1; - SMAX=std::fabs(SV[J1][J2]); - } - } // 210 - } // 220 - JB1=JB+1-3*(JB/3); - JB2=JB+2-3*((JB+1)/3); - P[N+I][JB1]=-SV[JC][JB2]; - P[N+I][JB2]=SV[JC][JB1]; - P[N+I][JB]=-(SV[JA][JB1]*P[N+I][JB1]+SV[JA][JB2]*P[N+I][JB2])/ - SV[JA][JB]; - PA=TMath::Sqrt(pow(P[N+I][1],2)+pow(P[N+I][2],2)+pow(P[N+I][3],2)); -// make a random number - float pa=P[N-1][I]; - rlu=std::fabs(pa)-std::fabs(int(pa)*1.); - rlu1=std::fabs(pa*pa)-std::fabs(int(pa*pa)*1.); - SGN=pow((-1.),1.*int(rlu+0.5)); - for (J=1;J<4;J++) { // 230 - P[N+I][J]=SGN*P[N+I][J]/PA; - } // 230 - } // 240 - -// C...Middle axis orthogonal to other two. Fill other codes. - SGN=pow((-1.),1.*int(rlu1+0.5)); - P[N+2][1]=SGN*(P[N+1][2]*P[N+3][3]-P[N+1][3]*P[N+3][2]); - P[N+2][2]=SGN*(P[N+1][3]*P[N+3][1]-P[N+1][1]*P[N+3][3]); - P[N+2][3]=SGN*(P[N+1][1]*P[N+3][2]-P[N+1][2]*P[N+3][1]); - -// C...Calculate sphericity and aplanarity. Select storing option. - SPH=1.5*(P[N+2][4]+P[N+3][4]); - APL=1.5*P[N+3][4]; - - } // check 1 - - m_sph=SPH; - m_apl=APL; - return; -} // end sanda - - - - -void TopologyWorker::planes_sphe(double& pnorm, double& p2, double& p3) { - //float SPH=-1; //FIXME: commented out since gcc461 complained that this variable is set but unused - //float APL=-1; //FIXME: commented out since gcc461 complained that this variable is set but unused -// C...Calculate matrix to be diagonalized. - float P[1000][6]; - double SM[4][4],SV[4][4]; - double PA,PWT,PS,SQ,SR,SP,SMAX,SGN; - int NP; - int J, J1, J2, I, N, JA, JB, J3, JC, JB1, JB2; - JA=JB=JC=0; - double RL; - float rlu,rlu1; - // - // --- get the input form GTRACK arrays - // - N=m_np; - NP=0; - for (I=1;I 1E-5) { - -// C...Find first and last eigenvector by solving equation system. - for (I=1;I<4;I=I+2) { // 240 - for (J1=1;J1<4;J1++) { // 180 - SV[J1][J1]=SM[J1][J1]-P[N+I][4]; - for (J2=J1+1;J2<4;J2++) { // 170 - SV[J1][J2]=SM[J1][J2]; - SV[J2][J1]=SM[J1][J2]; - } - } // 180 - SMAX=0.; - for (J1=1;J1<4;J1++) { // 200 - for (J2=1;J2<4;J2++) { // 190 - if(std::fabs(SV[J1][J2])>SMAX) { // 190 - JA=J1; - JB=J2; - SMAX=std::fabs(SV[J1][J2]); - } - } // 190 - } // 200 - SMAX=0.; - for (J3=JA+1;J3SMAX) { // GOTO 210 - JC=J1; - SMAX=std::fabs(SV[J1][J2]); - } - } // 210 - } // 220 - JB1=JB+1-3*(JB/3); - JB2=JB+2-3*((JB+1)/3); - P[N+I][JB1]=-SV[JC][JB2]; - P[N+I][JB2]=SV[JC][JB1]; - P[N+I][JB]=-(SV[JA][JB1]*P[N+I][JB1]+SV[JA][JB2]*P[N+I][JB2])/ - SV[JA][JB]; - PA=TMath::Sqrt(pow(P[N+I][1],2)+pow(P[N+I][2],2)+pow(P[N+I][3],2)); -// make a random number - float pa=P[N-1][I]; - rlu=std::fabs(pa)-std::fabs(int(pa)*1.); - rlu1=std::fabs(pa*pa)-std::fabs(int(pa*pa)*1.); - SGN=pow((-1.),1.*int(rlu+0.5)); - for (J=1;J<4;J++) { // 230 - P[N+I][J]=SGN*P[N+I][J]/PA; - } // 230 - } // 240 - -// C...Middle axis orthogonal to other two. Fill other codes. - SGN=pow((-1.),1.*int(rlu1+0.5)); - P[N+2][1]=SGN*(P[N+1][2]*P[N+3][3]-P[N+1][3]*P[N+3][2]); - P[N+2][2]=SGN*(P[N+1][3]*P[N+3][1]-P[N+1][1]*P[N+3][3]); - P[N+2][3]=SGN*(P[N+1][1]*P[N+3][2]-P[N+1][2]*P[N+3][1]); - -// C...Calculate sphericity and aplanarity. Select storing option. - //SPH=1.5*(P[N+2][4]+P[N+3][4]); //FIXME: commented out since gcc461 complained that this variable is set but unused - //APL=1.5*P[N+3][4]; //FIXME: commented out since gcc461 complained that this variable is set but unused - - } // check 1 - - // so assume now we have Sphericity axis, which one give the minimal Pts - double etstot[4]; - double eltot[4]; - double sum23=0; - double sum22=0; - double sum33=0; - double pina[4]; - double ax[4], ay[4], az[4]; - for (int ia=1;ia<4;ia++) { - etstot[ia]=0; - eltot[ia]=0; - pina[ia]=0; - ax[ia]=P[N+ia][1]; - ay[ia]=P[N+ia][2]; - az[ia]=P[N+ia][3]; - ax[ia]/=sqrt(ax[ia]*ax[ia]+ay[ia]*ay[ia]+az[ia]*az[ia]); - ay[ia]/=sqrt(ax[ia]*ax[ia]+ay[ia]*ay[ia]+az[ia]*az[ia]); - az[ia]/=sqrt(ax[ia]*ax[ia]+ay[ia]*ay[ia]+az[ia]*az[ia]); - } - - - for (int k =0 ; k=0) { - double x1=(sqrt(disc)-b)/2/a; - double x2=(-sqrt(disc)-b)/2/a; - phi=atan(x1); - phip=atan(x2); - if (phi<0) phi=2.*pi+phi; - if (phip<0) phip=2.*pi+phip; - } - double p21=sum22*cos(phi)*cos(phi)+sum33*sin(phi)*sin(phi)+2*sum23*cos(phi)*sin(phi); - double p31=sum22*sin(phi)*sin(phi)+sum33*cos(phi)*cos(phi)-2*sum23*cos(phi)*sin(phi); - - double p22=sum22*cos(phip)*cos(phip)+sum33*sin(phip)*sin(phip)+2*sum23*cos(phip)*sin(phip); - double p32=sum22*sin(phip)*sin(phip)+sum33*cos(phip)*cos(phip)-2*sum23*cos(phip)*sin(phip); - - - double d1=std::fabs(p31*p31 - p21*p21); - double d2=std::fabs(p32*p32 - p22*p22); - //cout << " eltot " << eltot[2] << " " << eltot[3] << endl; - //cout << " phi " << phi << " " << phip << endl; - //cout << " d " << d1 << " " << d2 << endl; - p2=p21; - p3=p31; - if (d2>d1) { - p2=p22; - p3=p32; - } - pnorm=sqrt(eltot[1]); - if (p2>p3) { - p3=sqrt(p3); - p2=sqrt(p2); - }else { - double p4=p3; - p3=sqrt(p2); - p2=sqrt(p4); - } - //cout << " sum2 sum3 " << sqrt(sum22) << " " << sqrt(sum33) << endl; - //cout << " p2 p3 " << p2 << " " << p3 << endl; - //double els=sqrt(eltot[2]*eltot[2]+eltot[3]*eltot[3]); - // cout << " ets els " << (ettot[1]) << " " << els << endl; - - //m_sph=SPH; //FIXME: shouldn't the local variables be used to reset the class member variables accordingly? - //m_apl=APL; //FIXME: shouldn't the local variables be used to reset the class member variables accordingly? - return; -} // end planes_sphe - - -void TopologyWorker::planes_sphe_wei(double& pnorm, double& p2, double& p3) { - //float SPH=-1; //FIXME: commented out since gcc461 complained that this variable is set but unused - //float APL=-1; //FIXME: commented out since gcc461 complained that this variable is set but unused -// C...Calculate matrix to be diagonalized. - float P[1000][6]; - double SM[4][4],SV[4][4]; - double PA,PWT,PS,SQ,SR,SP,SMAX,SGN; - int NP; - int J, J1, J2, I, N, JA, JB, J3, JC, JB1, JB2; - JA=JB=JC=0; - double RL; - float rlu,rlu1; - // - // --- get the input form GTRACK arrays - // - N=m_np; - NP=0; - for (I=1;I 1E-5) { - -// C...Find first and last eigenvector by solving equation system. - for (I=1;I<4;I=I+2) { // 240 - for (J1=1;J1<4;J1++) { // 180 - SV[J1][J1]=SM[J1][J1]-P[N+I][4]; - for (J2=J1+1;J2<4;J2++) { // 170 - SV[J1][J2]=SM[J1][J2]; - SV[J2][J1]=SM[J1][J2]; - } - } // 180 - SMAX=0.; - for (J1=1;J1<4;J1++) { // 200 - for (J2=1;J2<4;J2++) { // 190 - if(std::fabs(SV[J1][J2])>SMAX) { // 190 - JA=J1; - JB=J2; - SMAX=std::fabs(SV[J1][J2]); - } - } // 190 - } // 200 - SMAX=0.; - for (J3=JA+1;J3SMAX) { // GOTO 210 - JC=J1; - SMAX=std::fabs(SV[J1][J2]); - } - } // 210 - } // 220 - JB1=JB+1-3*(JB/3); - JB2=JB+2-3*((JB+1)/3); - P[N+I][JB1]=-SV[JC][JB2]; - P[N+I][JB2]=SV[JC][JB1]; - P[N+I][JB]=-(SV[JA][JB1]*P[N+I][JB1]+SV[JA][JB2]*P[N+I][JB2])/ - SV[JA][JB]; - PA=TMath::Sqrt(pow(P[N+I][1],2)+pow(P[N+I][2],2)+pow(P[N+I][3],2)); -// make a random number - float pa=P[N-1][I]; - rlu=std::fabs(pa)-std::fabs(int(pa)*1.); - rlu1=std::fabs(pa*pa)-std::fabs(int(pa*pa)*1.); - SGN=pow((-1.),1.*int(rlu+0.5)); - for (J=1;J<4;J++) { // 230 - P[N+I][J]=SGN*P[N+I][J]/PA; - } // 230 - } // 240 - -// C...Middle axis orthogonal to other two. Fill other codes. - SGN=pow((-1.),1.*int(rlu1+0.5)); - P[N+2][1]=SGN*(P[N+1][2]*P[N+3][3]-P[N+1][3]*P[N+3][2]); - P[N+2][2]=SGN*(P[N+1][3]*P[N+3][1]-P[N+1][1]*P[N+3][3]); - P[N+2][3]=SGN*(P[N+1][1]*P[N+3][2]-P[N+1][2]*P[N+3][1]); - -// C...Calculate sphericity and aplanarity. Select storing option. - //SPH=1.5*(P[N+2][4]+P[N+3][4]); //FIXME: commented out since gcc461 complained that this variable is set but unused - //APL=1.5*P[N+3][4]; //FIXME: commented out since gcc461 complained that this variable is set but unused - - } // check 1 - - // so assume now we have Sphericity axis, which one give the minimal Pts - double etstot[4]; - double eltot[4]; - double sum23=0; - double sum22=0; - double sum33=0; - double pina[4]; - double ax[4], ay[4], az[4]; - for (int ia=1;ia<4;ia++) { - etstot[ia]=0; - eltot[ia]=0; - pina[ia]=0; - ax[ia]=P[N+ia][1]; - ay[ia]=P[N+ia][2]; - az[ia]=P[N+ia][3]; - ax[ia]/=sqrt(ax[ia]*ax[ia]+ay[ia]*ay[ia]+az[ia]*az[ia]); - ay[ia]/=sqrt(ax[ia]*ax[ia]+ay[ia]*ay[ia]+az[ia]*az[ia]); - az[ia]/=sqrt(ax[ia]*ax[ia]+ay[ia]*ay[ia]+az[ia]*az[ia]); - } - - for (int k =0 ; k=0) { - double x1=(sqrt(disc)-b)/2/a; - double x2=(-sqrt(disc)-b)/2/a; - phi=atan(x1); - phip=atan(x2); - if (phi<0) phi=2.*pi+phi; - if (phip<0) phip=2.*pi+phip; - } - double p21=sum22*cos(phi)*cos(phi)+sum33*sin(phi)*sin(phi)+2*sum23*cos(phi)*sin(phi); - double p31=sum22*sin(phi)*sin(phi)+sum33*cos(phi)*cos(phi)-2*sum23*cos(phi)*sin(phi); - - double p22=sum22*cos(phip)*cos(phip)+sum33*sin(phip)*sin(phip)+2*sum23*cos(phip)*sin(phip); - double p32=sum22*sin(phip)*sin(phip)+sum33*cos(phip)*cos(phip)-2*sum23*cos(phip)*sin(phip); - - - double d1=std::fabs(p31*p31 - p21*p21); - double d2=std::fabs(p32*p32 - p22*p22); - //cout << " eltot " << eltot[2] << " " << eltot[3] << endl; - //cout << " phi " << phi << " " << phip << endl; - //cout << " d " << d1 << " " << d2 << endl; - p2=p21; - p3=p31; - if (d2>d1) { - p2=p22; - p3=p32; - } - pnorm=sqrt(eltot[1]); - if (p2>p3) { - p3=sqrt(p3); - p2=sqrt(p2); - }else { - double p4=p3; - p3=sqrt(p2); - p2=sqrt(p4); - } - //cout << " sum2 sum3 " << sqrt(sum22) << " " << sqrt(sum33) << endl; - //cout << " p2 p3 " << p2 << " " << p3 << endl; - //double els=sqrt(eltot[2]*eltot[2]+eltot[3]*eltot[3]); - // cout << " ets els " << (ettot[1]) << " " << els << endl; - - //m_sph=SPH; //FIXME: shouldn't the local variables be used to reset the class member variables accordingly? - //m_apl=APL; //FIXME: shouldn't the local variables be used to reset the class member variables accordingly? - return; -} // end planes_sphe - - - -void TopologyWorker::planes_thrust(double& pnorm, double& p2, double& p3) { - TVector3 thrustaxis=thrustAxis(); - TVector3 majoraxis=majorAxis(); - TVector3 minoraxis=minorAxis(); - // so assume now we have Sphericity axis, which one give the minimal Pts - double etstot[4]; - double eltot[4]; - double sum23=0; - double sum22=0; - double sum33=0; - double pina[4]; - double ax[4], ay[4], az[4]; - ax[1]=thrustaxis(0); ay[1]=thrustaxis(1); az[1]=thrustaxis(2); - ax[2]=minoraxis(0); ay[2]=minoraxis(1); az[2]=minoraxis(2); - ax[3]=majoraxis(0); ay[3]=majoraxis(1); az[3]=majoraxis(2); - for (int ia=1;ia<4;ia++) { - etstot[ia]=0; - eltot[ia]=0; - pina[ia]=0; - ax[ia]/=sqrt(ax[ia]*ax[ia]+ay[ia]*ay[ia]+az[ia]*az[ia]); - ay[ia]/=sqrt(ax[ia]*ax[ia]+ay[ia]*ay[ia]+az[ia]*az[ia]); - az[ia]/=sqrt(ax[ia]*ax[ia]+ay[ia]*ay[ia]+az[ia]*az[ia]); - } - - for (int k =0 ; k=0) { - double x1=(sqrt(disc)-b)/2/a; - double x2=(-sqrt(disc)-b)/2/a; - phi=atan(x1); - phip=atan(x2); - if (phi<0) phi=2.*pi+phi; - if (phip<0) phip=2.*pi+phip; - } - double p21=sum22*cos(phi)*cos(phi)+sum33*sin(phi)*sin(phi)+2*sum23*cos(phi)*sin(phi); - double p31=sum22*sin(phi)*sin(phi)+sum33*cos(phi)*cos(phi)-2*sum23*cos(phi)*sin(phi); - - double p22=sum22*cos(phip)*cos(phip)+sum33*sin(phip)*sin(phip)+2*sum23*cos(phip)*sin(phip); - double p32=sum22*sin(phip)*sin(phip)+sum33*cos(phip)*cos(phip)-2*sum23*cos(phip)*sin(phip); - - - double d1=std::fabs(p31*p31 - p21*p21); - double d2=std::fabs(p32*p32 - p22*p22); - //cout << " eltot " << eltot[2] << " " << eltot[3] << endl; - //cout << " phi " << phi << " " << phip << endl; - //cout << " d " << d1 << " " << d2 << endl; - p2=p21; - p3=p31; - if (d2>d1) { - p2=p22; - p3=p32; - } - pnorm=sqrt(etstot[1]); - if (p2>p3) { - p3=sqrt(p3); - p2=sqrt(p2); - }else { - double p4=p3; - p3=sqrt(p2); - p2=sqrt(p4); - } - //cout << " sum2 sum3 " << sqrt(sum22) << " " << sqrt(sum33) << endl; - //cout << " p2 p3 " << p2 << " " << p3 << endl; - //double els=sqrt(eltot[2]*eltot[2]+eltot[3]*eltot[3]); - // cout << " ets els " << (ettot[1]) << " " << els << endl; - return; -} // end planes_thru - - -void TopologyWorker::fowo() { -// 20020830 changed: from p/E to Et/Ettot and include H50 and H60 - m_fowo_called=true; - // include fox wolframs - float H10=-1; - float H20=-1; - float H30=-1; - float H40=-1; - float H50=-1; - float H60=-1; - if (1==1) { - float P[1000][6],H0,HD,CTHE; - int N,NP,I,J,I1,I2; - H0=HD=0.; - N=m_np; - NP=0; - for (I=1;I0.000001) { - eta = -log( tan( thg/2.0 ) ); - } - phi = atan2(py,px); - if(phi<=0) phi += 2.0*pi; - return; -} - - - -void TopologyWorker::sumangles(float& sdeta, float& sdr) { - double eta1,eta2,phi1,phi2,deta,dphi,dr; - m_sumangles_called=true; - sdeta=0; - sdr=0; - for (int k=0;k3.1415) dphi=2*3.1415-dphi; - deta=std::fabs(eta1-eta2); - dr=sqrt(dphi*dphi+deta*deta); - sdeta+=deta; - sdr+=dr; - } - } - return; -} - -//______________________________________________________________ - -Int_t TopologyWorker::iPow(Int_t man, Int_t exp) -{ - Int_t ans = 1; - for( Int_t k = 0; k < exp; k++) - { - ans = ans*man; - } - return ans; -} - -// added by Freya: - -void TopologyWorker::CalcWmul(){ - - Int_t njets = m_np; - double result=0; - for(Int_t ijet=0; ijetelo){ - elo=CalcPt(njets-1); - } - - result+=0.5 * (elo*elo-(15*15))*(njets); - result/=((55*55)-100)/2.0; - m_njetsweighed=result; -} - -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -void TopologyWorker::CalcSqrts(){ - TLorentzVector event(0,0,0,0); - TLorentzVector worker(0,0,0,0); - - for(int i=0; i< m_np; i++){ - double energy=m_mom(i,4); - if(m_mom(i,4)<0.00001) - energy=sqrt(pow(m_mom(i,1),2)+pow(m_mom(i,2),2)+pow(m_mom(i,3),2)); - // assume massless particle if only TVector3s are provided... - worker.SetXYZT(m_mom(i,1),m_mom(i,2),m_mom(i,3),energy); - event+=worker; - } - m_sqrts=event.M(); -} - -//++++++++++++++++++++++++++++++++++++++ -void TopologyWorker::CalcHTstuff(){ - m_ht=0; - m_ht3=0; - m_et56=0; - m_et0=0; - double ptlead=0; - double h=0; - for(int i=0; i< m_np; i++){ - //cout << i << "/" << m_np << ":" << CalcPt(i) << endl; - m_ht+=CalcPt(i); - h+=m_mom(i,4); - if(i>1) - m_ht3+=CalcPt(i); - if(i==5) - m_et56=sqrt(CalcPt(i)*CalcPt(i-1)); - } - - for(int j=0; j< m_np2; j++){ - //cout << j << "/" << m_np2 << ":" << CalcPt2(j) << endl; - if(ptlead0.0001){ - m_et0=ptlead/m_ht; - //cout << "calculating ETO" << m_et0 << "=" << ptlead << endl; - } - if(h>0.00001) - m_centrality=m_ht/h; -} - -#endif - - - - diff --git a/TrackingTools/AnalyticalJacobians/interface/CurvilinearJacobian.h b/TrackingTools/AnalyticalJacobians/interface/CurvilinearJacobian.h deleted file mode 100644 index 85ae38f062ac1..0000000000000 --- a/TrackingTools/AnalyticalJacobians/interface/CurvilinearJacobian.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef CurvilinearJacobian_H -#define CurvilinearJacobian_H - -#include "DataFormats/Math/interface/AlgebraicROOTObjects.h" - -/** Base class for calculations of Jacobians of transformations within the curvilinear frame. - */ - -class CurvilinearJacobian { -public: - - CurvilinearJacobian() : theJacobian(AlgebraicMatrixID()){} - - virtual ~CurvilinearJacobian() {} - - const AlgebraicMatrix55& jacobian() const {return theJacobian;} - -protected: - - AlgebraicMatrix55 theJacobian; - - -}; - -#endif diff --git a/TrackingTools/GsfTools/interface/GaussianSumUtilities.h b/TrackingTools/GsfTools/interface/GaussianSumUtilities.h deleted file mode 100644 index 77ca08116638f..0000000000000 --- a/TrackingTools/GsfTools/interface/GaussianSumUtilities.h +++ /dev/null @@ -1,154 +0,0 @@ -#ifndef GaussianSumUtilities_h_ -#define GaussianSumUtilities_h_ - -#include "TrackingTools/GsfTools/interface/MultiGaussianState1D.h" -#include "TrackingTools/GsfTools/interface/SingleGaussianState.h" -#include "TrackingTools/GsfTools/interface/MultiGaussianState.h" -#include - -/** Utility class for the analysis of multi-dimensional Gaussian - * mixtures. The input state is assumed to exist for - * the lifetime of this object. - */ - -template -class GaussianSumUtilities { -public: - typedef SingleGaussianState SingleState; - typedef MultiGaussianState MultiState; -// typedef ROOT::Math::SVector Vector; - typedef ROOT::Math::SMatrix > GenMatrix; - - typedef typename SingleState::Vector Vector; - typedef typename SingleState::Matrix Matrix; - typedef typename MultiState::SingleStatePtr SingleStatePtr; - typedef typename MultiState::SingleStateContainer SingleStateContainer; - -private: - enum ModeStatus { Valid, NotValid, NotComputed }; - -public: - GaussianSumUtilities (const MultiState& state) : - theState(state), - theModeStatus(NotComputed) { - } - ~GaussianSumUtilities () { - } - - /// number of components - inline unsigned int size () const { - return components().size(); - } - /// components - const SingleStateContainer& components () const { - return theState.components(); - } - /// multi-state - const MultiState& state () const { - return theState; - } - /// weight of a component - inline double weight (unsigned int i) const { - return components()[i]->weight(); - } - /// mean value of a component - inline const Vector& mean (unsigned int i) const { - return components()[i]->mean(); - } - /// covariance matrix of a component - inline const Matrix& covariance (unsigned int i) const { - return components()[i]->covariance(); - } - /// mode status - bool modeIsValid () const; - /** Mode "state": mean = mode, covariance = local covariance at mode, - * weight chosen to have pdf(mode) equal to the one of the mixture */ - const SingleGaussianState& mode () const; - /// value of the p.d.f. - double pdf (const Vector&) const; - /// gradient - Vector d1Pdf (const Vector&) const; - /// Hessian - Matrix d2Pdf (const Vector&) const; - /// value of ln(pdf) - double lnPdf (const Vector&) const; - /// gradient of ln(pdf) - Vector d1LnPdf (const Vector&) const; - /// Hessian of ln(pdf) - Matrix d2LnPdf (const Vector&) const; - - /// combined weight - double weight () const { - return theState.weight(); - } - /// combined mean - const Vector& mean () const { - return theState.mean(); - } - /// combined covariance - const Matrix& covariance () const { - return theState.covariance(); - } - - -protected: - /// calculation of mode - Vector computeModeWithoutTransform () const; - -private: - /// Symmetric Tensor Product (not recognized by standard ROOT Math) - Matrix tensorProduct (const Vector&) const; - /// value of gaussian distribution - double gauss (const double&, const double&, const double&) const; - /// value of multidimensional gaussian distribution - double gauss (const Vector&, - const Vector&, - const Matrix&) const; - /// mode from starting value in ln(pdf); returns true on success - bool findMode (Vector& mode, double& pdfAtMode, - const Vector& xStart) const; - /// calculation of mode with transformation of pdf - void computeMode () const; - /// state constrained to a line x = s*d+x0 - MultiGaussianState1D constrainedState (const Vector& d, - const Vector& x0) const; -// /// replacement of CLHEP determinant (which rounds off small values) -// double determinant (const Matrix& matrix) const; - /** Local variance from Hessian matrix. - * Only valid if x corresponds to a (local) maximum! */ - Matrix localCovariance (const Vector& x) const; - /// set mode "state" from solution of mode finding - void setMode (const Vector& mode) const; - /// set mode "state" in case of failure - void setInvalidMode () const; - - /// pdf components - std::vector pdfComponents (const Vector&) const; - /// value of the p.d.f. using the pdf components at the evaluation point - double pdf (const Vector&, const std::vector&) const; - /// gradient using the pdf components at the evaluation point - Vector d1Pdf (const Vector&, const std::vector&) const; - /// Hessian using the pdf components at the evaluation point - Matrix d2Pdf (const Vector&, const std::vector&) const; - /// value of ln(pdf) using the pdf components at the evaluation point - double lnPdf (const Vector&, const std::vector&) const; - /// gradient of ln(pdf) using the pdf components at the evaluation point - Vector d1LnPdf (const Vector&, const std::vector&) const; - /// Hessian of ln(pdf) using the pdf components at the evaluation point - Matrix d2LnPdf (const Vector&, const std::vector&) const; - - - -private: - const MultiState& theState; -// int theDimension; - - mutable ModeStatus theModeStatus; -// mutable Vector theMode; - mutable SingleGaussianState theMode; - -}; - -#include "TrackingTools/GsfTools/interface/GaussianSumUtilities.icc" - -#endif diff --git a/TrackingTools/GsfTools/interface/GaussianSumUtilities.icc b/TrackingTools/GsfTools/interface/GaussianSumUtilities.icc deleted file mode 100644 index 926f60dd7f6af..0000000000000 --- a/TrackingTools/GsfTools/interface/GaussianSumUtilities.icc +++ /dev/null @@ -1,573 +0,0 @@ -#include "TrackingTools/GsfTools/interface/GaussianSumUtilities.h" - -#include "TrackingTools/GsfTools/interface/SingleGaussianState1D.h" -#include "TrackingTools/GsfTools/interface/MultiGaussianState1D.h" -#include "TrackingTools/GsfTools/interface/GaussianSumUtilities1D.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -// #include "Utilities/Timing/interface/TimingReport.h" -// #include "Utilities/Timing/interface/TimerStack.h" - -#include "TROOT.h" -#include "TMath.h" -#include "TVectorD.h" -#include "TMatrixDSym.h" -#include "TMatrixDSymEigen.h" - -#include -#include - -#include -#include - - -template -bool -GaussianSumUtilities::modeIsValid () const -{ - if ( theModeStatus==NotComputed ) computeMode(); - return theModeStatus==Valid; -} - -template -const SingleGaussianState& -GaussianSumUtilities::mode () const -{ - if ( theModeStatus==NotComputed ) computeMode(); - return theMode; -} - -template -void -GaussianSumUtilities::computeMode () const -{ -// TimerStack tstack; -// tstack.benchmark("GSUND::benchmark",1000000); -// FastTimerStackPush(tstack,"GaussianSumUtilities::computeMode"); - // - // initialize status - // - theModeStatus = NotValid; - // - // diagonalize / normalize (better convergence) - // based on component with highest pdf at mean - // - unsigned int icMax(0); - double yMax(-1.); - for ( unsigned int ic=0; icyMax ) { - icMax = ic; - yMax = y; - } - } - // need to copy the matrix since diagonalization is not - // available for SMatrix but there must be a better way - // to copy the matrix ... - TMatrixDSym diag(N); - for ( unsigned int i=0; i(newMean,newCov,(**i).weight()); - newStates.push_back(sgs); - } - MultiState newState(newStates); - GaussianSumUtilities newGSU(newState); - // - // get mode in transformed system - // - Vector newMode = newGSU.computeModeWithoutTransform(); - // - // transform back - // - if ( newGSU.modeIsValid() ) { -// Vector mode((ROOT::Math::Transpose(rotT)*newMode)+trans); - Vector mode(rot*newMode+trans); - setMode(mode); - } - else { - edm::LogWarning("GaussianSumUtilities") << "multi-dimensional mode calculation failed"; - setInvalidMode(); - } - -} - -template -typename GaussianSumUtilities::Vector -GaussianSumUtilities::computeModeWithoutTransform () const -{ - // - // initialize status - // - theModeStatus = NotValid; - // - // Use means of individual components as start values. - // Sort by value of pdf. - // - typedef std::multimap > StartMap; - StartMap xStart; - for ( UInt_t i=0; i result(-1.,mean((*xStart.begin()).second)); - Vector xRes; - double yRes(0.); - for ( StartMap::const_iterator i=xStart.begin(); - i!=xStart.end(); i++ ) { - // - // If a solution exists: drop as soon as the pdf at - // start value drops to < 75% of maximum (try to avoid - // unnecessary searches for the mode) - // - if ( theModeStatus==Valid && - (*i).first/(*xStart.begin()).first<0.75 ) break; - // - // try to find mode from this start value - // - bool valid = findMode(xRes,yRes,mean((*i).second)); - - // - // store result if findMode was successful and if - // the new value is significantly higher - // - if ( valid && (result.first<0. || - (yRes-result.first)/(yRes+result.first)>1.e-5) ) { - theModeStatus = Valid; - result = std::make_pair(yRes,xRes); - } - } - // - // check (existance of) solution - // - if ( theModeStatus==Valid ) { - setMode(result.second); - } - else - setInvalidMode(); - - - return theMode.mean(); -} - -template -bool -GaussianSumUtilities::findMode (Vector& xMode, double& yMode, - const Vector& xStart) const -{ - static const int signHesse = (N%2) ? -1 : 1; - // - // use Newton or follow gradient - // - bool result(false); - Vector x1; - double y1(0.); - Vector x2(xStart); - std::vector pdfs; - pdfs.reserve(size()); - double y2(0.); - Vector yd2; - Vector ydh2; - double detHesse2(0.); - bool usedHesse(false); - // - // iterate until convergence - // - int nLoop(0); - while ( nLoop++<50 ) { - pdfs = pdfComponents(x2); - y2 = pdf(x2,pdfs); - ydh2 = yd2 = d1LnPdf(x2,pdfs); - // cuts tuned on N=5, might need revision for other dimension - // even if distribution is approx. normalized - if ( nLoop>1 && usedHesse && detHesse2>0. && - fabs(y2-y1)/(y2+y1)<1.e-10 || ROOT::Math::Mag2(yd2)<1.e-20 ) { - result = true; - break; - } - // - // Hessian (Sign(Det(hesse)) should be (-1)**N around maximum) - // -// Matrix hesse2 = d2LnPdf(x2,pdfs); -// usedHesse = false; -// hesse2.Det2(detHesse2); -// detHesse2 *= signHesse; -// int ifail; -// // GenMatrix invHesse2(hesse2.inverse(ifail)); -// Matrix invHesse2 = hesse2.Inverse(ifail); - Matrix hesse2(d2LnPdf(x2,pdfs)); - usedHesse = false; - hesse2.Det2(detHesse2); - detHesse2 *= signHesse; - bool success = hesse2.Invert(); - if ( success ) { - ydh2 = -hesse2*yd2; - usedHesse = true; - } - double s = ROOT::Math::Mag(ydh2); - if ( fabs(s)>FLT_MIN ) ydh2 *= 1./s; - // - // restrict to direction of gradient - // - if ( !usedHesse || detHesse2<0. ) { - MultiGaussianState1D oneDimState(constrainedState(ydh2,x2)); - GaussianSumUtilities1D gsUtils(oneDimState); - if ( !usedHesse || gsUtils.d2Pdf(0.)>=0. ) { - s = gsUtils.mode().mean(); - if ( !gsUtils.modeIsValid() ) s = 0.1; - } - } - // - // protect against too large steps (to be revised??) - // - if ( s<-3. ) s = -3.; - else if ( s>3. ) s = 3.; - // - // save old values - // - x1 = x2; - y1 = y2; - // - // set new values - // - x2 += s*ydh2; - } - xMode = x2; - yMode = y2; - return result; -} - -template -MultiGaussianState1D -GaussianSumUtilities::constrainedState (const Vector& d, - const Vector& x0) const -{ - static const double fNorm(1./pow(2*TMath::Pi(),N-1)); - std::vector states; - states.reserve(size()); - for ( typename SingleStateContainer::const_iterator i=components().begin(); - i!=components().end(); i++ ) { - double det; - (**i).weightMatrix().Det2(det); - if ( det<0 ) continue; - - Vector dx((**i).mean()-x0); -// double dGd = (**i).weightMatrix().similarity(d); - double dGd = ROOT::Math::Similarity(d,(**i).weightMatrix()); - if ( dGd<-FLT_MIN ) continue; - Vector gDx = (**i).weightMatrix()*dx; -// double dxGdx = dot(dx,gDx); -// double dGdx = dot(d,gDx); - double dxGdx = ROOT::Math::Dot(dx,gDx); - double dGdx = ROOT::Math::Dot(d,gDx); - double weight((**i).weight()); -// weight *= sqrt(determinant((**i).weightMatrix())* -// pow(fNorm,N-1)/dGd); -// weight *= sqrt(det*pow(fNorm,N-1)/dGd); - weight *= sqrt(det*fNorm/dGd); - double exponent = dxGdx - dGdx*dGdx/dGd; - if ( exponent>-400. ) weight *= exp(-0.5*exponent); - else weight = 0.; - states.push_back(SingleGaussianState1D(dGdx/dGd,1./dGd,weight)); - } - return MultiGaussianState1D(states); -} - -template -double -GaussianSumUtilities::pdf(const Vector& x) const -{ -return pdf(x,pdfComponents(x)); -} - -template -typename GaussianSumUtilities::Vector -GaussianSumUtilities::d1Pdf(const Vector& x) const -{ -return d1Pdf(x,pdfComponents(x)); -} - -template -typename GaussianSumUtilities::Matrix -GaussianSumUtilities::d2Pdf(const Vector& x) const -{ -return d2Pdf(x,pdfComponents(x)); -} - -template -double -GaussianSumUtilities::lnPdf(const Vector& x) const -{ -return lnPdf(x,pdfComponents(x)); -} - -template -typename GaussianSumUtilities::Vector -GaussianSumUtilities::d1LnPdf(const Vector& x) const -{ -return d1LnPdf(x,pdfComponents(x)); -} - -template -typename GaussianSumUtilities::Matrix -GaussianSumUtilities::d2LnPdf (const Vector& x) const -{ -return d2LnPdf(x,pdfComponents(x)); -} - -template -std::vector -GaussianSumUtilities::pdfComponents (const Vector& x) const -{ - std::vector result; - result.reserve(size()); - for ( typename SingleStateContainer::const_iterator i=components().begin(); - i!=components().end(); i++ ) { - result.push_back((**i).weight()*gauss(x,(**i).mean(),(**i).weightMatrix())); - } - return result; -} - -template -double -GaussianSumUtilities::pdf (const Vector& x, const std::vector& pdfs) const -{ - double result(0.); - for ( std::vector::const_iterator i=pdfs.begin(); - i!=pdfs.end(); ++i ) result += *i; - return result; -} - -template -typename GaussianSumUtilities::Vector -GaussianSumUtilities::d1Pdf (const Vector& x, const std::vector& pdfs) const -{ - Vector result; // rely on root doc that vector is initialised to 0 - typename SingleStateContainer::const_iterator ic = components().begin(); - std::vector::const_iterator ip = pdfs.begin(); - for ( ; ic!=components().end(); ++ic,++ip ) { - Vector gx((**ic).weightMatrix()*(x-(**ic).mean())); - gx *= -(*ip); - result += gx; - } - return result; -} - -template -typename GaussianSumUtilities::Matrix -GaussianSumUtilities::d2Pdf (const Vector& x, const std::vector& pdfs) const -{ - Matrix result; // (N,0); - typename SingleStateContainer::const_iterator ic = components().begin(); - std::vector::const_iterator ip = pdfs.begin(); - for ( ; ic!=components().end(); ++ic,++ip ) { - Vector gx((**ic).weightMatrix()*(x-(**ic).mean())); -// Matrix c(vT_times_v(gx)); - Matrix c(tensorProduct(gx)); - c -= (**ic).weightMatrix(); - c *= (*ip); - result += c; - } - return result; -} - -template -double -GaussianSumUtilities::lnPdf (const Vector& x, const std::vector& pdfs) const -{ - double result = pdf(x,pdfs); - if ( result>DBL_MIN ) result = log(result); - else result = -FLT_MAX; - return result; -} - -template -typename GaussianSumUtilities::Vector -GaussianSumUtilities::d1LnPdf (const Vector& x, const std::vector& pdfs) const -{ - double f = pdf(x,pdfs); - Vector result(d1Pdf(x,pdfs)); - if ( f>DBL_MIN ) result /= f; - else result *= 0.; - return result; -} - -template -typename GaussianSumUtilities::Matrix -GaussianSumUtilities::d2LnPdf (const Vector& x, const std::vector& pdfs) const -{ - double f(pdf(x,pdfs)); - Vector df(d1LnPdf(x,pdfs)); -// Matrix result(-vT_times_v(df)); - Matrix result(-tensorProduct(df)); - if ( f>DBL_MIN ) result += d2Pdf(x,pdfs)/f; - return result; -} - -template -double -GaussianSumUtilities::gauss (const double& x, const double& mean, - const double& sigma) const -{ - const double fNorm(1./sqrt(2*TMath::Pi())); - double result(0.); - - double d((x-mean)/sigma); - if ( fabs(d)<20. ) result = exp(-d*d/2.); - result *= fNorm/sigma; - return result; -} - -template -double -GaussianSumUtilities::gauss (const Vector& x, - const Vector& means, - const Matrix& weightMatrix) const -{ - static const double fNorm(1./pow(2*TMath::Pi(),N)); - double result(0.); - - double det; - weightMatrix.Det2(det); - if ( det<0. ) return 0.; - - Vector dx(x-means); -// double d = weightMatrix.similarity(dx); - double d = ROOT::Math::Similarity(dx,weightMatrix); - // protection against numerical problems - if ( d<-FLT_MIN ) return 0.; - if ( d<400. ) result = exp(-d/2.); -// result *= sqrt(pow(fNorm,N)*determinant(weightMatrix)); -// result *= sqrt(pow(fNorm,N)*det); - result *= sqrt(fNorm*det); - return result; -} - -template -typename GaussianSumUtilities::Matrix -GaussianSumUtilities::localCovariance (const Vector& x) const -{ - Matrix result(d2Pdf(x)); - result *= -1./pdf(x); - - double det; - result.Det2(det); -// int ifail; -// // Matrix covariance(weightMatrix.inverse(ifail)); -// Matrix covariance = weightMatrix.Inverse(ifail); -// if ( ifail!=0 || det<=DBL_MIN ) { - bool success = result.Invert(); - if ( !success || det<=DBL_MIN ) { - edm::LogWarning("GaussianSumUtilities") - << "localCovariance: weight matrix is not pos. def."; - } -// return covariance; - return result; -} - -template -void -GaussianSumUtilities::setMode (const Vector& mode) const -{ - // - // Valid mode: construct single Gaussian state with - // mean = mode - // covariance = local covariance at mode - // weight such that the pdf's of the mixture and the - // single state are equal at the mode - // - theModeStatus = Valid; - Matrix covMode(localCovariance(mode)); - static const double fNorm(pow(2*TMath::Pi(),N)); - double det; - covMode.Det2(det); - double wgtMode = pdf(mode)*sqrt(fNorm*det); - theMode = SingleGaussianState(mode,covMode,wgtMode); -} - -template -void -GaussianSumUtilities::setInvalidMode () const -{ - // - // Mode finding failed: set solution to highest component - // (alternative would be global mean / covariance ..?) - // -// theMode = SingleGaussianState(mean(),covariance(),weight()); - // - // look for component with highest value at mean - // - unsigned int icMax(0); - double ySqMax(0.); - for ( unsigned int ic=0; ic(*components()[icMax]); -} - -template -typename GaussianSumUtilities::Matrix -GaussianSumUtilities::tensorProduct (const Vector& v) const -{ - Matrix result; - for ( unsigned int i=0; i