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::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 ()
 
- 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 emToken_
 
edm::EDGetToken rgnToken_
 

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 48 of file L1TCaloRCTToUpgradeConverter.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file L1TCaloRCTToUpgradeConverter.cc.

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

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

Definition at line 25 of file L1TCaloRCTToUpgradeConverter.cc.

25  {
26 
27 }

Member Function Documentation

void l1t::L1TCaloRCTToUpgradeConverter::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 121 of file L1TCaloRCTToUpgradeConverter.cc.

122 {
123 }
void l1t::L1TCaloRCTToUpgradeConverter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 127 of file L1TCaloRCTToUpgradeConverter.cc.

127  {
128 }
void l1t::L1TCaloRCTToUpgradeConverter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 166 of file L1TCaloRCTToUpgradeConverter.cc.

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

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

Implements edm::EDProducer.

Definition at line 31 of file L1TCaloRCTToUpgradeConverter.cc.

References edm::Event::getByToken(), p4, and edm::Event::put().

32 {
33 
34  // check status of RCT conditions & renew if needed
35 
36 
37  // store new formats
38  std::auto_ptr<BXVector<l1t::CaloEmCand> > emcands (new l1t::CaloEmCandBxCollection);
39  std::auto_ptr<BXVector<l1t::CaloRegion> > regions (new l1t::CaloRegionBxCollection);
40 
41  // get old formats
44 
45  iEvent.getByToken(emToken_, ems);
46  iEvent.getByToken(rgnToken_, rgns);
47 
48  // get the firstBx_ and lastBx_ from the input datatypes (assume bx for em same as rgn)
49  int firstBx = 0;
50  int lastBx = 0;
51  for (std::vector<L1CaloEmCand>::const_iterator em=ems->begin(); em!=ems->end(); ++em) {
52  int bx = em->bx();
53  if (bx < firstBx) firstBx = bx;
54  if (bx > lastBx) lastBx = bx;
55  }
56 
57  emcands->setBXRange(firstBx, lastBx);
58  regions->setBXRange(firstBx, lastBx);
59 
60  // loop over EM
61  for (std::vector<L1CaloEmCand>::const_iterator em=ems->begin(); em!=ems->end(); ++em) {
62 
63  // get physical units
64  // double pt = 0.;
65  // double eta = 0.;
66  // double phi = 0.;
67  //math::PtEtaPhiMLorentzVector p4( pt+1.e-6, eta, phi, 0. );
68  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > p4(0,0,0,0);
69 
70  //l1t::CaloStage1Cluster cluster;
71  l1t::CaloEmCand EmCand(*&p4,
72  (int) em->rank(),
73  (int) em->regionId().ieta(),
74  (int) em->regionId().iphi(),
75  0);
76 
77  // create new format
78  emcands->push_back( em->bx(), EmCand );
79 
80  }
81 
82  // loop over regions
83  for (std::vector<L1CaloRegion>::const_iterator rgn=rgns->begin(); rgn!=rgns->end(); ++rgn) {
84 
85  // get physical units
86  // double pt = 0.;
87  // double eta = 0.;
88  // double phi = 0.;
89  //math::PtEtaPhiMLorentzVector p4( pt+1.e-6, eta, phi, 0 );
90 
91  bool tauVeto = rgn->tauVeto();
92  int hwQual = (int) tauVeto;
93 
94  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > p4(0,0,0,0);
95 
96 
97  // create new format
98  //l1t::CaloRegion region;
99  l1t::CaloRegion region(*&p4,
100  0.,
101  0.,
102  (int) rgn->et(),
103  (int) rgn->id().ieta(),
104  (int) rgn->id().iphi(),
105  hwQual,
106  0,
107  0);
108 
109  // add to output
110  regions->push_back( rgn->bx(), region );
111 
112  }
113 
114  iEvent.put(emcands);
115  iEvent.put(regions);
116 
117 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
double p4[4]
Definition: TauolaWrapper.h:92

Member Data Documentation

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

Definition at line 68 of file L1TCaloRCTToUpgradeConverter.h.

Referenced by L1TCaloRCTToUpgradeConverter().

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

Definition at line 67 of file L1TCaloRCTToUpgradeConverter.h.

Referenced by L1TCaloRCTToUpgradeConverter().