CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
BiasedTauDecayer Class Reference

#include <BiasedTauDecayer.h>

Inheritance diagram for BiasedTauDecayer:

Public Member Functions

 BiasedTauDecayer (Pythia8::Info *infoPtr, Pythia8::Settings *settingsPtr, Pythia8::ParticleData *particleDataPtr, Pythia8::Rndm *rndmPtr, Pythia8::Couplings *couplingsPtr)
 
bool decay (std::vector< int > &idProd, std::vector< double > &mProd, std::vector< Pythia8::Vec4 > &pProd, int iDec, const Pythia8::Event &event) override
 

Private Attributes

Pythia8::TauDecays decayer
 
bool eMuDecays_
 
bool filter_
 
std::vector< int > idProdSave
 
std::vector< double > mProdSave
 
std::vector< Pythia8::Vec4pProdSave
 

Detailed Description

Definition at line 9 of file BiasedTauDecayer.h.

Constructor & Destructor Documentation

◆ BiasedTauDecayer()

BiasedTauDecayer::BiasedTauDecayer ( Pythia8::Info *  infoPtr,
Pythia8::Settings *  settingsPtr,
Pythia8::ParticleData particleDataPtr,
Pythia8::Rndm *  rndmPtr,
Pythia8::Couplings *  couplingsPtr 
)

Definition at line 11 of file BiasedTauDecayer.cc.

12  {
13  decayer = TauDecays();
14  decayer.init(infoPtr, settingsPtr, particleDataPtr, rndmPtr, couplingsPtr);
15  filter_ = settingsPtr->flag("BiasedTauDecayer:filter");
16  eMuDecays_ = settingsPtr->flag("BiasedTauDecayer:eMuDecays");
17 }

Member Function Documentation

◆ decay()

bool BiasedTauDecayer::decay ( std::vector< int > &  idProd,
std::vector< double > &  mProd,
std::vector< Pythia8::Vec4 > &  pProd,
int  iDec,
const Pythia8::Event &  event 
)
override

Definition at line 19 of file BiasedTauDecayer.cc.

20  {
21  if (!filter_)
22  return false;
23  if (idProd[0] != 15 && idProd[0] != -15)
24  return false;
25  int iStart = event[iDec].iTopCopyId();
26  int iMom = event[iStart].mother1();
27  int idMom = event[iMom].idAbs();
28  if (idMom != 23 && idMom != 24 && idMom != 25)
29  return false;
30  int iDau1 = event[iMom].daughter1();
31  int iDau2 = event[iMom].daughter2();
32  int iBot1 = event[iDau1].iBotCopyId();
33  int iBot2 = event[iDau2].iBotCopyId();
34  int iDecSis = (iDec == iBot1) ? iBot2 : iBot1;
35  // Check if sister has been decayed
36  // Since taus decays are correlated, use one decay, store the other
37  bool notDecayed = event[iDecSis].status() > 0 ? true : false;
38  if (notDecayed) {
39  // bias for leptonic decays
40  bool hasLepton = (eMuDecays_) ? false : true;
41  Event decay;
42  int i1 = -1;
43  int i2 = -1;
44  while (!hasLepton) {
45  decay = event;
46  decayer.decay(iDec, decay);
47  // check for lepton in first decay
48  i1 = decay[iDec].daughter1();
49  i2 = decay[iDec].daughter2();
50  for (int i = i1; i < i2 + 1; ++i) {
51  if (decay[i].isLepton() && decay[i].isCharged()) {
52  hasLepton = true;
53  break;
54  }
55  }
56  if (hasLepton)
57  break;
58  // check for lepton in second decay
59  i1 = decay[iDecSis].daughter1();
60  i2 = decay[iDecSis].daughter2();
61  for (int i = i1; i < i2 + 1; ++i) {
62  if (decay[i].isLepton() && decay[i].isCharged()) {
63  hasLepton = true;
64  break;
65  }
66  }
67  }
68  // Return decay products
69  i1 = decay[iDec].daughter1();
70  i2 = decay[iDec].daughter2();
71  for (int i = i1; i < i2 + 1; ++i) {
72  idProd.push_back(decay[i].id());
73  mProd.push_back(decay[i].m());
74  pProd.push_back(decay[i].p());
75  }
76  // Store correlated decay products
77  i1 = decay[iDecSis].daughter1();
78  i2 = decay[iDecSis].daughter2();
79  idProdSave.clear();
80  mProdSave.clear();
81  pProdSave.clear();
82  for (int i = i1; i < i2 + 1; ++i) {
83  idProdSave.push_back(decay[i].id());
84  mProdSave.push_back(decay[i].m());
85  pProdSave.push_back(decay[i].p());
86  }
87  } else {
88  // Return stored decay products
89  for (size_t i = 0; i < idProdSave.size(); ++i) {
90  idProd.push_back(idProdSave[i]);
91  mProd.push_back(mProdSave[i]);
92  pProd.push_back(pProdSave[i]);
93  }
94  }
95 
96  return true;
97 }

References PA_ZEESkim_cff::decay, event(), mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, reco::isLepton(), visualization-live-secondInstance_cfg::m, AlCaHLTBitMon_ParallelJobs::p, and funct::true.

Member Data Documentation

◆ decayer

Pythia8::TauDecays BiasedTauDecayer::decayer
private

Definition at line 24 of file BiasedTauDecayer.h.

◆ eMuDecays_

bool BiasedTauDecayer::eMuDecays_
private

Definition at line 26 of file BiasedTauDecayer.h.

◆ filter_

bool BiasedTauDecayer::filter_
private

Definition at line 25 of file BiasedTauDecayer.h.

◆ idProdSave

std::vector<int> BiasedTauDecayer::idProdSave
private

Definition at line 27 of file BiasedTauDecayer.h.

◆ mProdSave

std::vector<double> BiasedTauDecayer::mProdSave
private

Definition at line 28 of file BiasedTauDecayer.h.

◆ pProdSave

std::vector<Pythia8::Vec4> BiasedTauDecayer::pProdSave
private

Definition at line 29 of file BiasedTauDecayer.h.

testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
mps_fire.i
i
Definition: mps_fire.py:355
edm::Transition::Event
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
reco::isLepton
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:13
BiasedTauDecayer::decayer
Pythia8::TauDecays decayer
Definition: BiasedTauDecayer.h:24
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
BiasedTauDecayer::decay
bool decay(std::vector< int > &idProd, std::vector< double > &mProd, std::vector< Pythia8::Vec4 > &pProd, int iDec, const Pythia8::Event &event) override
Definition: BiasedTauDecayer.cc:19
funct::true
true
Definition: Factorize.h:173
BiasedTauDecayer::pProdSave
std::vector< Pythia8::Vec4 > pProdSave
Definition: BiasedTauDecayer.h:29
BiasedTauDecayer::idProdSave
std::vector< int > idProdSave
Definition: BiasedTauDecayer.h:27
BiasedTauDecayer::mProdSave
std::vector< double > mProdSave
Definition: BiasedTauDecayer.h:28
BiasedTauDecayer::eMuDecays_
bool eMuDecays_
Definition: BiasedTauDecayer.h:26
event
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of "!*" before the partial wildcard feature was incorporated). The per-event "cost" of each negative criterion with multiple relevant triggers is about the same as ! *was in the past
BiasedTauDecayer::filter_
bool filter_
Definition: BiasedTauDecayer.h:25