CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EgammaHLTRegionalPixelSeedGeneratorProducers Class Reference

#include <EgammaHLTRegionalPixelSeedGeneratorProducers.h>

Inheritance diagram for EgammaHLTRegionalPixelSeedGeneratorProducers:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run &run, const edm::EventSetup &es)
 
 EgammaHLTRegionalPixelSeedGeneratorProducers (const edm::ParameterSet &conf)
 
virtual void endRun (edm::Run &run, const edm::EventSetup &es)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~EgammaHLTRegionalPixelSeedGeneratorProducers ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 25 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Constructor & Destructor Documentation

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

Definition at line 47 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

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

48 {
49 
50  produces<TrajectorySeedCollection>();
51 
52  ptmin_ = conf_.getParameter<double>("ptMin");
53  vertexz_ = conf_.getParameter<double>("vertexZ");
54  originradius_= conf_.getParameter<double>("originRadius");
55  halflength_ = conf_.getParameter<double>("originHalfLength");
56  deltaEta_ = conf_.getParameter<double>("deltaEtaRegion");
57  deltaPhi_ = conf_.getParameter<double>("deltaPhiRegion");
58  candTag_ = conf_.getParameter< edm::InputTag > ("candTag");
59  candTagEle_ = conf_.getParameter< edm::InputTag > ("candTagEle");
60  useZvertex_ = conf_.getParameter<bool>("UseZInVertex");
61  BSProducer_ = conf.getParameter<edm::InputTag>("BSProducer");
62  // setup orderedhits setup (in order to tell seed generator to use pairs/triplets, which layers)
63 }
T getParameter(std::string const &) const
EgammaHLTRegionalPixelSeedGeneratorProducers::~EgammaHLTRegionalPixelSeedGeneratorProducers ( )
virtual

Definition at line 66 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

66  {
67 }

Member Function Documentation

void EgammaHLTRegionalPixelSeedGeneratorProducers::beginRun ( edm::Run run,
const edm::EventSetup es 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 76 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

References edm::ParameterSet::addParameter(), combinatorialSeedGenerator, conf_, SurfaceDeformationFactory::create(), reco::get(), and edm::ParameterSet::getParameter().

77 {
78  edm::ParameterSet hitsfactoryPSet =
79  conf_.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
80  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
81 
82  // get orderd hits generator from factory
83  OrderedHitsGenerator* hitsGenerator =
84  OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet);
85 
86  // start seed generator
87  // FIXME??
88  edm::ParameterSet creatorPSet;
89  creatorPSet.addParameter<std::string>("propagator","PropagatorWithMaterial");
90 
92  SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet)
93  );
94 }
T getParameter(std::string const &) const
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:145
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:56
void EgammaHLTRegionalPixelSeedGeneratorProducers::endRun ( edm::Run run,
const edm::EventSetup es 
)
virtual
void EgammaHLTRegionalPixelSeedGeneratorProducers::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 97 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

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

98 {
99 
100  // resulting collection
101  std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection());
102 
103  // Get the recoEcalCandidates
105  iEvent.getByLabel(candTag_,recoecalcands);
106 
107  //Get the Beam Spot position
108  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
109  // iEvent.getByType(recoBeamSpotHandle);
110  iEvent.getByLabel(BSProducer_,recoBeamSpotHandle);
111  // gets its position
112  const BeamSpot::Point& BSPosition = recoBeamSpotHandle->position();
113 
114  //Get the HLT electrons collection if needed
116  if(useZvertex_){iEvent.getByLabel(candTagEle_,electronHandle);}
117 
118  reco::SuperClusterRef scRef;
119  for (reco::RecoEcalCandidateCollection::const_iterator recoecalcand= recoecalcands->begin(); recoecalcand!=recoecalcands->end(); recoecalcand++) {
120  scRef = recoecalcand->superCluster();
121  float zvertex = 0;
122  if( useZvertex_ ){
123  reco::SuperClusterRef scRefEle;
124  for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){
125  //Compare electron SC with EcalCandidate SC
126  scRefEle = iElectron->superCluster();
127  if(&(*scRef) == &(*scRefEle)){
128  if(iElectron->track().isNonnull()) zvertex = iElectron->track()->vz();
129  else zvertex = iElectron->gsfTrack()->vz();
130  break;
131  }
132  }
133 
134  }
135  GlobalVector dirVector((recoecalcand)->px(),(recoecalcand)->py(),(recoecalcand)->pz());
136  RectangularEtaPhiTrackingRegion etaphiRegion( dirVector,
137  GlobalPoint( BSPosition.x(), BSPosition.y(), zvertex ),
138  ptmin_,
140  halflength_,
141  deltaEta_,
142  deltaPhi_);
143 
144  // fill Trajectory seed collection
145  combinatorialSeedGenerator->run(*output, etaphiRegion, iEvent, iSetup);
146 
147  }
148 
149  iEvent.put(output);
150 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:30
int iEvent
Definition: GenABIO.cc:243
std::vector< TrajectorySeed > TrajectorySeedCollection
void run(TrajectorySeedCollection &seedCollection, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)

Member Data Documentation

edm::InputTag EgammaHLTRegionalPixelSeedGeneratorProducers::BSProducer_
private
edm::InputTag EgammaHLTRegionalPixelSeedGeneratorProducers::candTag_
private
edm::InputTag EgammaHLTRegionalPixelSeedGeneratorProducers::candTagEle_
private
SeedGeneratorFromRegionHits* EgammaHLTRegionalPixelSeedGeneratorProducers::combinatorialSeedGenerator
private

Definition at line 41 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Referenced by beginRun(), endRun(), and produce().

edm::ParameterSet EgammaHLTRegionalPixelSeedGeneratorProducers::conf_
private
double EgammaHLTRegionalPixelSeedGeneratorProducers::deltaEta_
private
double EgammaHLTRegionalPixelSeedGeneratorProducers::deltaPhi_
private
double EgammaHLTRegionalPixelSeedGeneratorProducers::halflength_
private
double EgammaHLTRegionalPixelSeedGeneratorProducers::originradius_
private
double EgammaHLTRegionalPixelSeedGeneratorProducers::originz_
private
double EgammaHLTRegionalPixelSeedGeneratorProducers::ptmin_
private
bool EgammaHLTRegionalPixelSeedGeneratorProducers::useZvertex_
private
double EgammaHLTRegionalPixelSeedGeneratorProducers::vertexz_
private