#include <RecoEgamma/EgammaElectronAlgos/interface/SubSeedGenerator.h>
Public Member Functions | |
void | run (edm::Event &, const edm::EventSetup &setup, const edm::Handle< reco::SuperClusterCollection > &, reco::ElectronPixelSeedCollection &) |
void | setupES (const edm::EventSetup &setup) |
SubSeedGenerator (const edm::ParameterSet &conf) | |
~SubSeedGenerator () | |
Private Attributes | |
double | deta_ |
double | dphi_ |
double | dr_ |
edm::InputTag | initialSeeds_ |
double | pt_ |
Definition at line 19 of file SubSeedGenerator.h.
SubSeedGenerator::SubSeedGenerator | ( | const edm::ParameterSet & | conf | ) |
Definition at line 25 of file SubSeedGenerator.cc.
References deta_, dphi_, dr_, edm::ParameterSet::getParameter(), initialSeeds_, and pt_.
00025 { 00026 initialSeeds_ = conf.getParameter<edm::InputTag>("initialSeeds"); 00027 dr_ = conf.getParameter<double>("seedDr"); 00028 dphi_ = conf.getParameter<double>("seedDPhi"); 00029 deta_ = conf.getParameter<double>("seedDEta"); 00030 pt_ = conf.getParameter<double>("seedPt"); 00031 }
SubSeedGenerator::~SubSeedGenerator | ( | ) |
void SubSeedGenerator::run | ( | edm::Event & | e, | |
const edm::EventSetup & | setup, | |||
const edm::Handle< reco::SuperClusterCollection > & | superClusters, | |||
reco::ElectronPixelSeedCollection & | out | |||
) |
Definition at line 38 of file SubSeedGenerator.cc.
References funct::cos(), deta_, dPhi(), dphi_, reco::CaloCluster::energy(), edm::EventSetup::get(), edm::Event::getByLabel(), i, initialSeeds_, PV3DBase< T, PVType, FrameType >::perp(), reco::CaloCluster::position(), pt_, funct::sin(), PV3DBase< T, PVType, FrameType >::x(), reco::CaloCluster::x(), PV3DBase< T, PVType, FrameType >::y(), reco::CaloCluster::y(), PV3DBase< T, PVType, FrameType >::z(), and reco::CaloCluster::z().
Referenced by GlobalSeedProducer::produce().
00038 { 00039 00040 edm::ESHandle<TrackerGeometry> tracker; 00041 setup.get<TrackerDigiGeometryRecord>().get(tracker); 00042 00043 // get initial TrajectorySeeds 00044 edm::Handle<TrajectorySeedCollection> theInitialSeedColl; 00045 e.getByLabel(initialSeeds_, theInitialSeedColl); 00046 00047 //seeds selection 00048 for(unsigned int i=0; i< superClusters->size(); ++i) { 00049 reco::SuperCluster theClus = (*superClusters)[i]; 00050 00051 std::vector<TrajectorySeed>::const_iterator seed_iter; 00052 for(seed_iter = theInitialSeedColl->begin(); seed_iter != theInitialSeedColl->end(); ++seed_iter) { 00053 00054 GlobalPoint gp = tracker->idToDet( DetId(seed_iter->startingState().detId()))->surface().toGlobal( seed_iter->startingState().parameters().position()); 00055 GlobalVector gv = tracker->idToDet( DetId(seed_iter->startingState().detId()))->surface().toGlobal( seed_iter->startingState().parameters().momentum()); 00056 00057 math::XYZVector seedGlobalDir(gv.x(),gv.y(),gv.z()); 00058 math::XYZVector clusterGlobalDir(theClus.x() - gp.x(), theClus.y() - gp.y(), theClus.z() - gp.z()); 00059 00060 double clusEt = theClus.energy()*sin(clusterGlobalDir.theta()); 00061 double clusEstimatedCurvature = clusEt/0.3/4*100; //4 tesla (temporary solution) 00062 double DphiBending = theClus.position().rho()/2./clusEstimatedCurvature; //ecal radius 00063 00064 //cout << "=== et,curvature, phiBending: " 00065 // << clusEt << " , " 00066 // << clusEstimatedCurvature << " , " 00067 // << DphiBending << endl; 00068 00069 00070 double tmpDr = ROOT::Math::VectorUtil::DeltaR(clusterGlobalDir, seedGlobalDir); 00071 float dEta = fabs(clusterGlobalDir.Eta() - seedGlobalDir.Eta()); 00072 float dPhi = fabs(acos(cos(clusterGlobalDir.Phi() - seedGlobalDir.Phi()))); 00073 00074 float dPhi1 = fabs(dPhi - DphiBending); 00075 float dPhi2 = fabs(dPhi + DphiBending); 00076 00077 if (dEta <= deta_) { 00078 if (dPhi1 <= dphi_|| dPhi2 <= dphi_ ) { 00079 if (gv.perp() > pt_) { 00080 //if(tmpDr <= dr_) { 00081 edm::Ref<reco::SuperClusterCollection> sclRef=edm::Ref<reco::SuperClusterCollection> (superClusters,i); 00082 out.push_back(reco::ElectronPixelSeed(sclRef,*seed_iter)); 00083 //} 00084 } 00085 } 00086 } 00087 } 00088 00089 }//end loop over cluster 00090 00091 00092 edm::LogVerbatim("myElectronProd") << "========== SubSeedsCollectionProducer Info =========="; 00093 edm::LogVerbatim("myElectronProd") << "number of initial seeds: " << theInitialSeedColl->size(); 00094 edm::LogVerbatim("myElectronProd") << "number of filtered seeds: " << out.size(); 00095 edm::LogVerbatim("myElectronProd") << "================================================="; 00096 00097 }
void SubSeedGenerator::setupES | ( | const edm::EventSetup & | setup | ) | [inline] |
double SubSeedGenerator::deta_ [private] |
double SubSeedGenerator::dphi_ [private] |
double SubSeedGenerator::dr_ [private] |
edm::InputTag SubSeedGenerator::initialSeeds_ [private] |
double SubSeedGenerator::pt_ [private] |