Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:45

0001 // -*- C++ -*-
0002 //
0003 // Package:    TrackAssociator
0004 // Class:      TrackAssociatorParameters
0005 //
0006 /*
0007 
0008  Description: track associator parameters
0009 
0010 */
0011 //
0012 // Original Author:  Dmytro Kovalskyi
0013 //
0014 //
0015 
0016 #include "TrackingTools/TrackAssociator/interface/TrackAssociatorParameters.h"
0017 
0018 void TrackAssociatorParameters::loadParameters(const edm::ParameterSet& iConfig, edm::ConsumesCollector& iC) {
0019   dREcal = iConfig.getParameter<double>("dREcal");
0020   dRHcal = iConfig.getParameter<double>("dRHcal");
0021   dRMuon = iConfig.getParameter<double>("dRMuon");
0022 
0023   dREcalPreselection = iConfig.getParameter<double>("dREcalPreselection");
0024   dRHcalPreselection = iConfig.getParameter<double>("dRHcalPreselection");
0025   dRMuonPreselection = iConfig.getParameter<double>("dRMuonPreselection");
0026   dRPreshowerPreselection = iConfig.getParameter<double>("dRPreshowerPreselection");
0027 
0028   muonMaxDistanceX = iConfig.getParameter<double>("muonMaxDistanceX");
0029   muonMaxDistanceY = iConfig.getParameter<double>("muonMaxDistanceY");
0030   muonMaxDistanceSigmaX = iConfig.getParameter<double>("muonMaxDistanceSigmaX");
0031   muonMaxDistanceSigmaY = iConfig.getParameter<double>("muonMaxDistanceSigmaY");
0032 
0033   useEcal = iConfig.getParameter<bool>("useEcal");
0034   useHcal = iConfig.getParameter<bool>("useHcal");
0035   useHO = iConfig.getParameter<bool>("useHO");
0036   useCalo = iConfig.getParameter<bool>("useCalo");
0037   useMuon = iConfig.getParameter<bool>("useMuon");
0038   usePreshower = iConfig.getParameter<bool>("usePreshower");
0039   useGEM = iConfig.getParameter<bool>("useGEM");
0040   useME0 = iConfig.getParameter<bool>("useME0");
0041 
0042   theEBRecHitCollectionLabel = iConfig.getParameter<edm::InputTag>("EBRecHitCollectionLabel");
0043   theEERecHitCollectionLabel = iConfig.getParameter<edm::InputTag>("EERecHitCollectionLabel");
0044   theCaloTowerCollectionLabel = iConfig.getParameter<edm::InputTag>("CaloTowerCollectionLabel");
0045   theHBHERecHitCollectionLabel = iConfig.getParameter<edm::InputTag>("HBHERecHitCollectionLabel");
0046   theHORecHitCollectionLabel = iConfig.getParameter<edm::InputTag>("HORecHitCollectionLabel");
0047   theDTRecSegment4DCollectionLabel = iConfig.getParameter<edm::InputTag>("DTRecSegment4DCollectionLabel");
0048   theCSCSegmentCollectionLabel = iConfig.getParameter<edm::InputTag>("CSCSegmentCollectionLabel");
0049   theGEMSegmentCollectionLabel = iConfig.getParameter<edm::InputTag>("GEMSegmentCollectionLabel");
0050   theME0SegmentCollectionLabel = iConfig.getParameter<edm::InputTag>("ME0SegmentCollectionLabel");
0051 
0052   accountForTrajectoryChangeCalo = iConfig.getParameter<bool>("accountForTrajectoryChangeCalo");
0053   // accountForTrajectoryChangeMuon   = iConfig.getParameter<bool>("accountForTrajectoryChangeMuon");
0054 
0055   truthMatch = iConfig.getParameter<bool>("truthMatch");
0056   muonMaxDistanceSigmaY = iConfig.getParameter<double>("trajectoryUncertaintyTolerance");
0057 
0058   if (useEcal) {
0059     EBRecHitsToken = iC.consumes<EBRecHitCollection>(theEBRecHitCollectionLabel);
0060     EERecHitsToken = iC.consumes<EERecHitCollection>(theEERecHitCollectionLabel);
0061   }
0062   if (useCalo)
0063     caloTowersToken = iC.consumes<CaloTowerCollection>(theCaloTowerCollectionLabel);
0064   if (useHcal)
0065     HBHEcollToken = iC.consumes<HBHERecHitCollection>(theHBHERecHitCollectionLabel);
0066   if (useHO)
0067     HOcollToken = iC.consumes<HORecHitCollection>(theHORecHitCollectionLabel);
0068   if (useMuon) {
0069     dtSegmentsToken = iC.consumes<DTRecSegment4DCollection>(theDTRecSegment4DCollectionLabel);
0070     cscSegmentsToken = iC.consumes<CSCSegmentCollection>(theCSCSegmentCollectionLabel);
0071     if (useGEM)
0072       gemSegmentsToken = iC.consumes<GEMSegmentCollection>(theGEMSegmentCollectionLabel);
0073     if (useME0)
0074       me0SegmentsToken = iC.consumes<ME0SegmentCollection>(theME0SegmentCollectionLabel);
0075   }
0076   if (truthMatch) {
0077     simTracksToken = iC.consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"));
0078     simVerticesToken = iC.consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits"));
0079     simEcalHitsEBToken = iC.consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEB"));
0080     simEcalHitsEEToken = iC.consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEE"));
0081     simHcalHitsToken = iC.consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "HcalHits"));
0082   }
0083 
0084   ecalDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "EcalDetIdAssociator"));
0085   hcalDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "HcalDetIdAssociator"));
0086   hoDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "HODetIdAssociator"));
0087   caloDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "CaloDetIdAssociator"));
0088   muonDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "MuonDetIdAssociator"));
0089   preshowerDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "PreshowerDetIdAssociator"));
0090   theCaloGeometryToken = iC.esConsumes();
0091   theTrackingGeometryToken = iC.esConsumes();
0092   bFieldToken = iC.esConsumes();
0093 }
0094 
0095 TrackAssociatorParameters::TrackAssociatorParameters(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iC) {
0096   loadParameters(iConfig, iC);
0097 }