CMS 3D CMS Logo

L1GctInternJetProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1GctInternJetProducer
4 // Class: L1GctInternJetProducer
5 //
8 //
9 // Original Author: Alex Tapper
10 //
11 //
12 
13 // system include files
14 #include <memory>
15 
16 // user include files
18 
21 
25 
27  : internalJetSource_(iConfig.getParameter<edm::InputTag>("internalJetSource")),
29  jetScaleToken_(esConsumes<L1CaloEtScale, L1JetEtScaleRcd>()),
30  centralBxOnly_(iConfig.getParameter<bool>("centralBxOnly")) {
31  using namespace l1extra;
32 
33  produces<L1JetParticleCollection>("Internal");
34 }
35 
37 
39  //std::cout << "ARGGHHH!" << std::endl;
40  using namespace edm;
41  using namespace l1extra;
42  using namespace std;
43 
44  unique_ptr<L1JetParticleCollection> internJetColl(new L1JetParticleCollection);
45 
47  const L1CaloGeometry* caloGeom = &(*caloGeomESH);
48 
50 
51  double etSumLSB = jetScale->linearLsb();
52  //std::cout << "Inside the Jet producer " << etSumLSB << std::endl;
53 
55  iEvent.getByLabel(internalJetSource_, hwIntJetCands);
56  //std::cout << "At leas Something is happening" <<std::endl;
57  if (!hwIntJetCands.isValid()) {
58  std::cout << "These aren't the Jets you're looking for" << std::endl;
59 
60  LogDebug("L1GctInternJetProducer") << "\nWarning: L1GctJetCandCollection with " << internalJetSource_
61  << "\nrequested in configuration, but not found in the event." << std::endl;
62 
63  } else {
64  //std::cout << "apparently the collection was found" <<std::endl;
65  L1GctInternJetDataCollection::const_iterator jetItr = hwIntJetCands->begin();
66  L1GctInternJetDataCollection::const_iterator jetEnd = hwIntJetCands->end();
67  int i;
68  for (i = 0; jetItr != jetEnd; ++jetItr, ++i) {
69  //std::cout << " JetS a plenty" <<std::endl;
70  if (!jetItr->empty() && (!centralBxOnly_ || jetItr->bx() == 0)) {
71  double et = (jetItr->oflow() ? (double)0xfff : (double)jetItr->et()) * etSumLSB + 1.e-6;
72 
73  //double et = 10.;
74  //std::cout << "jetET: " << jetItr->et() <<std::endl;
75  //std::cout << "ET was: " << et << std::endl;
76  double eta = caloGeom->etaBinCenter(jetItr->regionId());
77  double phi = caloGeom->emJetPhiBinCenter(jetItr->regionId());
78 
79  internJetColl->push_back(
81  }
82  }
83  }
84 
85  OrphanHandle<L1JetParticleCollection> internalJetHandle = iEvent.put(std::move(internJetColl), "Internal");
86 }
87 
89 
91 
92 //define this as a plug-in
Handle.h
L1JetParticleCollection
electrons_cff.bool
bool
Definition: electrons_cff.py:366
mps_fire.i
i
Definition: mps_fire.py:428
L1CaloGeometry::emJetPhiBinCenter
double emJetPhiBinCenter(unsigned int phiIndex) const
Definition: L1CaloGeometry.cc:224
L1GctInternJetProducer::L1GctInternJetProducer
L1GctInternJetProducer(const edm::ParameterSet &)
Definition: L1GctInternJetProducer.cc:26
ESHandle.h
L1GctInternJetProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: L1GctInternJetProducer.cc:38
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
L1GctInternJetProducer.h
edm::Handle
Definition: AssociativeIterator.h:50
L1GctInternJetProducer::endJob
void endJob() override
Definition: L1GctInternJetProducer.cc:90
edm::Ref< L1GctJetCandCollection >
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
PVValHelper::eta
Definition: PVValidationHelpers.h:70
OrphanHandle.h
L1JetEtScaleRcd
Definition: L1JetEtScaleRcd.h:30
edm::ESHandle
Definition: DTSurvey.h:22
L1CaloGeometryRecord
Definition: L1CaloGeometryRecord.h:30
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
L1CaloGeometry
Definition: L1CaloGeometry.h:33
L1GctInternJetProducer::centralBxOnly_
bool centralBxOnly_
Definition: L1GctInternJetProducer.h:52
L1GctInternJetProducer::~L1GctInternJetProducer
~L1GctInternJetProducer() override
Definition: L1GctInternJetProducer.cc:36
l1extra::L1JetParticle
Definition: L1JetParticle.h:28
L1GctInternJetProducer
Definition: L1GctInternJetProducer.h:34
iEvent
int iEvent
Definition: GenABIO.cc:224
L1CaloEtScale
Definition: L1CaloEtScale.h:29
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::EventSetup
Definition: EventSetup.h:58
L1GctInternJetProducer::internalJetSource_
edm::InputTag internalJetSource_
Definition: L1GctInternJetProducer.h:49
L1GctInternJetProducer::beginJob
void beginJob() override
Definition: L1GctInternJetProducer.cc:88
DDAxes::phi
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
edm::OrphanHandle
Definition: EDProductfwd.h:39
Frameworkfwd.h
L1GctInternJetProducer::caloGeomToken_
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > caloGeomToken_
Definition: L1GctInternJetProducer.h:50
wplusjetsAnalysis_cfi.jetScale
jetScale
Definition: wplusjetsAnalysis_cfi.py:88
L1GctInternJetProducer::jetScaleToken_
edm::ESGetToken< L1CaloEtScale, L1JetEtScaleRcd > jetScaleToken_
Definition: L1GctInternJetProducer.h:51
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
l1extra
Definition: L1EmParticle.h:26
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
L1CaloGeometry::etaBinCenter
double etaBinCenter(unsigned int etaIndex, bool central=true) const
Definition: L1CaloGeometry.cc:167
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37