test
CMS 3D CMS Logo

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

#include <EgammaHLTRegionalPixelSeedGeneratorProducers.h>

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

Public Member Functions

virtual void beginRun (edm::Run const &run, const edm::EventSetup &es) overridefinal
 
 EgammaHLTRegionalPixelSeedGeneratorProducers (const edm::ParameterSet &conf)
 
virtual void endRun (edm::Run const &run, const edm::EventSetup &es) overridefinal
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) override
 
virtual ~EgammaHLTRegionalPixelSeedGeneratorProducers ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotBSProducer_
 
edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
candTag_
 
edm::EDGetTokenT
< reco::ElectronCollection
candTagEle_
 
std::unique_ptr
< SeedGeneratorFromRegionHits
combinatorialSeedGenerator
 
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
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 31 of file EgammaHLTRegionalPixelSeedGeneratorProducers.h.

Constructor & Destructor Documentation

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

Definition at line 43 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

References edm::ParameterSet::addParameter(), SurfaceDeformationFactory::create(), reco::get(), edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

44 {
45 
46  produces<TrajectorySeedCollection>();
47 
48  ptmin_ = conf.getParameter<double>("ptMin");
49  vertexz_ = conf.getParameter<double>("vertexZ");
50  originradius_= conf.getParameter<double>("originRadius");
51  halflength_ = conf.getParameter<double>("originHalfLength");
52  deltaEta_ = conf.getParameter<double>("deltaEtaRegion");
53  deltaPhi_ = conf.getParameter<double>("deltaPhiRegion");
54 
55  candTag_ = consumes<reco::RecoEcalCandidateCollection>(conf.getParameter< edm::InputTag > ("candTag"));
56  candTagEle_ = consumes<reco::ElectronCollection>(conf.getParameter< edm::InputTag > ("candTagEle"));
57  BSProducer_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("BSProducer"));
58 
59  useZvertex_ = conf.getParameter<bool>("UseZInVertex");
60 
61  edm::ParameterSet hitsfactoryPSet = conf.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
62  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
63 
64  // get orderd hits generator from factory
66  OrderedHitsGenerator* hitsGenerator = OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet, iC);
67 
68  // start seed generator
69  edm::ParameterSet creatorPSet;
70  creatorPSet.addParameter<std::string>("propagator","PropagatorWithMaterial");
71 
72  combinatorialSeedGenerator.reset(new SeedGeneratorFromRegionHits( hitsGenerator, 0,
73  SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet)
74  ));
75  // setup orderedhits setup (in order to tell seed generator to use pairs/triplets, which layers)
76 }
T getParameter(std::string const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:144
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > candTag_
std::unique_ptr< SeedGeneratorFromRegionHits > combinatorialSeedGenerator
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:55
EgammaHLTRegionalPixelSeedGeneratorProducers::~EgammaHLTRegionalPixelSeedGeneratorProducers ( )
virtual

Definition at line 79 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

79  {
80 }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 109 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

110 {
111 }
void EgammaHLTRegionalPixelSeedGeneratorProducers::endRun ( edm::Run const &  run,
const edm::EventSetup es 
)
finaloverridevirtual

Reimplemented from edm::EDProducer.

Definition at line 106 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

106 {}
void EgammaHLTRegionalPixelSeedGeneratorProducers::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 82 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_25ns14e33_v1_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

82  {
83 
85  desc.add<double>("ptMin", 1.5);
86  desc.add<double>("vertexZ", 0);
87  desc.add<double>("originRadius", 0.02);
88  desc.add<double>("originHalfLength", 15.0);
89  desc.add<double>("deltaEtaRegion", 0.3);
90  desc.add<double>("deltaPhiRegion", 0.3);
91  desc.add<edm::InputTag>(("candTag"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
92  desc.add<edm::InputTag>(("candTagEle"), edm::InputTag("pixelMatchElectrons"));
93  desc.add<edm::InputTag>(("BSProducer"), edm::InputTag("hltOnlineBeamSpot"));
94  desc.add<bool>(("UseZInVertex"), false);
95  desc.add<std::string>("TTRHBuilder", "WithTrackAngle");
96 
97  edm::ParameterSetDescription orderedHitsPSET;
98  orderedHitsPSET.add<std::string>("ComponentName", "StandardHitPairGenerator");
99  orderedHitsPSET.add<edm::InputTag>("SeedingLayers", edm::InputTag("PixelLayerPairs"));
100  orderedHitsPSET.add<unsigned int>("maxElement", 0);
101  desc.add<edm::ParameterSetDescription>("OrderedHitsFactoryPSet", orderedHitsPSET);
102 
103  descriptions.add(("hltEgammaHLTRegionalPixelSeedGeneratorProducers"), desc);
104 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTRegionalPixelSeedGeneratorProducers::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 114 of file EgammaHLTRegionalPixelSeedGeneratorProducers.cc.

References edm::Event::getByToken(), convertSQLitetoXML_cfg::output, and edm::Event::put().

115 {
116 
117  // resulting collection
118  std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection());
119 
120  // Get the recoEcalCandidates
122  iEvent.getByToken(candTag_,recoecalcands);
123 
124  //Get the Beam Spot position
125  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
126  iEvent.getByToken(BSProducer_,recoBeamSpotHandle);
127  // gets its position
128  const BeamSpot::Point& BSPosition = recoBeamSpotHandle->position();
129 
130  //Get the HLT electrons collection if needed
132  if(useZvertex_)
133  iEvent.getByToken(candTagEle_,electronHandle);
134 
135  reco::SuperClusterRef scRef;
136  for (reco::RecoEcalCandidateCollection::const_iterator recoecalcand= recoecalcands->begin(); recoecalcand!=recoecalcands->end(); recoecalcand++) {
137  scRef = recoecalcand->superCluster();
138  float zvertex = 0;
139  if( useZvertex_ ){
140  reco::SuperClusterRef scRefEle;
141  for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){
142  //Compare electron SC with EcalCandidate SC
143  scRefEle = iElectron->superCluster();
144  if(&(*scRef) == &(*scRefEle)){
145  if(iElectron->track().isNonnull()) zvertex = iElectron->track()->vz();
146  else zvertex = iElectron->gsfTrack()->vz();
147  break;
148  }
149  }
150 
151  }
152  GlobalVector dirVector((recoecalcand)->px(),(recoecalcand)->py(),(recoecalcand)->pz());
153  RectangularEtaPhiTrackingRegion etaphiRegion( dirVector,
154  GlobalPoint( BSPosition.x(), BSPosition.y(), zvertex ),
155  ptmin_,
157  halflength_,
158  deltaEta_,
159  deltaPhi_);
160 
161  // fill Trajectory seed collection
162  combinatorialSeedGenerator->run(*output, etaphiRegion, iEvent, iSetup);
163 
164  }
165 
166  iEvent.put(output);
167 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:29
int iEvent
Definition: GenABIO.cc:230
std::vector< TrajectorySeed > TrajectorySeedCollection
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > candTag_
std::unique_ptr< SeedGeneratorFromRegionHits > combinatorialSeedGenerator

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> EgammaHLTRegionalPixelSeedGeneratorProducers::BSProducer_
private
edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTRegionalPixelSeedGeneratorProducers::candTag_
private
edm::EDGetTokenT<reco::ElectronCollection> EgammaHLTRegionalPixelSeedGeneratorProducers::candTagEle_
private
std::unique_ptr<SeedGeneratorFromRegionHits> EgammaHLTRegionalPixelSeedGeneratorProducers::combinatorialSeedGenerator
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