CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
EmbeddingKineReweightNtupleProducer Class Reference

#include <EmbeddingKineReweightNtupleProducer.h>

Inheritance diagram for EmbeddingKineReweightNtupleProducer:
edm::EDAnalyzer edm::EDConsumerBase

Classes

struct  branchEntryType
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
void beginJob ()
 
 EmbeddingKineReweightNtupleProducer (const edm::ParameterSet &)
 
 ~EmbeddingKineReweightNtupleProducer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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 ()
 

Private Types

typedef std::map< std::string,
branchEntryType
branchMap
 
typedef std::vector
< edm::InputTag
vInputTag
 

Private Member Functions

void addBranch_EnPxPyPz (const std::string &)
 
void addBranch_MEtResProjections (const std::string &)
 
void addBranchF (const std::string &)
 
void addBranchI (const std::string &)
 
void printBranches (std::ostream &)
 
void setValue_EnPxPyPz (const std::string &, const reco::Candidate::LorentzVector &)
 
void setValue_MEtResProjections (const std::string &, const reco::Candidate::LorentzVector &, const reco::Candidate::LorentzVector &, const reco::Candidate::LorentzVector &)
 
void setValueF (const std::string &, double)
 
void setValueI (const std::string &, int)
 

Private Attributes

branchMap branches_
 
std::string moduleLabel_
 
TTree * ntuple_
 
edm::InputTag srcGenCaloMEt_
 
edm::InputTag srcGenDiTaus_
 
edm::InputTag srcGenFilterInfo_
 
edm::InputTag srcGenParticles_
 
edm::InputTag srcGenPFMEt_
 
edm::InputTag srcRecCaloMEt_
 
edm::InputTag srcRecJets_
 
edm::InputTag srcRecLeg1_
 
edm::InputTag srcRecLeg2_
 
edm::InputTag srcRecPFMEt_
 
edm::InputTag srcSelectedMuons_
 
vInputTag srcWeights_
 

Static Private Attributes

static int verbosity_ = 0
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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

Produce Ntuple for computing embeddingKineReweight LUTs

Author
Christian Veelken, LLR
Version
Revision:
1.2
Id:
EmbeddingKineReweightNtupleProducer.h,v 1.2 2013/04/17 07:11:37 veelken Exp

Definition at line 31 of file EmbeddingKineReweightNtupleProducer.h.

Member Typedef Documentation

typedef std::map<std::string, branchEntryType> EmbeddingKineReweightNtupleProducer::branchMap
private

Definition at line 82 of file EmbeddingKineReweightNtupleProducer.h.

Definition at line 72 of file EmbeddingKineReweightNtupleProducer.h.

Constructor & Destructor Documentation

EmbeddingKineReweightNtupleProducer::EmbeddingKineReweightNtupleProducer ( const edm::ParameterSet cfg)

Definition at line 28 of file EmbeddingKineReweightNtupleProducer.cc.

References edm::ParameterSet::getParameter(), srcGenCaloMEt_, srcGenDiTaus_, srcGenFilterInfo_, srcGenParticles_, srcGenPFMEt_, srcRecCaloMEt_, srcRecJets_, srcRecLeg1_, srcRecLeg2_, srcRecPFMEt_, srcSelectedMuons_, and srcWeights_.

29  : moduleLabel_(cfg.getParameter<std::string>("@module_label")),
30  ntuple_(0)
31 {
32  srcGenDiTaus_ = cfg.getParameter<edm::InputTag>("srcGenDiTaus");
33 
34  srcGenParticles_ = cfg.getParameter<edm::InputTag>("srcGenParticles");
35  srcSelectedMuons_ = cfg.getParameter<edm::InputTag>("srcSelectedMuons");
36 
37  srcRecLeg1_ = cfg.getParameter<edm::InputTag>("srcRecLeg1");
38  srcRecLeg2_ = cfg.getParameter<edm::InputTag>("srcRecLeg2");
39 
40  srcRecJets_ = cfg.getParameter<edm::InputTag>("srcRecJets");
41 
42  srcGenCaloMEt_ = cfg.getParameter<edm::InputTag>("srcGenCaloMEt");
43  srcRecCaloMEt_ = cfg.getParameter<edm::InputTag>("srcRecCaloMEt");
44  srcGenPFMEt_ = cfg.getParameter<edm::InputTag>("srcGenPFMEt");
45  srcRecPFMEt_ = cfg.getParameter<edm::InputTag>("srcRecPFMEt");
46 
47  srcWeights_ = cfg.getParameter<vInputTag>("srcWeights");
48  srcGenFilterInfo_ = cfg.getParameter<edm::InputTag>("srcGenFilterInfo");
49 }
T getParameter(std::string const &) const
EmbeddingKineReweightNtupleProducer::~EmbeddingKineReweightNtupleProducer ( )

