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 Attributes
HLTMhtProducer Class Reference

#include <HLTMhtProducer.h>

Inheritance diagram for HLTMhtProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTMhtProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HLTMhtProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) 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 Attributes

double etaJet_
 
edm::InputTag inputJetTag_
 
double minPtJet_
 
bool usePt_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- 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

Author
Gheorghe Lungu

Definition at line 19 of file HLTMhtProducer.h.

Constructor & Destructor Documentation

HLTMhtProducer::HLTMhtProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 30 of file HLTMhtProducer.cc.

References etaJet_, edm::ParameterSet::getParameter(), inputJetTag_, minPtJet_, and usePt_.

31 {
32  inputJetTag_ = iConfig.getParameter< edm::InputTag > ("inputJetTag");
33  minPtJet_= iConfig.getParameter<double> ("minPtJet");
34  etaJet_= iConfig.getParameter<double> ("etaJet");
35  usePt_= iConfig.getParameter<bool>("usePt");
36 
37  //register your products
38  produces<reco::METCollection>();
39 }
T getParameter(std::string const &) const
edm::InputTag inputJetTag_
HLTMhtProducer::~HLTMhtProducer ( )

Definition at line 41 of file HLTMhtProducer.cc.

41 {}

Member Function Documentation

void HLTMhtProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 43 of file HLTMhtProducer.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

43  {
45  desc.add<edm::InputTag>("inputJetTag",edm::InputTag("hltMCJetCorJetIcone5HF07"));
46  desc.add<double>("minPtJet",20.0);
47  desc.add<double>("etaJet",9999.0);
48  desc.add<bool>("usePt",true);
49  descriptions.add("hltMhtProducer",desc);
50 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTMhtProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 54 of file HLTMhtProducer.cc.

References abs, funct::cos(), etaJet_, edm::Event::getByLabel(), inputJetTag_, metsig::jet, fwrapper::jets, minPtJet_, edm::Event::put(), L1Trigger_dataformats::reco, query::result, funct::sin(), mathSSE::sqrt(), and usePt_.

55 {
56  using namespace std;
57  using namespace edm;
58  using namespace reco;
59 
60  auto_ptr<reco::METCollection> result (new reco::METCollection);
61 
62  math::XYZPoint vtx(0,0,0);
63 
64  //Handle<CaloJetCollection> recocalojets;
67 
68  // look at all candidates, check cuts and add to result object
69  double mhtx=0., mhty=0., mht;
70  double jetVar;
71 
72  if(jets->size() > 0){
73  // events with at least one jet
74  //for (CaloJetCollection::const_iterator jet = jets->begin(); jet != jets->end(); jet++) {
75  for(edm::View<reco::Jet>::const_iterator jet = jets->begin(); jet != jets->end(); jet++ ) {
76  jetVar = jet->pt();
77  if (!usePt_) jetVar = jet->et();
78 
79  //---get MHT
80  if (jetVar > minPtJet_ && std::abs(jet->eta()) < etaJet_) {
81  mhtx -= jetVar*cos(jet->phi());
82  mhty -= jetVar*sin(jet->phi());
83  }
84  }
85  mht = sqrt(mhtx*mhtx + mhty*mhty);
86 
87  math::XYZTLorentzVector mhtVec(mhtx,mhty,0,mht);
88  reco::MET mhtobj(mhtVec,vtx);
89  result->push_back( mhtobj );
90 
91  } // events with at least one jet
92 
93 
94  // put object into the Event
95  iEvent.put(result);
96 
97 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define abs(x)
Definition: mlp_lapack.h:159
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:23
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
edm::InputTag inputJetTag_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
Definition: MET.h:32
T sqrt(T t)
Definition: SSEVec.h:48
vector< PseudoJet > jets
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13

Member Data Documentation

double HLTMhtProducer::etaJet_
private

Definition at line 30 of file HLTMhtProducer.h.

Referenced by HLTMhtProducer(), and produce().

edm::InputTag HLTMhtProducer::inputJetTag_
private

Definition at line 28 of file HLTMhtProducer.h.

Referenced by HLTMhtProducer(), and produce().

double HLTMhtProducer::minPtJet_
private

Definition at line 29 of file HLTMhtProducer.h.

Referenced by HLTMhtProducer(), and produce().

bool HLTMhtProducer::usePt_
private

Definition at line 31 of file HLTMhtProducer.h.

Referenced by HLTMhtProducer(), and produce().