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

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 ( )

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(), 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 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 34 of file L1TCaloRCTToUpgradeConverter.cc.

References emToken_, edm::Event::getByToken(), 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::auto_ptr<BXVector<CaloEmCand> > emcands (new CaloEmCandBxCollection);
42  std::auto_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->tauVeto();
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  //CaloRegion region;
105  CaloRegion region(*&p4,
106  0.,
107  0.,
108  (int) rgn->et(),
109  (int) rgn->id().ieta(),
110  (int) rgn->id().iphi(),
111  hwQual,
112  0,
113  0);
114 
115  // add to output
116  regions->push_back( rgn->bx(), region );
117 
118  }
119 
120  iEvent.put(emcands);
121  iEvent.put(regions);
122 
123 }
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
void setHwIso(int iso)
Definition: L1Candidate.cc:59

Member Data Documentation

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

Definition at line 68 of file L1TCaloRCTToUpgradeConverter.h.

Referenced by L1TCaloRCTToUpgradeConverter(), and produce().

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

Definition at line 67 of file L1TCaloRCTToUpgradeConverter.h.

Referenced by L1TCaloRCTToUpgradeConverter(), and produce().