File indexing completed on 2024-09-07 04:37:47
0001 #ifndef MuonIsolation_CaloExtractor_H
0002 #define MuonIsolation_CaloExtractor_H
0003
0004 #include <string>
0005
0006 #include "PhysicsTools/IsolationAlgos/interface/IsoDepositExtractor.h"
0007
0008 #include "FWCore/Framework/interface/ConsumesCollector.h"
0009
0010 #include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
0011 #include "DataFormats/TrackReco/interface/Track.h"
0012 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0013
0014 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
0015
0016 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0017
0018 #include "MagneticField/Engine/interface/MagneticField.h"
0019 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0020 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0021 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0022
0023 namespace muonisolation {
0024
0025 class CaloExtractor : public reco::isodeposit::IsoDepositExtractor {
0026 public:
0027 CaloExtractor() {}
0028 CaloExtractor(const edm::ParameterSet& par, edm::ConsumesCollector&& iC);
0029
0030 ~CaloExtractor() override {}
0031
0032 void fillVetos(const edm::Event& ev, const edm::EventSetup& evSetup, const reco::TrackCollection& tracks) override;
0033 reco::IsoDeposit deposit(const edm::Event& ev,
0034 const edm::EventSetup& evSetup,
0035 const reco::Track& track) const override;
0036
0037
0038 static GlobalPoint MuonAtCaloPosition(
0039 const reco::Track& muon, const double bz, const GlobalPoint& endpos, bool fixVxy = false, bool fixVz = false);
0040
0041 private:
0042
0043 edm::EDGetTokenT<CaloTowerCollection> theCaloTowerCollectionToken;
0044
0045
0046 std::string theDepositLabel;
0047
0048 const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> theCaloGeomToken;
0049 const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> theFieldToken;
0050
0051
0052 double theWeight_E;
0053 double theWeight_H;
0054 double theThreshold_E;
0055 double theThreshold_H;
0056 double theDR_Veto_E;
0057 double theDR_Veto_H;
0058 double theDR_Max;
0059 bool vertexConstraintFlag_XY;
0060 bool vertexConstraintFlag_Z;
0061
0062
0063 std::vector<DetId> theVetoCollection;
0064
0065
0066 double noiseEcal(const CaloTower& tower) const;
0067 double noiseHcal(const CaloTower& tower) const;
0068 };
0069
0070 }
0071
0072 #endif