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 Member Functions | Private Attributes
l1t::PhysicalEtAdder Class Reference

#include <PhysicalEtAdder.h>

Inheritance diagram for l1t::PhysicalEtAdder:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PhysicalEtAdder (const edm::ParameterSet &ps)
 
 ~PhysicalEtAdder ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
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 Member Functions

virtual void beginJob () override
 
virtual void endJob () override
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetToken EGammaToken_
 
edm::EDGetToken EtSumToken_
 
edm::EDGetToken JetToken_
 
edm::EDGetToken TauToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 39 of file PhysicalEtAdder.h.

Constructor & Destructor Documentation

l1t::PhysicalEtAdder::PhysicalEtAdder ( const edm::ParameterSet ps)
explicit

Definition at line 24 of file PhysicalEtAdder.cc.

References EGammaToken_, EtSumToken_, edm::ParameterSet::getParameter(), JetToken_, and TauToken_.

24  {
25 
26  produces<l1t::EGammaBxCollection>();
27  produces<l1t::TauBxCollection>();
28  produces<l1t::JetBxCollection>();
29  produces<l1t::EtSumBxCollection>();
30 
31  EGammaToken_ = consumes<l1t::EGammaBxCollection>(ps.getParameter<edm::InputTag>("InputCollection"));
32  TauToken_ = consumes<l1t::TauBxCollection>(ps.getParameter<edm::InputTag>("InputCollection"));
33  JetToken_ = consumes<l1t::JetBxCollection>(ps.getParameter<edm::InputTag>("InputCollection"));
34  EtSumToken_ = consumes<l1t::EtSumBxCollection>(ps.getParameter<edm::InputTag>("InputCollection"));
35 }
T getParameter(std::string const &) const
edm::EDGetToken EtSumToken_
edm::EDGetToken TauToken_
edm::EDGetToken EGammaToken_
edm::EDGetToken JetToken_
l1t::PhysicalEtAdder::~PhysicalEtAdder ( )

Definition at line 37 of file PhysicalEtAdder.cc.

37  {
38 
39 }

Member Function Documentation

void l1t::PhysicalEtAdder::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 171 of file PhysicalEtAdder.cc.

172 {
173 }
void l1t::PhysicalEtAdder::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 177 of file PhysicalEtAdder.cc.

177  {
178 }
void l1t::PhysicalEtAdder::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 216 of file PhysicalEtAdder.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

216  {
217  //The following says we do not know what parameters are allowed so do no validation
218  // Please change this to state exactly what you do use, even if it is no parameters
220  desc.setUnknown();
221  descriptions.addDefault(desc);
222 }
void addDefault(ParameterSetDescription const &psetDescription)
void l1t::PhysicalEtAdder::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 43 of file PhysicalEtAdder.cc.

References eta(), edm::EventSetup::get(), edm::Event::getByToken(), getPhysicalEta(), getPhysicalPhi(), l1t::L1Candidate::hwPt(), metsig::jet, p4, phi, RecoTauCleanerPlugins::pt, edm::Event::put(), and metsig::tau.

