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 18 of file L1TCaloRCTToUpgradeConverter.cc.

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

18  {
19 
20  produces<l1t::CaloRegionBxCollection>();
21  produces<l1t::CaloEmCandBxCollection>();
22 
23  rgnToken_ = consumes<L1CaloRegionCollection>(ps.getParameter<edm::InputTag>("regionTag"));
24  emToken_ = consumes<L1CaloEmCollection>(ps.getParameter<edm::InputTag>("emTag"));
25 
26  // firstBx_ = -ps.getParameter<unsigned>("preSamples");
27  // lastBx_ = ps.getParameter<unsigned>("postSamples");
28 
29 }
T getParameter(std::string const &) const
l1t::L1TCaloRCTToUpgradeConverter::~L1TCaloRCTToUpgradeConverter ( )

Definition at line 31 of file L1TCaloRCTToUpgradeConverter.cc.

31  {
32 
33 }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 126 of file L1TCaloRCTToUpgradeConverter.cc.

127 {
128 }
void l1t::L1TCaloRCTToUpgradeConverter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 132 of file L1TCaloRCTToUpgradeConverter.cc.

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

Definition at line 171 of file L1TCaloRCTToUpgradeConverter.cc.

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

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

Implements edm::EDProducer.

Definition at line 37 of file L1TCaloRCTToUpgradeConverter.cc.

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

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