forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
193 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
159 changes: 0 additions & 159 deletions
159
DPGAnalysis/CommonNanoAOD/plugins/HitPositionTableProducer.cc
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
DPGAnalysis/HGCalNanoAOD/plugins/HGCALHitPositionTableProducer.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#include "PhysicsTools/NanoAOD/interface/HitPositionTableProducer.h" | ||
#include "DataFormats/ForwardDetId/interface/HGCalDetId.h" | ||
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h" | ||
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h" | ||
|
||
#include "DataFormats/CaloRecHit/interface/CaloRecHit.h" | ||
#include "SimDataFormats/CaloHit/interface/PCaloHit.h" | ||
|
||
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" | ||
#include "Geometry/CaloGeometry/interface/CaloGeometry.h" | ||
#include "Geometry/HGCalGeometry/interface/HGCalGeometry.h" | ||
#include "Geometry/Records/interface/CaloGeometryRecord.h" | ||
#include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h" | ||
#include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h" | ||
|
||
template <typename T> | ||
class HGCalHitPositionTableProducer : public HitPositionTableProducer<edm::View<T>> { | ||
//class HGCalHitPositionTableProducer : public HitPositionTableProducer<edm::View<CaloRecHit>> { | ||
public: | ||
HGCalHitPositionTableProducer(edm::ParameterSet const& params) | ||
: HitPositionTableProducer<edm::View<T>>(params), | ||
caloGeoToken_(edm::stream::EDProducer<>::esConsumes<edm::Transition::BeginRun>()) {} | ||
|
||
~HGCalHitPositionTableProducer() override {} | ||
|
||
GlobalPoint positionFromHit(const CaloRecHit& hit) { | ||
DetId detId = hit.detid(); | ||
return positionFromDetId(detId); | ||
} | ||
|
||
GlobalPoint positionFromHit(const PCaloHit& hit) { | ||
DetId detId = hit.id(); | ||
return positionFromDetId(detId); | ||
} | ||
|
||
void beginRun(const edm::Run&, const edm::EventSetup& iSetup) override { | ||
auto& geom = iSetup.getData(caloGeoToken_); | ||
rhtools_.setGeometry(geom); | ||
} | ||
|
||
GlobalPoint positionFromDetId(DetId id) { | ||
DetId::Detector det = id.det(); | ||
if (det == DetId::HGCalEE || det == DetId::HGCalHSi || det == DetId::HGCalHSc) { | ||
return rhtools_.getPosition(id); | ||
} else { | ||
throw cms::Exception("HGCalHitPositionTableProducer") << "Unsupported DetId type"; | ||
} | ||
} | ||
|
||
protected: | ||
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeoToken_; | ||
hgcal::RecHitTools rhtools_; | ||
}; | ||
|
||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
//typedef HGCalHitPositionTableProducer HGCalRecHitPositionTableProducer; | ||
typedef HGCalHitPositionTableProducer<CaloRecHit> HGCalRecHitPositionTableProducer; | ||
typedef HGCalHitPositionTableProducer<PCaloHit> HGCalSimHitPositionTableProducer; | ||
DEFINE_FWK_MODULE(HGCalRecHitPositionTableProducer); | ||
DEFINE_FWK_MODULE(HGCalSimHitPositionTableProducer); |
12 changes: 8 additions & 4 deletions
12
DPGAnalysis/HGCalNanoAOD/plugins/ObjectIndexFromOneToManyQualAssociationProducer.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
#include "PhysicsTools/NanoAOD/interface/ObjectIndexFromOneToManyQualAssociationProducer.h" | ||
#include "DataFormats/CaloRecHit/interface/CaloCluster.h" | ||
#include "SimDataFormats/CaloAnalysis/interface/SimCluster.h" | ||
#include "SimDataFormats/CaloAnalysis/interface/SimClusterFwd.h" | ||
#include "SimDataFormats/CaloAnalysis/interface/CaloParticle.h" | ||
#include "SimDataFormats/CaloAnalysis/interface/CaloParticleFwd.h" | ||
#include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h" | ||
#include "DataFormats/CaloRecHit/interface/CaloCluster.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
|
||
typedef ObjectIndexFromOneToManyQualAssociationTableProducer<std::vector<reco::CaloCluster>, SimClusterCollection, float> | ||
LayerClusterToSimClusterIndexTableProducer; | ||
typedef ObjectIndexFromOneToManyQualAssociationTableProducer<HGCRecHitCollection, SimClusterCollection, float> | ||
CaloRecHitToSimClusterIndexTableProducer; | ||
typedef ObjectIndexFromOneToManyQualAssociationTableProducer<std::vector<reco::CaloCluster>, CaloParticleCollection, float> | ||
LayerClusterToCaloParticleIndexTableProducer; | ||
typedef ObjectIndexFromOneToManyQualAssociationTableProducer<HGCRecHitCollection, std::vector<reco::CaloCluster>, float> | ||
HGCRecHitToLayerClusterIndexTableProducer; | ||
typedef ObjectIndexFromOneToManyQualAssociationTableProducer<SimClusterCollection, SimClusterCollection, float> | ||
SimClusterToSimClustersIndexTableProducer; | ||
typedef ObjectIndexFromOneToManyQualAssociationTableProducer<HGCRecHitCollection, SimClusterCollection, float> | ||
HGCRecHitToSimClusterIndexTableProducer; | ||
|
||
DEFINE_FWK_MODULE(LayerClusterToSimClusterIndexTableProducer); | ||
DEFINE_FWK_MODULE(LayerClusterToCaloParticleIndexTableProducer); | ||
DEFINE_FWK_MODULE(HGCRecHitToLayerClusterIndexTableProducer); | ||
DEFINE_FWK_MODULE(CaloRecHitToSimClusterIndexTableProducer); | ||
DEFINE_FWK_MODULE(HGCRecHitToSimClusterIndexTableProducer); | ||
DEFINE_FWK_MODULE(SimClusterToSimClustersIndexTableProducer); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.