Go to the documentation of this file.00001 #ifndef RecoEgamma_EgammaPhotonProducers_ConvertedPhotonProducer_h
00002 #define RecoEgamma_EgammaPhotonProducers_ConvertedPhotonProducer_h
00003
00013 #include "FWCore/Framework/interface/EDProducer.h"
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015 #include "FWCore/Framework/interface/Event.h"
00016 #include "FWCore/Framework/interface/EventSetup.h"
00017 #include "FWCore/Framework/interface/ESHandle.h"
00018 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00019 #include "MagneticField/Engine/interface/MagneticField.h"
00020 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00021 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
00022 #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h"
00023 #include "TrackingTools/DetLayers/interface/NavigationSetter.h"
00024 #include "TrackingTools/DetLayers/interface/NavigationSchool.h"
00025 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
00026 #include "RecoTracker/TkNavigation/interface/SimpleNavigationSchool.h"
00027 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
00028 #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
00029 #include "DataFormats/Common/interface/View.h"
00030 #include "RecoEgamma/EgammaTools/interface/ConversionLikelihoodCalculator.h"
00031 #include "RecoCaloTools/MetaCollections/interface/CaloRecHitMetaCollections.h"
00032 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
00033 #include "RecoEgamma/EgammaPhotonAlgos/interface/ConversionTrackPairFinder.h"
00034
00035 class ConversionTrackEcalImpactPoint;
00036 class ConversionTrackPairFinder;
00037 class ConversionVertexFinder;
00038 class ConvertedPhotonProducer : public edm::EDProducer {
00039
00040 public:
00041
00042 ConvertedPhotonProducer (const edm::ParameterSet& ps);
00043 ~ConvertedPhotonProducer();
00044
00045 virtual void beginRun (edm::Run& r, edm::EventSetup const & es);
00046 virtual void endRun (edm::Run& r, edm::EventSetup const & es);
00047 virtual void produce(edm::Event& evt, const edm::EventSetup& es);
00048 virtual void endJob();
00049
00050
00051 private:
00052
00053
00054
00055
00056
00057
00058 void buildCollections ( edm::EventSetup const & es,
00059 const edm::Handle<edm::View<reco::CaloCluster> > & scHandle,
00060 const edm::Handle<edm::View<reco::CaloCluster> > & bcHandle,
00061 const edm::Handle<CaloTowerCollection> & hcalTowersHandle,
00062 const edm::Handle<reco::TrackCollection> & trkHandle,
00063 std::map<std::vector<reco::TransientTrack>, reco::CaloClusterPtr, CompareTwoTracksVectors>& allPairs,
00064 reco::ConversionCollection & outputConvPhotonCollection);
00065 void cleanCollections (const edm::Handle<edm::View<reco::CaloCluster> > & scHandle,
00066 const edm::OrphanHandle<reco::ConversionCollection> & conversionHandle,
00067 reco::ConversionCollection & outputCollection);
00068
00069 std::vector<reco::ConversionRef> solveAmbiguity( const edm::OrphanHandle<reco::ConversionCollection> & conversionHandle, reco::CaloClusterPtr& sc);
00070
00071 float calculateMinApproachDistance ( const reco::TrackRef& track1, const reco::TrackRef& track2);
00072 void getCircleCenter(const reco::TrackRef& tk, double r, double& x0, double& y0);
00073
00074
00075 std::string conversionOITrackProducer_;
00076 std::string conversionIOTrackProducer_;
00077
00078
00079 std::string outInTrackSCAssociationCollection_;
00080 std::string inOutTrackSCAssociationCollection_;
00081
00082
00083 std::string ConvertedPhotonCollection_;
00084 std::string CleanedConvertedPhotonCollection_;
00085
00086 edm::InputTag bcBarrelCollection_;
00087 edm::InputTag bcEndcapCollection_;
00088 edm::InputTag scHybridBarrelProducer_;
00089 edm::InputTag scIslandEndcapProducer_;
00090 edm::ParameterSet conf_;
00091 edm::InputTag hcalTowers_;
00092
00093 edm::ESHandle<CaloGeometry> theCaloGeom_;
00094 edm::ESHandle<MagneticField> theMF_;
00095 edm::ESHandle<TransientTrackBuilder> theTransientTrackBuilder_;
00096
00097 ConversionTrackPairFinder* theTrackPairFinder_;
00098 ConversionVertexFinder* theVertexFinder_;
00099 ConversionTrackEcalImpactPoint* theEcalImpactPositionFinder_;
00100 int nEvt_;
00101 std::string algoName_;
00102
00103
00104 double hOverEConeSize_;
00105 double maxHOverE_;
00106 double minSCEt_;
00107 bool recoverOneTrackCase_;
00108 double dRForConversionRecovery_;
00109 double deltaCotCut_;
00110 double minApproachDisCut_;
00111 int maxNumOfCandidates_;
00112 bool risolveAmbiguity_;
00113
00114
00115 ConversionLikelihoodCalculator* theLikelihoodCalc_;
00116 std::string likelihoodWeights_;
00117
00118 math::XYZPointF toFConverterP( const math::XYZPoint &val) {
00119 return math::XYZPointF(val.x(),val.y(),val.z());
00120 }
00121
00122 math::XYZVectorF toFConverterV( const math::XYZVector &val) {
00123 return math::XYZVectorF(val.x(),val.y(),val.z());
00124 }
00125
00126
00127
00128 };
00129 #endif