Definition at line 51 of file EmbeddingKineReweightNtupleProducer.cc.

52 {
53 // nothing to be done yet...
54 }

Member Function Documentation

void EmbeddingKineReweightNtupleProducer::addBranch_EnPxPyPz ( const std::string &  name)
private
void EmbeddingKineReweightNtupleProducer::addBranch_MEtResProjections ( const std::string &  name)
private
void EmbeddingKineReweightNtupleProducer::addBranchF ( const std::string &  name)
private

Definition at line 302 of file EmbeddingKineReweightNtupleProducer.cc.

References branches_, mergeVDriftHistosByStation::name, ntuple_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addBranch_EnPxPyPz(), addBranch_MEtResProjections(), and beginJob().

303 {
304  //std::cout << "<EmbeddingKineReweightNtupleProducer::addBranchF>:" << std::endl;
305  //std::cout << " moduleLabel = " << moduleLabel_ << std::endl;
306  //std::cout << " branchName = " << name << std::endl;
307  assert(branches_.count(name) == 0);
308  std::string name_and_format = name + "/F";
309  ntuple_->Branch(name.c_str(), &branches_[name].valueF_, name_and_format.c_str());
310 }
void EmbeddingKineReweightNtupleProducer::addBranchI ( const std::string &  name)
private

Definition at line 312 of file EmbeddingKineReweightNtupleProducer.cc.

References branches_, mergeVDriftHistosByStation::name, ntuple_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addBranch_EnPxPyPz(), and beginJob().

