Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrated, associatorchi2 and looseHits, perfectseed
- Loading branch information
Showing
12 changed files
with
922 additions
and
5 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
Binary file modified
BIN
+17.1 KB
(110%)
RecoTracker/TkSeedGenerator/data/JetCoreDirectSeedGenerator_TrainedModel.pb
Binary file not shown.
675 changes: 675 additions & 0 deletions
675
RecoTracker/TkSeedGenerator/plugins/JetCorePerfectSeedGenerator.cc
Large diffs are not rendered by default.
Oops, something went wrong.
191 changes: 191 additions & 0 deletions
191
RecoTracker/TkSeedGenerator/plugins/JetCorePerfectSeedGenerator.h
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,191 @@ | ||
#ifndef RecoTracker_TkSeedGenerator_JetCorePerfectSeedGenerator_H | ||
#define RecoTracker_TkSeedGenerator_JetCorePerfectSeedGenerator_H | ||
|
||
#define jetDimX 30 | ||
#define jetDimY 30 | ||
#define Nlayer 4 | ||
#define Nover 3 | ||
#define Npar 5 | ||
|
||
|
||
#include <memory> | ||
|
||
// user include files | ||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Framework/interface/one/EDProducer.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h" | ||
#include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h" | ||
#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h" | ||
#include "Geometry/Records/interface/TrackerTopologyRcd.h" | ||
|
||
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" | ||
#include "DataFormats/Common/interface/Handle.h" | ||
#include "DataFormats/Common/interface/DetSetVector.h" | ||
#include "DataFormats/Common/interface/DetSet.h" | ||
#include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h" | ||
#include "DataFormats/VertexReco/interface/Vertex.h" | ||
#include "DataFormats/TrackReco/interface/Track.h" | ||
#include "DataFormats/VertexReco/interface/VertexFwd.h" | ||
#include "DataFormats/JetReco/interface/Jet.h" | ||
#include "DataFormats/SiPixelDigi/interface/PixelDigi.h" | ||
#include "DataFormats/GeometryVector/interface/VectorUtil.h" | ||
#include "DataFormats/SiPixelDetId/interface/PXBDetId.h" | ||
#include "DataFormats/Math/interface/Point3D.h" | ||
#include "DataFormats/Math/interface/Vector3D.h" | ||
#include "DataFormats/Candidate/interface/Candidate.h" | ||
|
||
|
||
#include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" | ||
#include "RecoLocalTracker/Records/interface/TkPixelCPERecord.h" | ||
|
||
#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" | ||
|
||
#include "TrackingTools/GeomPropagators/interface/StraightLinePlaneCrossing.h" | ||
#include "TrackingTools/GeomPropagators/interface/Propagator.h" | ||
#include "TrackingTools/Records/interface/TrackingComponentsRecord.h" | ||
|
||
#include "MagneticField/Engine/interface/MagneticField.h" | ||
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" | ||
|
||
|
||
|
||
#include <boost/range.hpp> | ||
#include <boost/foreach.hpp> | ||
#include "boost/multi_array.hpp" | ||
|
||
#include "FWCore/ServiceRegistry/interface/Service.h" | ||
#include "CommonTools/UtilAlgos/interface/TFileService.h" | ||
|
||
// #include "SimG4Core/Application/interface/G4SimTrack.h" | ||
#include "SimDataFormats/Track/interface/SimTrack.h" | ||
|
||
#include "SimDataFormats/Vertex/interface/SimVertex.h" | ||
|
||
|
||
#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" | ||
|
||
#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" | ||
|
||
#include "SimDataFormats/TrackingHit/interface/PSimHit.h" | ||
|
||
|
||
#include "TTree.h" | ||
#include "PhysicsTools/TensorFlow/interface/TensorFlow.h" | ||
|
||
|
||
namespace edm { class Event; class EventSetup; } | ||
|
||
|
||
class JetCorePerfectSeedGenerator : public edm::one::EDProducer<edm::one::SharedResources> { | ||
public: | ||
explicit JetCorePerfectSeedGenerator(const edm::ParameterSet&); | ||
~JetCorePerfectSeedGenerator(); | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); | ||
// A pointer to a cluster and a list of tracks on it | ||
struct TrackAndState | ||
{ | ||
TrackAndState(const reco::Track *aTrack, TrajectoryStateOnSurface aState) : | ||
track(aTrack), state(aState) {} | ||
const reco::Track* track; | ||
TrajectoryStateOnSurface state; | ||
}; | ||
|
||
|
||
template<typename Cluster> | ||
struct ClusterWithTracks | ||
{ | ||
ClusterWithTracks(const Cluster &c) : cluster(&c) {} | ||
const Cluster* cluster; | ||
std::vector<TrackAndState> tracks; | ||
}; | ||
|
||
typedef ClusterWithTracks<SiPixelCluster> SiPixelClusterWithTracks; | ||
|
||
typedef boost::sub_range<std::vector<SiPixelClusterWithTracks> > SiPixelClustersWithTracks; | ||
|
||
TFile* JetCorePerfectSeedGenerator_out; | ||
TTree* JetCorePerfectSeedGeneratorTree; | ||
// static const int jetDimX =30; | ||
// static const int jetDimY =30; | ||
// static const int Nlayer =4; | ||
// static const int Nover = 3; | ||
// static const int Npar = 4; | ||
|
||
// double clusterMeas[jetDimX][jetDimY][Nlayer]; | ||
double jet_pt; | ||
double jet_eta; | ||
double pitchX = 0.01; | ||
double pitchY = 0.015; | ||
bool print = false; | ||
int evt_counter =0; | ||
bool inclusiveConeSeed = true; //true= fill tracks in a cone of deltaR_, false=fill tracks which produce SimHit on globDet | ||
|
||
|
||
private: | ||
virtual void beginJob() override; | ||
virtual void produce( edm::Event&, const edm::EventSetup&) override; | ||
virtual void endJob() override; | ||
|
||
|
||
// ----------member data --------------------------- | ||
std::string propagatorName_; | ||
edm::ESHandle<MagneticField> magfield_; | ||
edm::ESHandle<GlobalTrackingGeometry> geometry_; | ||
edm::ESHandle<Propagator> propagator_; | ||
|
||
edm::EDGetTokenT<std::vector<reco::Vertex> > vertices_; | ||
edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > pixelClusters_; | ||
std::vector<SiPixelClusterWithTracks> allSiPixelClusters; | ||
std::map<uint32_t, SiPixelClustersWithTracks> siPixelDetsWithClusters; | ||
edm::Handle< edm::DetSetVector<PixelDigiSimLink> > pixeldigisimlink; | ||
edm::Handle<edmNew::DetSetVector<SiPixelCluster> > inputPixelClusters; | ||
edm::EDGetTokenT< edm::DetSetVector<PixelDigiSimLink> > pixeldigisimlinkToken; | ||
edm::EDGetTokenT<edm::View<reco::Candidate> > cores_; | ||
edm::EDGetTokenT<std::vector<SimTrack> > simtracksToken; | ||
edm::EDGetTokenT<std::vector<SimVertex> > simvertexToken; | ||
edm::EDGetTokenT<std::vector<PSimHit> > PSimHitToken; | ||
edm::Handle<std::vector<PSimHit> > simhits; | ||
|
||
double ptMin_; | ||
double deltaR_; | ||
double chargeFracMin_; | ||
double centralMIPCharge_; | ||
|
||
std::string pixelCPE_; | ||
|
||
tensorflow::GraphDef* graph_; | ||
tensorflow::Session* session_; | ||
|
||
|
||
|
||
std::pair<bool, Basic3DVector<float>> findIntersection(const GlobalVector & , const reco::Candidate::Point & ,const GeomDet*); | ||
|
||
void fillPixelMatrix(const SiPixelCluster &, int, auto, const GeomDet*, tensorflow::NamedTensorList); | ||
|
||
std::pair<int,int> local2Pixel(double, double, const GeomDet*); | ||
|
||
LocalPoint pixel2Local(int, int, const GeomDet*); | ||
|
||
int pixelFlipper(const GeomDet*); | ||
|
||
const GeomDet* DetectorSelector(int ,const reco::Candidate& jet, GlobalVector, const reco::Vertex& jetVertex, const TrackerTopology* const); | ||
|
||
std::vector<GlobalVector> splittedClusterDirections(const reco::Candidate&, const TrackerTopology* const, auto pp, const reco::Vertex& jetVertex, int ); | ||
|
||
std::vector<PSimHit> coreHitsFilling(auto,const GeomDet*,GlobalVector,const reco::Vertex&); | ||
std::pair<std::vector<SimTrack>,std::vector<SimVertex>> coreTracksFilling(std::vector<PSimHit>, const auto &, const auto &); | ||
|
||
std::vector<std::array<double,5>> seedParFilling(std::pair<std::vector<SimTrack>,std::vector<SimVertex>>,const GeomDet*); | ||
|
||
std::pair<std::vector<SimTrack>,std::vector<SimVertex>> coreTracksFillingDeltaR( const auto &, const auto &,const GeomDet* , const reco::Candidate& ); | ||
|
||
|
||
}; | ||
#endif |
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
12 changes: 12 additions & 0 deletions
12
RecoTracker/TkSeedGenerator/python/jetCorePerfectSeedGenerator_cfi.py
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,12 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
JetCorePerfectSeedGenerator = cms.EDProducer("JetCorePerfectSeedGenerator", | ||
vertices= cms.InputTag("offlinePrimaryVertices"), | ||
pixelClusters= cms.InputTag("siPixelClustersPreSplitting"), | ||
cores= cms.InputTag("jetsForCoreTracking"), | ||
ptMin= cms.double(300), | ||
deltaR= cms.double(0.1), | ||
chargeFractionMin= cms.double(18000.0), | ||
centralMIPCharge= cms.double(2), | ||
pixelCPE= cms.string( "PixelCPEGeneric" ) | ||
) |
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
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
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