CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
l1t::L1TCaloRCTToUpgradeConverter Class Reference

#include <L1TCaloRCTToUpgradeConverter.h>

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

Public Member Functions

 L1TCaloRCTToUpgradeConverter (const edm::ParameterSet &ps)
 
 ~L1TCaloRCTToUpgradeConverter () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

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

Private Attributes

edm::EDGetToken emToken_
 
edm::EDGetToken rgnToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 47 of file L1TCaloRCTToUpgradeConverter.h.

Constructor & Destructor Documentation

L1TCaloRCTToUpgradeConverter::L1TCaloRCTToUpgradeConverter ( const edm::ParameterSet ps)
explicit

Definition at line 19 of file L1TCaloRCTToUpgradeConverter.cc.

References emToken_, edm::ParameterSet::getParameter(), and rgnToken_.

19  {
20 
21  produces<CaloRegionBxCollection>();
22  produces<CaloEmCandBxCollection>();
23 
24  rgnToken_ = consumes<L1CaloRegionCollection>(ps.getParameter<edm::InputTag>("regionTag"));
25  emToken_ = consumes<L1CaloEmCollection>(ps.getParameter<edm::InputTag>("emTag"));
26 }
T getParameter(std::string const &) const
L1TCaloRCTToUpgradeConverter::~L1TCaloRCTToUpgradeConverter ( )
override

Definition at line 28 of file L1TCaloRCTToUpgradeConverter.cc.

28  {
29 
30 }

Member Function Documentation

void L1TCaloRCTToUpgradeConverter::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 127 of file L1TCaloRCTToUpgradeConverter.cc.

128 {
129 }
void L1TCaloRCTToUpgradeConverter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 133 of file L1TCaloRCTToUpgradeConverter.cc.

133  {
134 }
void L1TCaloRCTToUpgradeConverter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 172 of file L1TCaloRCTToUpgradeConverter.cc.

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

172  {
173  //The following says we do not know what parameters are allowed so do no validation
174  // Please change this to state exactly what you do use, even if it is no parameters
176  desc.setUnknown();
177  descriptions.addDefault(desc);
178 }
void addDefault(ParameterSetDescription const &psetDescription)
void L1TCaloRCTToUpgradeConverter::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 34 of file L1TCaloRCTToUpgradeConverter.cc.

References emToken_, edm::Event::getByToken(), createfilelist::int, eostools::move(), p4, edm::Event::put(), rgnToken_, and l1t::L1Candidate::setHwIso().

35 {
36 
37  // check status of RCT conditions & renew if needed
38 
39 
40  // store new formats
41  std::unique_ptr<BXVector<CaloEmCand> > emcands (new CaloEmCandBxCollection);
42  std::unique_ptr<BXVector<CaloRegion> > regions (new CaloRegionBxCollection);
43 
44  // get old formats
47 
48  iEvent.getByToken(emToken_, ems);
49  iEvent.getByToken(rgnToken_, rgns);
50 
51  // get the firstBx_ and lastBx_ from the input datatypes (assume bx for em same as rgn)
52  int firstBx = 0;
53  int lastBx = 0;
54  for (std::vector<L1CaloEmCand>::const_iterator em=ems->begin(); em!=ems->end(); ++em) {
55  int bx = em->bx();
56  if (bx < firstBx) firstBx = bx;
57  if (bx > lastBx) lastBx = bx;
58  }
59 
60  emcands->setBXRange(firstBx, lastBx);
61  regions->setBXRange(firstBx, lastBx);
62 
63  // loop over EM
64  for (std::vector<L1CaloEmCand>::const_iterator em=ems->begin(); em!=ems->end(); ++em) {
65 
66  // get physical units
67  // double pt = 0.;
68  // double eta = 0.;
69  // double phi = 0.;
70  //math::PtEtaPhiMLorentzVector p4( pt+1.e-6, eta, phi, 0. );
71  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > p4(0,0,0,0);
72 
73  //CaloStage1Cluster cluster;
74  CaloEmCand EmCand(*&p4,
75  (int) em->rank(),
76  (int) em->regionId().ieta(),
77  (int) em->regionId().iphi(),
78  (int) em->index());
79 
80  EmCand.setHwIso((int) em->isolated());
81  //std::cout<<"ISO: "<<EmCand.hwIso()<<" "<<em->isolated()<<std::endl;
82 
83  // create new format
84  emcands->push_back( em->bx(), EmCand );
85 
86  }
87 
88  // loop over regions
89  for (std::vector<L1CaloRegion>::const_iterator rgn=rgns->begin(); rgn!=rgns->end(); ++rgn) {
90 
91  // get physical units
92  // double pt = 0.;
93  // double eta = 0.;
94  // double phi = 0.;
95  //math::PtEtaPhiMLorentzVector p4( pt+1.e-6, eta, phi, 0 );
96 
97  bool tauVeto = rgn->fineGrain(); //equivalent to tauVeto for HB/HE, includes extra info for HF
98  int hwQual = (int) tauVeto;
99 
100  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > p4(0,0,0,0);
101 
102 
103  // create new format
104  // several values here are stage 2 only, leave empty
105  CaloRegion region(*&p4, // LorentzVector& p4,
106  0., // etEm,
107  0., // etHad,
108  (int) rgn->et(), // pt,
109  (int) rgn->id().ieta(), // eta,
110  (int) rgn->id().iphi(), // phi,
111  hwQual, // qual,
112  0, // hwEtEm,
113  0); // hwEtHad
114 
115  // add to output
116  regions->push_back( rgn->bx(), region );
117 
118  }
119 
120  iEvent.put(std::move(emcands));
121  iEvent.put(std::move(regions));
122 
123 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
double p4[4]
Definition: TauolaWrapper.h:92
void setHwIso(int iso)
Definition: L1Candidate.h:45
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetToken l1t::L1TCaloRCTToUpgradeConverter::emToken_
private

Definition at line 67 of file L1TCaloRCTToUpgradeConverter.h.

Referenced by L1TCaloRCTToUpgradeConverter(), and produce().

edm::EDGetToken l1t::L1TCaloRCTToUpgradeConverter::rgnToken_
private

Definition at line 66 of file L1TCaloRCTToUpgradeConverter.h.

Referenced by L1TCaloRCTToUpgradeConverter(), and produce().