313 {
314  //std::cout << "<EmbeddingKineReweightNtupleProducer::addBranchI>:" << std::endl;
315  //std::cout << " moduleLabel = " << moduleLabel_ << std::endl;
316  //std::cout << " branchName = " << name << std::endl;
317  assert(branches_.count(name) == 0);
318  std::string name_and_format = name + "/I";
319  ntuple_->Branch(name.c_str(), &branches_[name].valueI_, name_and_format.c_str());
320 }
void EmbeddingKineReweightNtupleProducer::analyze ( const edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 116 of file EmbeddingKineReweightNtupleProducer.cc.

References Abs(), reco::CompositeRefCandidateT< D >::begin(), branches_, dtNoiseDBValidation_cfg::cerr, reco::Candidate::charge(), reco::CompositeCandidate::daughter(), reco::CompositeRefCandidateT< D >::end(), genParticleCandidates2GenParticles_cfi::genParticles, edm::Event::getByLabel(), getSelMuons(), getTheMuMinus(), getTheMuPlus(), edm::RefToBase< T >::isNonnull(), edm::InputTag::label(), ntuple_, reco::CompositeCandidate::numberOfDaughters(), reco::Candidate::p4(), reco::LeafCandidate::p4(), setValue_EnPxPyPz(), setValue_MEtResProjections(), setValueF(), setValueI(), srcGenCaloMEt_, srcGenDiTaus_, srcGenFilterInfo_, srcGenParticles_, srcGenPFMEt_, srcRecCaloMEt_, srcRecJets_, srcRecLeg1_, srcRecLeg2_, srcRecPFMEt_, srcSelectedMuons_, srcWeights_, AlCaHLTBitMon_QueryRunRegistry::string, and histoStyle::weight.

117 {
118 //--- reset all branches
119  for ( branchMap::iterator branch = branches_.begin();
120  branch != branches_.end(); ++branch ) {
121  branch->second.valueF_ = 0.;
122  branch->second.valueI_ = 0;
123  }
124 
125 //--- set branches containing generator level Z->tautau information
126  const reco::Candidate* genDiTau_ref = 0;
127  if ( srcGenDiTaus_.label() != "" ) {
128  edm::Handle<CandidateView> genDiTaus;
129  evt.getByLabel(srcGenDiTaus_, genDiTaus);
130 
131  for ( CandidateView::const_iterator genDiTau = genDiTaus->begin();
132  genDiTau != genDiTaus->end(); ++genDiTau ) {
133  const reco::CompositeCandidate* genDiTau_composite = dynamic_cast<const reco::CompositeCandidate*>(&(*genDiTau));
134  if ( !(genDiTau_composite && genDiTau_composite->numberOfDaughters() == 2) ) {
135  std::cerr << "genDiTau has " << genDiTau_composite->numberOfDaughters() << " daughters --> skipping !!" << std::endl;
136  continue;
137  }
138 
139  const reco::Candidate* genTau1 = genDiTau_composite->daughter(0);
140  const reco::Candidate* genTau2 = genDiTau_composite->daughter(1);
141  if ( !(genTau1 && genTau2) ) {
142  std::cerr << "Failed to find daughters of genDiTau --> skipping !!" << std::endl;
143  continue;
144  }
145  const reco::Candidate* genTauPlus = 0;
146  const reco::Candidate* genTauMinus = 0;
147  if ( genTau1->charge() > +0.5 && genTau2->charge() < -0.5 ) {
148  genTauPlus = genTau1;
149  genTauMinus = genTau2;
150  } else if ( genTau1->charge() < -0.5 && genTau2->charge() > +0.5 ) {
151  genTauPlus = genTau2;
152  genTauMinus = genTau1;
153  } else {
154  std::cerr << "Failed to find daughters of genDiTau --> skipping !!" << std::endl;
155  continue;
156  }
157 
158  setValue_EnPxPyPz("genDiTau", genDiTau->p4());
159  setValue_EnPxPyPz("genTauPlus", genTauPlus->p4());
160  setValue_EnPxPyPz("genTauMinus", genTauMinus->p4());
161  genDiTau_ref = &(*genDiTau);
162  }
163  }
164 
165  if ( !genDiTau_ref ) {
166  std::cerr << "Failed to find genDiTau --> skipping !!" << std::endl;
167  return;
168  }
169 
170 //--- set branches containing generator level Z->mumu information
171  if ( srcGenParticles_.label() != "" ) {
173  evt.getByLabel(srcGenParticles_, genParticles);
174 
175  for ( reco::GenParticleCollection::const_iterator genParticle = genParticles->begin();
176  genParticle != genParticles->end(); ++genParticle ) {
177  if ( TMath::Abs(genParticle->pdgId()) == 23 ) {
178  std::vector<const reco::GenParticle*> daughters;
179  findDaughters(&(*genParticle), daughters, -1);
180  const reco::GenParticle* genMuPlus = 0;
181  const reco::GenParticle* genMuMinus = 0;
182  for ( std::vector<const reco::GenParticle*>::const_iterator daughter = daughters.begin();
183  daughter != daughters.end(); ++daughter ) {
184  if ( (*daughter)->pdgId() == -13 ) genMuPlus = (*daughter);
185  if ( (*daughter)->pdgId() == +13 ) genMuMinus = (*daughter);
186  }
187  if ( genMuPlus && genMuMinus ) {
188  setValue_EnPxPyPz("genDiMuon", genParticle->p4());
189  setValue_EnPxPyPz("genMuonPlus", genMuPlus->p4());
190  setValue_EnPxPyPz("genMuonMinus", genMuMinus->p4());
191 
192 //--- set branches containing information on reconstructed Z->mumu decays
193  if ( srcSelectedMuons_.label() != "" ) {
194  std::vector<reco::CandidateBaseRef> selMuons = getSelMuons(evt, srcSelectedMuons_);
195  const reco::CandidateBaseRef recMuPlus = getTheMuPlus(selMuons);
196  const reco::CandidateBaseRef recMuMinus = getTheMuMinus(selMuons);
197  if ( recMuPlus.isNonnull() && recMuMinus.isNonnull() ) {
198  setValue_EnPxPyPz("recDiMuon", recMuPlus->p4() + recMuMinus->p4());
199  setValue_EnPxPyPz("recMuonPlus", recMuPlus->p4());
200  setValue_EnPxPyPz("recMuonMinus", recMuMinus->p4());
201  }
202  }
203  }
204  }
205  }
206  }
207 
209  evt.getByLabel(srcRecLeg1_, recLeg1);
210  if ( recLeg1->size() >= 1 ) {
211  setValue_EnPxPyPz("recLeg1", recLeg1->at(0).p4());
212  }
214  evt.getByLabel(srcRecLeg2_, recLeg2);
215  if ( srcRecLeg2_ == srcRecLeg1_ && recLeg2->size() >= 2 ) {
216  setValue_EnPxPyPz("recLeg2", recLeg1->at(1).p4());
217  } else if ( recLeg2->size() >= 1 ) {
218  setValue_EnPxPyPz("recLeg2", recLeg2->at(0).p4());
219  }
220 
222  evt.getByLabel(srcRecJets_, recJets);
223  int numJetsRawPtGt20 = 0;
224  int numJetsCorrPtGt20 = 0;
225  int numJetsRawPtGt30 = 0;
226  int numJetsCorrPtGt30 = 0;
227  for ( pat::JetCollection::const_iterator recJet = recJets->begin();
228  recJet != recJets->end(); ++recJet ) {
229 
230  reco::Candidate::LorentzVector rawJetP4 = recJet->correctedP4("Uncorrected");
231  double rawJetPt = rawJetP4.pt();
232  double rawJetAbsEta = TMath::Abs(rawJetP4.eta());
233  if ( rawJetAbsEta < 4.5 ) {
234  if ( rawJetPt > 20. ) ++numJetsRawPtGt20;
235  if ( rawJetPt > 30. ) ++numJetsRawPtGt30;
236  }
237 
238  reco::Candidate::LorentzVector corrJetP4 = recJet->p4();
239  double corrJetPt = corrJetP4.pt();
240  double corrJetAbsEta = TMath::Abs(corrJetP4.eta());
241  if ( corrJetAbsEta < 4.5 ) {
242  if ( corrJetPt > 20. ) ++numJetsCorrPtGt20;
243  if ( corrJetPt > 30. ) ++numJetsCorrPtGt30;
244  }
245  }
246  setValueI("numJetsRawPtGt20", numJetsRawPtGt20);
247  setValueI("numJetsCorrPtGt20", numJetsCorrPtGt20);
248  setValueI("numJetsRawPtGt30", numJetsRawPtGt30);
249  setValueI("numJetsCorrPtGt30", numJetsCorrPtGt30);
250 
251  if ( genDiTau_ref ) {
252  edm::Handle<METView> genCaloMET;
253  evt.getByLabel(srcGenCaloMEt_, genCaloMET);
254  const reco::Candidate::LorentzVector& genCaloMEtP4 = genCaloMET->front().p4();
255  setValue_EnPxPyPz("genCaloMEt", genCaloMEtP4);
256  edm::Handle<METView> recCaloMET;
257  evt.getByLabel(srcRecCaloMEt_, recCaloMET);
258  const reco::Candidate::LorentzVector& recCaloMEtP4 = recCaloMET->front().p4();
259  //std::cout << "<EmbeddingKineReweightNtupleProducer>:" << std::endl;
260  //std::cout << " recCaloMEt(" << srcRecCaloMEt_.label() << "): Pt = " << recCaloMEtP4.pt() << ", phi = " << recCaloMEtP4.phi()
261  // << " (Px = " << recCaloMEtP4.px() << ", Py = " << recCaloMEtP4.py() << ")" << std::endl;
262  setValue_EnPxPyPz("recCaloMEt", recCaloMEtP4);
263  setValue_MEtResProjections("recMinusGenCaloMEt", genCaloMEtP4, recCaloMEtP4, genDiTau_ref->p4());
264 
265  edm::Handle<METView> genPFMET;
266  evt.getByLabel(srcGenPFMEt_, genPFMET);
267  const reco::Candidate::LorentzVector& genPFMEtP4 = genPFMET->front().p4();
268  setValue_EnPxPyPz("genPFMEt", genPFMEtP4);
269  edm::Handle<METView> recPFMET;
270  evt.getByLabel(srcRecPFMEt_, recPFMET);
271  const reco::Candidate::LorentzVector& recPFMEtP4 = recPFMET->front().p4();
272  setValue_EnPxPyPz("recPFMEt", recPFMEtP4);
273  setValue_MEtResProjections("recMinusGenPFMEt", genPFMEtP4, recPFMEtP4, genDiTau_ref->p4());
274  }
275 
276 //--- set branches containing event weight information
277  for ( vInputTag::const_iterator srcWeight = srcWeights_.begin();
278  srcWeight != srcWeights_.end(); ++srcWeight ) {
280  evt.getByLabel(*srcWeight, weight);
281  std::string branchName = Form("%s_%s", srcWeight->label().data(), srcWeight->instance().data());
282  setValueF(branchName.data(), *weight);
283  }
284  if ( srcGenFilterInfo_.label() != "" ) {
285  edm::Handle<GenFilterInfo> genFilterInfo;
286  evt.getByLabel(srcGenFilterInfo_, genFilterInfo);
287  double genFilterInfo_weight = 1.;
288  bool genFilterInfo_isValid = false;
289  if ( genFilterInfo->numEventsTried() > 0 ) {
290  genFilterInfo_weight = genFilterInfo->filterEfficiency();
291  genFilterInfo_isValid = true;
292  }
293  setValueF("genFilterInfo", genFilterInfo_weight);
294  setValueI("genFilterInfoIsValid", genFilterInfo_isValid);
295  }
296 
297 //--- finally, fill all computed quantities into TTree
298  assert(ntuple_);
299  ntuple_->Fill();
300 }
reco::CandidateBaseRef getTheMuMinus(const std::vector< reco::CandidateBaseRef > &)
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:280
virtual size_type numberOfDaughters() const
number of daughters
T Abs(T a)
Definition: MathUtil.h:49
virtual int charge() const =0
electric charge
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
void setValue_EnPxPyPz(const std::string &, const reco::Candidate::LorentzVector &)
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
std::string const & label() const
Definition: InputTag.h:42
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
std::vector< reco::CandidateBaseRef > getSelMuons(const edm::Event &, const edm::InputTag &)
int weight
Definition: histoStyle.py:50
reco::CandidateBaseRef getTheMuPlus(const std::vector< reco::CandidateBaseRef > &)
void setValue_MEtResProjections(const std::string &, const reco::Candidate::LorentzVector &, const reco::Candidate::LorentzVector &, const reco::Candidate::LorentzVector &)
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
void EmbeddingKineReweightNtupleProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 56 of file EmbeddingKineReweightNtupleProducer.cc.

References addBranch_EnPxPyPz(), addBranch_MEtResProjections(), addBranchF(), addBranchI(), edm::InputTag::label(), TFileService::make(), ntuple_, srcGenFilterInfo_, srcWeights_, and AlCaHLTBitMon_QueryRunRegistry::string.

57 {
58 //--- create TTree
60  ntuple_ = fs->make<TTree>("embeddingKineReweightNtuple", "embeddingKineReweightNtuple");
61 
62 //--- add branches storing quantities for computing embeddingKineReweight LUTs
63 // 1.) for embeddingKineReweightGENtoEmbedded:
64  addBranch_EnPxPyPz("genDiTau");
65  addBranch_EnPxPyPz("genTau1");
66  addBranch_EnPxPyPz("genTau2");
67 // 2.) for embeddingKineReweightGENtoREC:
68  addBranch_EnPxPyPz("genDiMuon");
69  addBranch_EnPxPyPz("genMuonPlus");
70  addBranch_EnPxPyPz("genMuonMinus");
71  addBranch_EnPxPyPz("recDiMuon");
72  addBranch_EnPxPyPz("recMuonPlus");
73  addBranch_EnPxPyPz("recMuonMinus");
74 
75  addBranch_EnPxPyPz("recLeg1");
76  addBranch_EnPxPyPz("recLeg2");
77 
78  addBranchI("numJetsRawPtGt20");
79  addBranchI("numJetsCorrPtGt20");
80  addBranchI("numJetsRawPtGt30");
81  addBranchI("numJetsCorrPtGt30");
82 
83  addBranch_EnPxPyPz("genCaloMEt");
84  addBranch_EnPxPyPz("recCaloMEt");
85  addBranch_MEtResProjections("recMinusGenCaloMEt");
86  addBranch_EnPxPyPz("genPFMEt");
87  addBranch_EnPxPyPz("recPFMEt");
88  addBranch_MEtResProjections("recMinusGenPFMEt");
89 
90  for ( vInputTag::const_iterator srcWeight = srcWeights_.begin();
91  srcWeight != srcWeights_.end(); ++srcWeight ) {
92  std::string branchName = Form("%s_%s", srcWeight->label().data(), srcWeight->instance().data());
93  addBranchF(branchName.data());
94  }
95  if ( srcGenFilterInfo_.label() != "" ) {
96  addBranchF("genFilterInfo");
97  addBranchI("genFilterInfoIsValid");
98  }
99 }
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::string const & label() const
Definition: InputTag.h:42
void EmbeddingKineReweightNtupleProducer::printBranches ( std::ostream &  stream)
private

Definition at line 322 of file EmbeddingKineReweightNtupleProducer.cc.

References branches_, and moduleLabel_.

323 {
324  stream << "<EmbeddingKineReweightNtupleProducer::printBranches>:" << std::endl;
325  stream << " registered branches for module = " << moduleLabel_ << std::endl;
326  for ( branchMap::const_iterator branch = branches_.begin();
327  branch != branches_.end(); ++branch ) {
328  stream << " " << branch->first << std::endl;
329  }
330  stream << std::endl;
331 }
void EmbeddingKineReweightNtupleProducer::setValue_EnPxPyPz ( const std::string &  name,
const reco::Candidate::LorentzVector p4 
)
private
void EmbeddingKineReweightNtupleProducer::setValue_MEtResProjections ( const std::string &  name,
const reco::Candidate::LorentzVector genMEtP4,
const reco::Candidate::LorentzVector recMEtP4,
const reco::Candidate::LorentzVector zP4 
)
private

Definition at line 397 of file EmbeddingKineReweightNtupleProducer.cc.

References python.multivaluedict::append(), setValueF(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

400 {
401  if ( zP4.pt() > 0. ) {
402  double qX = zP4.px();
403  double qY = zP4.py();
404  double qT = TMath::Sqrt(qX*qX + qY*qY);
405  double dX = recMEtP4.px() - genMEtP4.px();
406  double dY = recMEtP4.py() - genMEtP4.py();
407  double dParl = (dX*qX + dY*qY)/qT;
408  double dPerp = (dX*qY - dY*qX)/qT;
409  setValueF(std::string(name).append("ParlZ"), dParl);
410  setValueF(std::string(name).append("PerpZ"), dPerp);
411  }
412 }
void EmbeddingKineReweightNtupleProducer::setValueF ( const std::string &  name,
double  value 
)
private

Definition at line 333 of file EmbeddingKineReweightNtupleProducer.cc.

References branches_, gather_cfg::cout, edm::hlt::Exception, relativeConstraints::value, and verbosity_.

Referenced by analyze(), setValue_EnPxPyPz(), and setValue_MEtResProjections().

334 {
335  if ( verbosity_ ) std::cout << "branch = " << name << ": value = " << value << std::endl;
336  branchMap::iterator branch = branches_.find(name);
337  if ( branch != branches_.end() ) {
338  branch->second.valueF_ = value;
339  } else {
340  throw cms::Exception("InvalidParameter")
341  << "No branch with name = " << name << " defined !!\n";
342  }
343 }
tuple cout
Definition: gather_cfg.py:121
void EmbeddingKineReweightNtupleProducer::setValueI ( const std::string &  name,
int  value 
)
private

Definition at line 345 of file EmbeddingKineReweightNtupleProducer.cc.

References branches_, gather_cfg::cout, edm::hlt::Exception, relativeConstraints::value, and verbosity_.

Referenced by analyze(), and setValue_EnPxPyPz().

346 {
347  if ( verbosity_ ) std::cout << "branch = " << name << ": value = " << value << std::endl;
348  branchMap::iterator branch = branches_.find(name);
349  if ( branch != branches_.end() ) {
350  branch->second.valueI_ = value;
351  } else {
352  throw cms::Exception("InvalidParameter")
353  << "No branch with name = " << name << " defined !!\n";
354  }
355 }
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

branchMap EmbeddingKineReweightNtupleProducer::branches_
private
std::string EmbeddingKineReweightNtupleProducer::moduleLabel_
private
TTree* EmbeddingKineReweightNtupleProducer::ntuple_
private

Definition at line 85 of file EmbeddingKineReweightNtupleProducer.h.

Referenced by addBranchF(), addBranchI(), analyze(), and beginJob().

edm::InputTag EmbeddingKineReweightNtupleProducer::srcGenCaloMEt_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcGenDiTaus_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcGenFilterInfo_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcGenParticles_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcGenPFMEt_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcRecCaloMEt_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcRecJets_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcRecLeg1_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcRecLeg2_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcRecPFMEt_
private
edm::InputTag EmbeddingKineReweightNtupleProducer::srcSelectedMuons_
private
vInputTag EmbeddingKineReweightNtupleProducer::srcWeights_
private
int EmbeddingKineReweightNtupleProducer::verbosity_ = 0
staticprivate

Definition at line 87 of file EmbeddingKineReweightNtupleProducer.h.

Referenced by setValueF(), and setValueI().