CMS 3D CMS Logo

EgammaHLTRegionalPixelSeedGeneratorProducers Class Reference

#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTRegionalPixelSeedGeneratorProducers.h>

Inheritance diagram for EgammaHLTRegionalPixelSeedGeneratorProducers:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 EgammaHLTRegionalPixelSeedGeneratorProducers (const edm::ParameterSet &conf)
virtual void produce (edm::Event &e, const edm::EventSetup &c)
virtual ~EgammaHLTRegionalPixelSeedGeneratorProducers ()

Private Attributes

edm::InputTag BSProducer_
edm::InputTag candTag_
edm::InputTag candTagEle_
SeedGeneratorFromRegionHitscombinatorialSeedGenerator
edm::ParameterSet conf_
double deltaEta_
double deltaPhi_
double halflength_
double originradius_
double originz_
double ptmin_
bool useZvertex_
double vertexz_


Detailed Description

Definition at line 26 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.


Constructor & Destructor Documentation

EgammaHLTRegionalPixelSeedGeneratorProducers::EgammaHLTRegionalPixelSeedGeneratorProducers ( const edm::ParameterSet conf  )  [explicit]

Definition at line 46 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

References BSProducer_, candTag_, candTagEle_, combinatorialSeedGenerator, conf_, deltaEta_, deltaPhi_, DBSPlugin::get(), edm::ParameterSet::getParameter(), halflength_, originradius_, ptmin_, useZvertex_, and vertexz_.

00046                                                                                                                       :   conf_(conf),combinatorialSeedGenerator(0)
00047 {
00048 
00049   produces<TrajectorySeedCollection>();
00050 
00051   ptmin_       = conf_.getParameter<double>("ptMin");
00052   vertexz_     = conf_.getParameter<double>("vertexZ");
00053   originradius_= conf_.getParameter<double>("originRadius");
00054   halflength_  = conf_.getParameter<double>("originHalfLength");
00055   deltaEta_    = conf_.getParameter<double>("deltaEtaRegion");
00056   deltaPhi_    = conf_.getParameter<double>("deltaPhiRegion");
00057   candTag_     = conf_.getParameter< edm::InputTag > ("candTag");
00058   candTagEle_  = conf_.getParameter< edm::InputTag > ("candTagEle");
00059   useZvertex_  = conf_.getParameter<bool>("UseZInVertex");
00060   BSProducer_ = conf.getParameter<edm::InputTag>("BSProducer");
00061   // setup orderedhits setup (in order to tell seed generator to use pairs/triplets, which layers)
00062   edm::ParameterSet hitsfactoryPSet =
00063       conf_.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
00064   std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
00065 
00066   // get orderd hits generator from factory
00067   OrderedHitsGenerator*  hitsGenerator =
00068         OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet);
00069 
00070   // start seed generator
00071   combinatorialSeedGenerator = new SeedGeneratorFromRegionHits( hitsGenerator, conf_);
00072 
00073 }

EgammaHLTRegionalPixelSeedGeneratorProducers::~EgammaHLTRegionalPixelSeedGeneratorProducers (  )  [virtual]

Definition at line 76 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

References combinatorialSeedGenerator.

00076                                                                                             { 
00077   delete combinatorialSeedGenerator;
00078 }  


Member Function Documentation

void EgammaHLTRegionalPixelSeedGeneratorProducers::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDProducer.

Definition at line 81 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

References BSProducer_, candTag_, candTagEle_, combinatorialSeedGenerator, deltaEta_, deltaPhi_, edm::Event::getByLabel(), halflength_, originradius_, output(), ptmin_, edm::Event::put(), SeedGeneratorFromRegionHits::run(), and useZvertex_.

