Go to the documentation of this file.00001
00002 #ifndef TrackClassifier_h
00003 #define TrackClassifier_h
00004
00005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00006 #include "FWCore/Utilities/interface/InputTag.h"
00007
00008 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00009 #include "MagneticField/Engine/interface/MagneticField.h"
00010
00011 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00012
00013 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
00014
00015 #include "SimTracker/TrackHistory/interface/TrackCategories.h"
00016 #include "SimTracker/TrackHistory/interface/TrackHistory.h"
00017 #include "SimTracker/TrackHistory/interface/TrackQuality.h"
00018
00019 #include "TrackingTools/PatternTools/interface/TSCPBuilderNoMaterial.h"
00020 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
00021 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00022 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
00023
00024
00026 class TrackClassifier : public TrackCategories
00027 {
00028
00029 public:
00030
00032 typedef TrackCategories Categories;
00033
00035 TrackClassifier(edm::ParameterSet const &);
00036
00038 void newEvent(edm::Event const &, edm::EventSetup const &);
00039
00041 TrackClassifier const & evaluate (reco::TrackBaseRef const &);
00042
00044 TrackClassifier const & evaluate (TrackingParticleRef const &);
00045
00047 TrackClassifier const & evaluate (reco::TrackRef const & track)
00048 {
00049 return evaluate( reco::TrackBaseRef(track) );
00050 }
00051
00053 TrackHistory const & history() const
00054 {
00055 return tracer_;
00056 }
00057
00059 TrackQuality const & quality() const
00060 {
00061 return quality_;
00062 }
00063
00064 private:
00065
00066 const edm::InputTag hepMCLabel_;
00067 const edm::InputTag beamSpotLabel_;
00068
00069 double badPull_;
00070 double longLivedDecayLength_;
00071 double vertexClusteringSqDistance_;
00072 unsigned int numberOfInnerLayers_;
00073 unsigned int minTrackerSimHits_;
00074
00075 struct G4
00076 {
00077 enum Process
00078 {
00079 Undefined = 0,
00080 Unknown,
00081 Primary,
00082 Hadronic,
00083 Decay,
00084 Compton,
00085 Annihilation,
00086 EIoni,
00087 HIoni,
00088 MuIoni,
00089 Photon,
00090 MuPairProd,
00091 Conversions,
00092 EBrem,
00093 SynchrotronRadiation,
00094 MuBrem,
00095 MuNucl
00096 };
00097 };
00098
00099 TrackHistory tracer_;
00100
00101 TrackQuality quality_;
00102
00103 edm::ESHandle<MagneticField> magneticField_;
00104
00105 edm::Handle<edm::HepMCProduct> mcInformation_;
00106
00107 edm::ESHandle<ParticleDataTable> particleDataTable_;
00108
00109 edm::ESHandle<TransientTrackBuilder> transientTrackBuilder_;
00110
00111 edm::Handle<reco::BeamSpot> beamSpot_;
00112
00114 void reconstructionInformation(reco::TrackBaseRef const &);
00115
00117 void simulationInformation();
00118
00120 void qualityInformation(reco::TrackBaseRef const &);
00121
00123 void hadronFlavor();
00124
00126 void processesAtGenerator();
00127
00129 void processesAtSimulation();
00130
00132 void vertexInformation();
00133
00135 struct GeneratedPrimaryVertex
00136 {
00137
00138 GeneratedPrimaryVertex(double x1,double y1,double z1): x(x1), y(y1), z(z1), ptsq(0), nGenTrk(0) {}
00139
00140 bool operator< ( GeneratedPrimaryVertex const & reference) const
00141 {
00142 return ptsq < reference.ptsq;
00143 }
00144
00145 double x, y, z;
00146 double ptsq;
00147 int nGenTrk;
00148
00149 HepMC::FourVector ptot;
00150
00151 std::vector<int> finalstateParticles;
00152 std::vector<int> simTrackIndex;
00153 std::vector<int> genVertex;
00154 };
00155
00156 std::vector<GeneratedPrimaryVertex> genpvs_;
00157
00158
00159 bool isFinalstateParticle(const HepMC::GenParticle *);
00160 bool isCharged(const HepMC::GenParticle *);
00161 void genPrimaryVertices();
00162
00163 };
00164
00165 #endif