44 {
45  // store new collections which include physical quantities
46  std::auto_ptr<l1t::EGammaBxCollection> new_egammas (new l1t::EGammaBxCollection);
47  std::auto_ptr<l1t::TauBxCollection> new_taus (new l1t::TauBxCollection);
48  std::auto_ptr<l1t::JetBxCollection> new_jets (new l1t::JetBxCollection);
49  std::auto_ptr<l1t::EtSumBxCollection> new_etsums (new l1t::EtSumBxCollection);
50 
55 
56  iEvent.getByToken(EGammaToken_, old_egammas);
57  iEvent.getByToken(TauToken_, old_taus);
58  iEvent.getByToken(JetToken_, old_jets);
59  iEvent.getByToken(EtSumToken_, old_etsums);
60 
61 
62  //get the proper scales for conversion to physical et
64  iSetup.get< L1EmEtScaleRcd >().get( emScale ) ;
65 
67  iSetup.get< L1JetEtScaleRcd >().get( jetScale ) ;
68 
69  edm::ESHandle< L1CaloEtScale > hwForJetScale ;
70  iSetup.get< L1JetEtScaleRcd >().get( hwForJetScale ) ;
71 
72  edm::ESHandle< L1CaloEtScale > htMissScale ;
73  std::vector< bool > htMissMatched ;
74  iSetup.get< L1HtMissScaleRcd >().get( htMissScale ) ;
75 
76  int firstBX = old_egammas->getFirstBX();
77  int lastBX = old_egammas->getLastBX();
78 
79  new_egammas->setBXRange(firstBX, lastBX);
80  new_taus->setBXRange(firstBX, lastBX);
81  new_jets->setBXRange(firstBX, lastBX);
82  new_taus->setBXRange(firstBX, lastBX);
83 
84  for(int bx = firstBX; bx <= lastBX; ++bx)
85  {
86  for(l1t::EGammaBxCollection::const_iterator itEGamma = old_egammas->begin(bx);
87  itEGamma != old_egammas->end(bx); ++itEGamma)
88  {
89  const double pt = itEGamma->hwPt() * emScale->linearLsb();
90  const double eta = getPhysicalEta(itEGamma->hwEta());
91  const double phi = getPhysicalPhi(itEGamma->hwPhi());
93 
94  l1t::EGamma *eg = new l1t::EGamma(*p4, itEGamma->hwPt(),
95  itEGamma->hwEta(), itEGamma->hwPhi(),
96  itEGamma->hwQual(), itEGamma->hwIso());
97  new_egammas->push_back(bx, *eg);
98 
99 
100  }
101 
102  for(l1t::TauBxCollection::const_iterator itTau = old_taus->begin(bx);
103  itTau != old_taus->end(bx); ++itTau)
104  {
105  // use the full-circle conversion to match l1extra, accounts for linearLsb and max value automatically
106  //const uint16_t rankPt = jetScale->rank((uint16_t)itTau->hwPt());
107  //const double et = jetScale->et( rankPt ) ;
108 
109  // or use the emScale to get finer-grained et
110  const double et = itTau->hwPt() * emScale->linearLsb();
111 
112  const double eta = getPhysicalEta(itTau->hwEta());
113  const double phi = getPhysicalPhi(itTau->hwPhi());
115 
116  l1t::Tau *tau = new l1t::Tau(*p4, itTau->hwPt(),
117  itTau->hwEta(), itTau->hwPhi(),
118  itTau->hwQual());
119  new_taus->push_back(bx, *tau);
120 
121  }
122 
123  for(l1t::JetBxCollection::const_iterator itJet = old_jets->begin(bx);
124  itJet != old_jets->end(bx); ++itJet)
125  {
126  // use the full-circle conversion to match l1extra, accounts for linearLsb and max value automatically
127  //const uint16_t rankPt = jetScale->rank((uint16_t)itJet->hwPt());
128  //const double et = jetScale->et( rankPt ) ;
129 
130  // or use the emScale to get finer-grained et
131  const double et = itJet->hwPt() * emScale->linearLsb();
132 
133  const double eta = getPhysicalEta(itJet->hwEta());
134  const double phi = getPhysicalPhi(itJet->hwPhi());
136 
137  l1t::Jet *jet = new l1t::Jet(*p4, itJet->hwPt(),
138  itJet->hwEta(), itJet->hwPhi(),
139  itJet->hwQual());
140  new_jets->push_back(bx, *jet);
141 
142  }
143 
144  for(l1t::EtSumBxCollection::const_iterator itEtSum = old_etsums->begin(bx);
145  itEtSum != old_etsums->end(bx); ++itEtSum)
146  {
147  const double pt = itEtSum->hwPt() * emScale->linearLsb();
148  const double eta = getPhysicalEta(itEtSum->hwEta());
149  const double phi = getPhysicalPhi(itEtSum->hwPhi());
150  const l1t::EtSum::EtSumType sumType = itEtSum->getType();
151  //std::cout << "SumType: " << sumType << std::endl;
153 
154  l1t::EtSum *eg = new l1t::EtSum(*p4, sumType, itEtSum->hwPt(),
155  itEtSum->hwEta(), itEtSum->hwPhi(),
156  itEtSum->hwQual());
157  new_etsums->push_back(bx, *eg);
158 
159  }
160  }
161 
162  iEvent.put(new_egammas);
163  iEvent.put(new_taus);
164  iEvent.put(new_jets);
165  iEvent.put(new_etsums);
166 
167 }
edm::EDGetToken EtSumToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetToken TauToken_
Definition: Tau.h:13
T eta() const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
Definition: Jet.h:13
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
double p4[4]
Definition: TauolaWrapper.h:92
int hwPt() const
Definition: L1Candidate.cc:69
double getPhysicalPhi(int phiIndex)
const T & get() const
Definition: EventSetup.h:55
edm::EDGetToken EGammaToken_
edm::EDGetToken JetToken_
double getPhysicalEta(int etaIndex)
EtSumType
Definition: EtSum.h:17
std::vector< EGamma >::const_iterator const_iterator
Definition: BXVector.h:16
Definition: DDAxes.h:10

Member Data Documentation

edm::EDGetToken l1t::PhysicalEtAdder::EGammaToken_
private

Definition at line 58 of file PhysicalEtAdder.h.

Referenced by PhysicalEtAdder().

edm::EDGetToken l1t::PhysicalEtAdder::EtSumToken_
private

Definition at line 61 of file PhysicalEtAdder.h.

Referenced by PhysicalEtAdder().

edm::EDGetToken l1t::PhysicalEtAdder::JetToken_
private

Definition at line 60 of file PhysicalEtAdder.h.

Referenced by PhysicalEtAdder().

edm::EDGetToken l1t::PhysicalEtAdder::TauToken_
private

Definition at line 59 of file PhysicalEtAdder.h.

Referenced by PhysicalEtAdder().