00082 {
00083 
00084   // resulting collection
00085   std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection());    
00086 
00087   // Get the recoEcalCandidates
00088   edm::Handle<reco::RecoEcalCandidateCollection> recoecalcands;
00089   iEvent.getByLabel(candTag_,recoecalcands);
00090 
00091   //Get the Beam Spot position
00092   edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
00093   // iEvent.getByType(recoBeamSpotHandle);
00094   iEvent.getByLabel(BSProducer_,recoBeamSpotHandle);
00095   // gets its position
00096   const BeamSpot::Point& BSPosition = recoBeamSpotHandle->position(); 
00097 
00098   //Get the HLT electrons collection if needed
00099   edm::Handle<reco::ElectronCollection> electronHandle;
00100   if(useZvertex_){iEvent.getByLabel(candTagEle_,electronHandle);}
00101 
00102   reco::SuperClusterRef scRef;
00103   for (reco::RecoEcalCandidateCollection::const_iterator recoecalcand= recoecalcands->begin(); recoecalcand!=recoecalcands->end(); recoecalcand++) {
00104     scRef = recoecalcand->superCluster();
00105     float zvertex = 0;
00106     if( useZvertex_ ){
00107       reco::SuperClusterRef scRefEle;
00108       for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){
00109         //Compare electron SC with EcalCandidate SC
00110         scRefEle = iElectron->superCluster();
00111         if(&(*scRef) == &(*scRefEle)){
00112           zvertex = iElectron->track()->vz();     
00113           break;
00114         }
00115       }
00116 
00117     }
00118     GlobalVector dirVector((recoecalcand)->px(),(recoecalcand)->py(),(recoecalcand)->pz());
00119     RectangularEtaPhiTrackingRegion etaphiRegion( dirVector,
00120                                                                                            GlobalPoint( BSPosition.x(), BSPosition.y(), zvertex ), 
00121                                                                                            ptmin_,
00122                                                                                            originradius_,
00123                                                                                            halflength_,
00124                                                                                            deltaEta_,
00125                                                                                            deltaPhi_);
00126 
00127     // fill Trajectory seed collection
00128     combinatorialSeedGenerator->run(*output, etaphiRegion, iEvent, iSetup);
00129     
00130   }
00131 
00132     iEvent.put(output);
00133 }


Member Data Documentation

edm::InputTag EgammaHLTRegionalPixelSeedGeneratorProducers::BSProducer_ [private]

Definition at line 49 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), and produce().

edm::InputTag EgammaHLTRegionalPixelSeedGeneratorProducers::candTag_ [private]

Definition at line 46 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), and produce().

edm::InputTag EgammaHLTRegionalPixelSeedGeneratorProducers::candTagEle_ [private]

Definition at line 47 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), and produce().

SeedGeneratorFromRegionHits* EgammaHLTRegionalPixelSeedGeneratorProducers::combinatorialSeedGenerator [private]

Definition at line 38 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), produce(), and ~EgammaHLTRegionalPixelSeedGeneratorProducers().

edm::ParameterSet EgammaHLTRegionalPixelSeedGeneratorProducers::conf_ [private]

Definition at line 37 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers().

double EgammaHLTRegionalPixelSeedGeneratorProducers::deltaEta_ [private]

Definition at line 44 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), and produce().

double EgammaHLTRegionalPixelSeedGeneratorProducers::deltaPhi_ [private]

Definition at line 45 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), and produce().

double EgammaHLTRegionalPixelSeedGeneratorProducers::halflength_ [private]

Definition at line 42 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), and produce().

double EgammaHLTRegionalPixelSeedGeneratorProducers::originradius_ [private]

Definition at line 41 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), and produce().

double EgammaHLTRegionalPixelSeedGeneratorProducers::originz_ [private]

Definition at line 43 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

double EgammaHLTRegionalPixelSeedGeneratorProducers::ptmin_ [private]

Definition at line 39 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), and produce().

bool EgammaHLTRegionalPixelSeedGeneratorProducers::useZvertex_ [private]

Definition at line 48 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers(), and produce().

double EgammaHLTRegionalPixelSeedGeneratorProducers::vertexz_ [private]

Definition at line 40 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:11 2009 for CMSSW by  doxygen 1.5.4