CMS 3D CMS Logo

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

#include <GeneratorTau.h>

Inheritance diagram for GeneratorTau:
reco::GenParticle reco::CompositeRefCandidateT< GenParticleRefVector > reco::LeafCandidate reco::Candidate

Public Types

enum  tauDecayModeEnum {
  kElectron, kMuon, kOneProng0pi0, kOneProng1pi0,
  kOneProng2pi0, kThreeProng0pi0, kThreeProng1pi0, kOther,
  kUndefined
}
 
- Public Types inherited from reco::CompositeRefCandidateT< GenParticleRefVector >
typedef GenParticleRefVector daughters
 collection of references to daughters More...
 
typedef GenParticleRefVector mothers
 collection of references to daughters More...
 
- Public Types inherited from reco::LeafCandidate
typedef int Charge
 electric charge type More...
 
typedef CandidateCollection daughters
 collection of daughter candidates More...
 
typedef unsigned int index
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef
math::PtEtaPhiMLorentzVector 
PolarLorentzVector
 Lorentz vector. More...
 
typedef math::XYZVector Vector
 point in the space More...
 
- Public Types inherited from reco::Candidate
enum  { dimension = 3 }
 
enum  { size = dimension * (dimension + 1)/2 }
 matix size More...
 
typedef int Charge
 electric charge type More...
 
typedef candidate::const_iterator const_iterator
 
typedef math::Error< dimension >
::type 
CovarianceMatrix
 covariance error matrix (3x3) More...
 
typedef unsigned int index
 index type More...
 
typedef candidate::iterator iterator
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef
math::PtEtaPhiMLorentzVector 
PolarLorentzVector
 Lorentz vector. More...
 
typedef size_t size_type
 
typedef math::XYZVector Vector
 point in the space More...
 

Public Member Functions

tauDecayModeEnum computeDecayMode (const reco::GenParticle *)
 
void computeStableDecayProducts (const reco::GenParticle *, std::vector< const reco::GenParticle * > &)
 
LorentzVector convertHepMCFourVec (const reco::GenParticle *theParticle)
 
std::vector< LorentzVectorconvertMCVectorToLorentzVectors (const std::vector< const reco::GenParticle * > &theList) const
 
void decayToPDGClassification (const reco::GenParticle *, std::vector< const reco::GenParticle * > &)
 Return list of stable & "semi-stable" tau decay products (e.g. decay the rhos) More...
 
const reco::GenParticlefindLeadTrack ()
 
 GeneratorTau (const reco::GenParticle &input)
 
 GeneratorTau ()
 
float getChargedOpeningAngle () const
 
std::vector< LorentzVectorgetChargedPions () const
 
tauDecayModeEnum getDecayType () const
 
float getGammaOpeningAngle () const
 
std::vector< LorentzVectorgetGammas () const
 
std::vector< const
reco::Candidate * > 
getGenChargedPions () const
 
std::vector< const
reco::Candidate * > 
getGenGammas () const
 
std::vector< const
reco::Candidate * > 
getGenNeutralPions () const
 
std::vector< const
reco::Candidate * > 
getGenNu () const
 
const reco::CandidategetLeadTrack () const
 
float getOpeningAngle (const std::vector< const reco::GenParticle * > &aCollection) const
 
std::vector< const
reco::Candidate * > 
getStableDecayProducts () const
 
LorentzVector getVisibleFourVector () const
 
std::vector< LorentzVectorgetVisibleFourVectors () const
 
float getVisNuAngle () const
 
void init ()
 
bool isFinalStateTau () const
 
 ~GeneratorTau ()
 
- Public Member Functions inherited from reco::GenParticle
GenParticleclone () const
 return a clone More...
 
int collisionId () const
 
bool fromHardProcessBeforeFSR () const
 
bool fromHardProcessDecayed () const
 
bool fromHardProcessFinalState () const
 
 GenParticle ()
 default constructor More...
 
 GenParticle (const LeafCandidate &c)
 default constructor More...
 
 GenParticle (Charge q, const LorentzVector &p4, const Point &vtx, int pdgId, int status, bool integerCharge)
 constrocturo from values More...
 
 GenParticle (Charge q, const PolarLorentzVector &p4, const Point &vtx, int pdgId, int status, bool integerCharge)
 constrocturo from values More...
 
bool isDirectHardProcessTauDecayProductFinalState () const
 
bool isDirectPromptTauDecayProductFinalState () const
 
bool isHardProcess () const
 
bool isLastCopy () const
 
bool isLastCopyBeforeFSR () const
 
bool isMostlyLikePythia6Status3 ()
 
bool isPromptDecayed () const
 
bool isPromptFinalState () const
 
void setCollisionId (int s)
 
const GenStatusFlagsstatusFlags () const
 
GenStatusFlagsstatusFlags ()
 
virtual ~GenParticle ()
 destructor More...
 
- Public Member Functions inherited from reco::CompositeRefCandidateT< GenParticleRefVector >
void addDaughter (const typename daughters::value_type &)
 add a daughter via a reference More...
 
void addMother (const typename mothers::value_type &)
 add a daughter via a reference More...
 
void clearDaughters ()
 clear daughter references More...
 
void clearMothers ()
 clear mother references More...
 
 CompositeRefCandidateT ()
 default constructor More...
 
 CompositeRefCandidateT (Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values More...
 
 CompositeRefCandidateT (Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values More...
 
 CompositeRefCandidateT (const LeafCandidate &c)
 constructor from a particle More...
 
virtual const Candidatedaughter (size_type) const
 return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) More...
 
virtual Candidatedaughter (size_type)
 return daughter at a given position, i = 0, ... numberOfDaughters() - 1 More...
 
daughters::value_type daughterRef (size_type i) const
 reference to daughter at given position More...
 
const daughtersdaughterRefVector () const
 references to daughtes More...
 
virtual const Candidatemother (size_type=0) const
 return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) More...
 
daughters::value_type motherRef (size_type i=0) const
 reference to mother at given position More...
 
const mothersmotherRefVector () const
 references to mothers More...
 
virtual size_t numberOfDaughters () const
 number of daughters More...
 
virtual size_t numberOfMothers () const
 number of mothers More...
 
void resetDaughters (const edm::ProductID &id)
 set daughters product ID More...
 
void resetMothers (const edm::ProductID &id)
 set mother product ID More...
 
virtual ~CompositeRefCandidateT ()
 destructor More...
 
- Public Member Functions inherited from reco::LeafCandidate
virtual Vector boostToCM () const
 
virtual int charge () const
 electric charge More...
 
void construct (int qx3, float pt, float eta, float phi, float mass, const Point &vtx, int pdgId, int status)
 
virtual Candidatedaughter (const std::string &s)
 return daughter with a specified role name More...
 
virtual const Candidatedaughter (const std::string &s) const
 return daughter with a specified role name More...
 
virtual double energy () const
 energy More...
 
virtual double et () const
 transverse energy More...
 
virtual double et2 () const
 transverse energy squared (use this for cut!) More...
 
virtual double eta () const
 momentum pseudorapidity More...
 
virtual void fillVertexCovariance (CovarianceMatrix &v) const
 fill SMatrix More...
 
template<typename T >
T get () const
 get a component More...
 
template<typename T , typename Tag >
T get () const
 get a component More...
 
template<typename T >
T get (size_type i) const
 get a component More...
 
template<typename T , typename Tag >
T get (size_type i) const
 get a component More...
 
virtual bool hasMasterClone () const
 
virtual bool hasMasterClonePtr () const
 
virtual bool isCaloMuon () const
 
virtual bool isConvertedPhoton () const
 
virtual bool isElectron () const
 
virtual bool isGlobalMuon () const
 
virtual bool isJet () const
 
virtual bool isMuon () const
 
virtual bool isPhoton () const
 
virtual bool isStandAloneMuon () const
 
virtual bool isTrackerMuon () const
 
 LeafCandidate ()
 
 LeafCandidate (const Candidate &c)
 
template<typename... Args>
 LeafCandidate (Args &&...args)
 
 LeafCandidate (LeafCandidate &rh)
 
 LeafCandidate (LeafCandidate &&)=default
 
 LeafCandidate (LeafCandidate const &)=default
 
virtual bool longLived () const
 is long lived? More...
 
virtual double mass () const
 mass More...
 
virtual bool massConstraint () const
 do mass constraint? More...
 
virtual double massSqr () const
 mass squared More...
 
virtual const CandidateBaseRefmasterClone () const
 
virtual const CandidatePtrmasterClonePtr () const
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
virtual Vector momentum () const
 spatial momentum vector More...
 
virtual double mt () const
 transverse mass More...
 
virtual double mtSqr () const
 transverse mass squared More...
 
template<typename T >
size_type numberOf () const
 number of components More...
 
template<typename T , typename Tag >
size_type numberOf () const
 number of components More...
 
virtual size_t numberOfSourceCandidatePtrs () const
 
LeafCandidateoperator= (LeafCandidate &&)=default
 
LeafCandidateoperator= (LeafCandidate const &)=default
 
virtual double p () const
 magnitude of momentum vector More...
 
virtual const LorentzVectorp4 () const
 four-momentum Lorentz vector More...
 
virtual int pdgId () const
 PDG identifier. More...
 
virtual double phi () const
 momentum azimuthal angle More...
 
virtual const PolarLorentzVectorpolarP4 () const
 four-momentum Lorentz vector More...
 
virtual double pt () const
 transverse momentum More...
 
virtual double px () const
 x coordinate of momentum vector More...
 
virtual double py () const
 y coordinate of momentum vector More...
 
virtual double pz () const
 z coordinate of momentum vector More...
 
virtual double rapidity () const
 rapidity More...
 
virtual void setCharge (Charge q)
 set electric charge More...
 
virtual void setLongLived ()
 
virtual void setMass (double m)
 set particle mass More...
 
virtual void setMassConstraint ()
 
virtual void setP4 (const LorentzVector &p4)
 set 4-momentum More...
 
virtual void setP4 (const PolarLorentzVector &p4)
 set 4-momentum More...
 
virtual void setPdgId (int pdgId)
 
virtual void setPz (double pz)
 
virtual void setStatus (int status)
 set status word More...
 
virtual void setThreeCharge (Charge qx3)
 set electric charge More...
 
virtual void setVertex (const Point &vertex)
 set vertex More...
 
virtual CandidatePtr sourceCandidatePtr (size_type i) const
 
virtual int status () const
 status word More...
 
virtual double theta () const
 momentum polar angle More...
 
virtual int threeCharge () const
 electric charge More...
 
virtual const Pointvertex () const
 vertex position (overwritten by PF...) More...
 
virtual double vertexChi2 () const
 chi-squares More...
 
virtual double vertexCovariance (int i, int j) const
 (i, j)-th element of error matrix, i, j = 0, ... 2 More...
 
CovarianceMatrix vertexCovariance () const
 return SMatrix More...
 
virtual double vertexNdof () const
 
virtual double vertexNormalizedChi2 () const
 chi-squared divided by n.d.o.f. More...
 
virtual double vx () const
 x coordinate of vertex position More...
 
virtual double vy () const
 y coordinate of vertex position More...
 
virtual double vz () const
 z coordinate of vertex position More...
 
virtual double y () const
 rapidity More...
 
virtual ~LeafCandidate ()
 destructor More...
 
- Public Member Functions inherited from reco::Candidate
const_iterator begin () const
 first daughter const_iterator More...
 
iterator begin ()
 first daughter iterator More...
 
virtual const TrackbestTrack () const
 
 Candidate ()
 default constructor More...
 
virtual float dxyError () const
 uncertainty on dxy More...
 
virtual float dzError () const
 uncertainty on dz More...
 
const_iterator end () const
 last daughter const_iterator More...
 
iterator end ()
 last daughter iterator More...
 
template<typename T >
T get () const
 get a component More...
 
template<typename T , typename Tag >
T get () const
 get a component More...
 
template<typename T >
T get (size_type i) const
 get a component More...
 
template<typename T , typename Tag >
T get (size_type i) const
 get a component More...
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
template<typename T >
size_type numberOf () const
 number of components More...
 
template<typename T , typename Tag >
size_type numberOf () const
 number of components More...
 
virtual void setSourceCandidatePtr (const CandidatePtr &ptr)
 Set the ptr to the source Candidate. More...
 
virtual ~Candidate ()
 destructor More...
 

Private Attributes

int aFinalStateTau_
 
Angle< LorentzVectorangleFinder
 
DeltaR< LorentzVectordeltaRFinder
 
std::vector< const
reco::GenParticle * > 
genChargedPions_
 
std::vector< const
reco::GenParticle * > 
genGammas_
 
std::vector< const
reco::GenParticle * > 
genNeutralPions_
 
std::vector< const
reco::GenParticle * > 
genNus_
 
std::vector< const
reco::GenParticle * > 
stableDecayProducts_
 
tauDecayModeEnum theDecayMode_
 
const reco::GenParticletheLeadTrack_
 
std::vector< const
reco::GenParticle * > 
visibleDecayProducts_
 

Additional Inherited Members

- Static Public Member Functions inherited from reco::CompositeRefCandidateT< GenParticleRefVector >
static short Class_Version ()
 

Detailed Description

Definition at line 28 of file GeneratorTau.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

GeneratorTau::GeneratorTau ( const reco::GenParticle input)
inline

Definition at line 37 of file GeneratorTau.h.

References NULL, and theLeadTrack_.

37  :GenParticle(input){
39  };
const reco::GenParticle * theLeadTrack_
Definition: GeneratorTau.h:86
#define NULL
Definition: scimark2.h:8
GenParticle()
default constructor
Definition: GenParticle.h:24
GeneratorTau::GeneratorTau ( )

Definition at line 183 of file GeneratorTau.cc.

184 {
185 }
GeneratorTau::~GeneratorTau ( )
inline

Definition at line 42 of file GeneratorTau.h.

42 {};

Member Function Documentation

GeneratorTau::tauDecayModeEnum GeneratorTau::computeDecayMode ( const reco::GenParticle theTau)

find the decay products, in terms of the PDG table (eg 1 pi0, 1 pi+, etc)

Definition at line 48 of file GeneratorTau.cc.

References funct::abs(), decayToPDGClassification(), kElectron, kMuon, kOneProng0pi0, kOneProng1pi0, kOneProng2pi0, kOther, kThreeProng0pi0, kThreeProng1pi0, kUndefined, NULL, patZpeak::numMuons, convertSQLitetoXML_cfg::output, reco::LeafCandidate::pdgId(), and reco::LeafCandidate::status().

Referenced by init().

49  {
50  //return kUndefined if not a tau
51  if (theTau == NULL || std::abs(theTau->pdgId()) != 15
52  || theTau->status() != 2)
53  return kUndefined;
54 
56 
57  //counters to determine decay type (adapted from Ricardo's code)
58  int numElectrons = 0;
59  int numMuons = 0;
60  int numChargedPions = 0;
61  int numNeutralPions = 0;
62  int numNeutrinos = 0;
63  int numOtherParticles = 0;
64 
66  std::vector<const reco::GenParticle* > pdgDecayProductTypes;
67 
68  GeneratorTau::decayToPDGClassification(theTau, pdgDecayProductTypes);
69 
70  for (std::vector<const reco::GenParticle* >::const_iterator decayProduct =
71  pdgDecayProductTypes.begin();
72  decayProduct != pdgDecayProductTypes.end(); ++decayProduct) {
73  int pdg_id = std::abs( (*decayProduct)->pdgId() );
74  //edm::LogInfo("GeneratorTau") << "Has decay product w/ PDG ID: " << pdg_id;
75  if (pdg_id == 11) numElectrons++;
76  else if (pdg_id == 13) numMuons++;
77  else if (pdg_id == 211) numChargedPions++;
78  else if (pdg_id == 111) numNeutralPions++;
79  else if (pdg_id == 12 ||
80  pdg_id == 14 ||
81  pdg_id == 16) numNeutrinos++;
82  else if (pdg_id != 22)
83  numOtherParticles++;
84  }
85  output = kOther;
86 
87  //determine tauDecayMode
88  if ( numOtherParticles == 0 ){
89  if ( numElectrons == 1 ){
90  //--- tau decays into electrons
91  output = kElectron;
92  } else if ( numMuons == 1 ){
93  //--- tau decays into muons
94  output = kMuon;
95  } else {
96  //--- hadronic tau decays
97  switch ( numChargedPions ){
98  case 1 :
99  switch ( numNeutralPions ){
100  case 0 :
101  output = kOneProng0pi0;
102  break;
103  case 1 :
104  output = kOneProng1pi0;
105  break;
106  case 2 :
107  output = kOneProng2pi0;
108  break;
109  }
110  break;
111  case 3 :
112  switch ( numNeutralPions ){
113  case 0 :
114  output = kThreeProng0pi0;
115  break;
116  case 1 :
117  output = kThreeProng1pi0;
118  break;
119  }
120  break;
121  }
122  }
123  }
124  return output;
125 }
virtual int pdgId() const
PDG identifier.
virtual int status() const
status word
#define NULL
Definition: scimark2.h:8
tuple numMuons
Definition: patZpeak.py:40
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void decayToPDGClassification(const reco::GenParticle *, std::vector< const reco::GenParticle * > &)
Return list of stable &amp; &quot;semi-stable&quot; tau decay products (e.g. decay the rhos)
void GeneratorTau::computeStableDecayProducts ( const reco::GenParticle theParticle,
std::vector< const reco::GenParticle * > &  container 
)

Definition at line 161 of file GeneratorTau.cc.

References reco::Candidate::Candidate(), reco::CompositeRefCandidateT< D >::daughter(), reco::CompositeRefCandidateT< GenParticleRefVector >::daughter(), reco::CompositeRefCandidateT< D >::numberOfDaughters(), and reco::LeafCandidate::status().

Referenced by init().

162 {
163  if (theParticle)
164  {
165  if (theParticle->status() == 1) //status = 1 indicates final state particle
166  {
167  //edm::LogInfo("GeneratorTau") << "computeStableDecayProducts: Found a final state daughter with status: " << theParticle->status() << " Num stable decay products so far: " << container.size();
168  container.push_back(theParticle);
169  }
170  else
171  {
172  unsigned int nDaughters = theParticle->numberOfDaughters();
173  for (size_t dIter = 0; dIter < nDaughters; ++dIter)
174  {
175  const Candidate * daughter = theParticle->daughter(dIter);
176  //edm::LogInfo("Debug") << "Recursing on daughter with PDG: " << daughter->pdgId();
177  GeneratorTau::computeStableDecayProducts(static_cast<const reco::GenParticle*>(daughter), container);
178  }
179  }
180  }
181 }
virtual int status() const
status word
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
Candidate()
default constructor
Definition: Candidate.h:54
void computeStableDecayProducts(const reco::GenParticle *, std::vector< const reco::GenParticle * > &)
LorentzVector GeneratorTau::convertHepMCFourVec ( const reco::GenParticle theParticle)
std::vector< LorentzVector > GeneratorTau::convertMCVectorToLorentzVectors ( const std::vector< const reco::GenParticle * > &  theList) const

Definition at line 231 of file GeneratorTau.cc.

References convertSQLitetoXML_cfg::output.

Referenced by getChargedPions(), getGammas(), and getVisibleFourVectors().

232  {
233  std::vector<LorentzVector> output;
234  std::vector<const reco::GenParticle*>::const_iterator theParticle;
235  for (theParticle = theList.begin();
236  theParticle != theList.end(); ++theParticle) {
237  output.push_back( (*theParticle)->p4() );
238  }
239  return output;
240 }
void GeneratorTau::decayToPDGClassification ( const reco::GenParticle theParticle,
std::vector< const reco::GenParticle * > &  container 
)

Return list of stable & "semi-stable" tau decay products (e.g. decay the rhos)

Definition at line 129 of file GeneratorTau.cc.

References funct::abs(), reco::Candidate::Candidate(), reco::CompositeRefCandidateT< D >::daughter(), reco::CompositeRefCandidateT< GenParticleRefVector >::daughter(), genNeutralPions_, reco::CompositeRefCandidateT< D >::numberOfDaughters(), reco::LeafCandidate::pdgId(), and reco::LeafCandidate::status().

Referenced by computeDecayMode().

130 {
132  if (theParticle)
133  {
134  //edm::LogInfo("Debug") << "It's non-null";
135  int pdgId = std::abs(theParticle->pdgId());
136  //edm::LogInfo("Debug") << "PDGID = " << pdgId << " Status = " << theStatus;
137  if (theParticle->status() == 1 || pdgId == 211 || pdgId == 111 || pdgId == 11 || pdgId == 13)
138  {
139  //edm::LogInfo("Debug") << "Adding to container...";
140  container.push_back(theParticle);
141  //add neutral pions and this step....
142  if (pdgId == 111)
143  genNeutralPions_.push_back(theParticle);
144  }
145  else
146  {
147  unsigned int nDaughters = theParticle->numberOfDaughters();
148  for (size_t dIter = 0; dIter < nDaughters; ++dIter)
149  {
150  const Candidate * daughter = theParticle->daughter(dIter);
151  //edm::LogInfo("Debug") << "Recursing on daughter with PDG: " << daughter->pdgId();
152  GeneratorTau::decayToPDGClassification(static_cast<const reco::GenParticle*>(daughter), container);
153  }
154 
155  }
156  }
157 }
virtual int pdgId() const
PDG identifier.
std::vector< const reco::GenParticle * > genNeutralPions_
Definition: GeneratorTau.h:82
virtual int status() const
status word
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Candidate()
default constructor
Definition: Candidate.h:54
void decayToPDGClassification(const reco::GenParticle *, std::vector< const reco::GenParticle * > &)
Return list of stable &amp; &quot;semi-stable&quot; tau decay products (e.g. decay the rhos)
const reco::GenParticle * GeneratorTau::findLeadTrack ( )

Definition at line 13 of file GeneratorTau.cc.

References genChargedPions_, NULL, convertSQLitetoXML_cfg::output, and theLeadTrack_.

Referenced by init().

13  {
14  std::vector<const reco::GenParticle*>::const_iterator thePion =
15  genChargedPions_.begin();
16  double maxPt = 0;
17  const reco::GenParticle* output = NULL;
18  for (; thePion != genChargedPions_.end(); ++thePion) {
19  if ((*thePion)->pt() > maxPt) {
20  maxPt = (*thePion)->pt();
21  output = (*thePion);
22  }
23  }
25  return output;
26 }
const reco::GenParticle * theLeadTrack_
Definition: GeneratorTau.h:86
#define NULL
Definition: scimark2.h:8
std::vector< const reco::GenParticle * > genChargedPions_
Definition: GeneratorTau.h:81
float GeneratorTau::getChargedOpeningAngle ( ) const

Definition at line 40 of file GeneratorTau.cc.

References genChargedPions_, and getOpeningAngle().

40  {
42 }
std::vector< const reco::GenParticle * > genChargedPions_
Definition: GeneratorTau.h:81
float getOpeningAngle(const std::vector< const reco::GenParticle * > &aCollection) const
Definition: GeneratorTau.cc:28
std::vector< LorentzVector > GeneratorTau::getChargedPions ( ) const

Definition at line 287 of file GeneratorTau.cc.

References convertMCVectorToLorentzVectors(), and genChargedPions_.

287  {
289 }
std::vector< LorentzVector > convertMCVectorToLorentzVectors(const std::vector< const reco::GenParticle * > &theList) const
std::vector< const reco::GenParticle * > genChargedPions_
Definition: GeneratorTau.h:81
tauDecayModeEnum GeneratorTau::getDecayType ( ) const
inline

Definition at line 50 of file GeneratorTau.h.

References theDecayMode_.

50 {return theDecayMode_;};
tauDecayModeEnum theDecayMode_
Definition: GeneratorTau.h:88
float GeneratorTau::getGammaOpeningAngle ( ) const

Definition at line 44 of file GeneratorTau.cc.

References genGammas_, and getOpeningAngle().

44  {
46 }
std::vector< const reco::GenParticle * > genGammas_
Definition: GeneratorTau.h:83
float getOpeningAngle(const std::vector< const reco::GenParticle * > &aCollection) const
Definition: GeneratorTau.cc:28
std::vector< LorentzVector > GeneratorTau::getGammas ( ) const

Definition at line 291 of file GeneratorTau.cc.

References convertMCVectorToLorentzVectors(), and genGammas_.

291  {
293 }
std::vector< LorentzVector > convertMCVectorToLorentzVectors(const std::vector< const reco::GenParticle * > &theList) const
std::vector< const reco::GenParticle * > genGammas_
Definition: GeneratorTau.h:83
std::vector< const reco::Candidate * > GeneratorTau::getGenChargedPions ( ) const

Definition at line 243 of file GeneratorTau.cc.

References genChargedPions_, and convertSQLitetoXML_cfg::output.

Referenced by TruthTauDecayModeProducer::produce().

243  {
244  std::vector<const reco::Candidate*> output;
245  std::vector<const GenParticle*>::const_iterator iter;
246  for (iter = genChargedPions_.begin(); iter != genChargedPions_.end(); ++iter)
247  output.push_back(static_cast<const reco::Candidate*>(*iter));
248  return output;
249 }
std::vector< const reco::GenParticle * > genChargedPions_
Definition: GeneratorTau.h:81
std::vector< const reco::Candidate * > GeneratorTau::getGenGammas ( ) const

Definition at line 261 of file GeneratorTau.cc.

References genGammas_, and convertSQLitetoXML_cfg::output.

261  {
262  std::vector<const reco::Candidate*> output;
263  std::vector<const GenParticle*>::const_iterator iter;
264  for (iter = genGammas_.begin(); iter != genGammas_.end(); ++iter)
265  output.push_back(static_cast<const reco::Candidate*>(*iter));
266  return output;
267 }
std::vector< const reco::GenParticle * > genGammas_
Definition: GeneratorTau.h:83
std::vector< const reco::Candidate * > GeneratorTau::getGenNeutralPions ( ) const

Definition at line 252 of file GeneratorTau.cc.

References genNeutralPions_, and convertSQLitetoXML_cfg::output.

Referenced by TruthTauDecayModeProducer::produce().

252  {
253  std::vector<const reco::Candidate*> output;
254  std::vector<const GenParticle*>::const_iterator iter;
255  for (iter = genNeutralPions_.begin(); iter != genNeutralPions_.end(); ++iter)
256  output.push_back(static_cast<const reco::Candidate*>(*iter));
257  return output;
258 }
std::vector< const reco::GenParticle * > genNeutralPions_
Definition: GeneratorTau.h:82
std::vector< const reco::Candidate * > GeneratorTau::getGenNu ( ) const

Definition at line 279 of file GeneratorTau.cc.

References genNus_, and convertSQLitetoXML_cfg::output.

279  {
280  std::vector<const reco::Candidate*> output;
281  std::vector<const GenParticle*>::const_iterator iter;
282  for (iter = genNus_.begin(); iter != genNus_.end(); ++iter)
283  output.push_back(static_cast<const reco::Candidate*>(*iter));
284  return output;
285 }
std::vector< const reco::GenParticle * > genNus_
Definition: GeneratorTau.h:85
const reco::Candidate * GeneratorTau::getLeadTrack ( ) const

Definition at line 9 of file GeneratorTau.cc.

References reco::Candidate::Candidate(), and theLeadTrack_.

9  {
10  return static_cast<const Candidate*>(theLeadTrack_);
11 }
const reco::GenParticle * theLeadTrack_
Definition: GeneratorTau.h:86
Candidate()
default constructor
Definition: Candidate.h:54
float GeneratorTau::getOpeningAngle ( const std::vector< const reco::GenParticle * > &  aCollection) const

Definition at line 28 of file GeneratorTau.cc.

References angleFinder, convertSQLitetoXML_cfg::output, reco::LeafCandidate::p4(), and theLeadTrack_.

Referenced by getChargedOpeningAngle(), and getGammaOpeningAngle().

29  {
30  double output = 0;
31  std::vector<const reco::GenParticle*>::const_iterator theObject =
32  theCollection.begin();
33  for (; theObject != theCollection.end(); ++theObject) {
34  if (output < angleFinder(theLeadTrack_->p4(), (*theObject)->p4()))
35  output = angleFinder(theLeadTrack_->p4(), (*theObject)->p4());
36  }
37  return output;
38 }
const reco::GenParticle * theLeadTrack_
Definition: GeneratorTau.h:86
Angle< LorentzVector > angleFinder
Definition: GeneratorTau.h:75
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
std::vector< const reco::Candidate * > GeneratorTau::getStableDecayProducts ( ) const

Definition at line 270 of file GeneratorTau.cc.

References convertSQLitetoXML_cfg::output, and stableDecayProducts_.

270  {
271  std::vector<const reco::Candidate*> output;
272  std::vector<const GenParticle*>::const_iterator iter;
273  for (iter = stableDecayProducts_.begin();
274  iter != stableDecayProducts_.end(); ++iter)
275  output.push_back(static_cast<const reco::Candidate*>(*iter));
276  return output;
277 }
std::vector< const reco::GenParticle * > stableDecayProducts_
Definition: GeneratorTau.h:84
LorentzVector GeneratorTau::getVisibleFourVector ( ) const

Definition at line 299 of file GeneratorTau.cc.

References getVisibleFourVectors(), and convertSQLitetoXML_cfg::output.

Referenced by getVisNuAngle().

299  {
301  std::vector<LorentzVector> tempForSum = getVisibleFourVectors();
302  for (std::vector<LorentzVector>::iterator iter = tempForSum.begin();
303  iter != tempForSum.end(); ++iter)
304  output += (*iter);
305  return output;
306 }
math::XYZTLorentzVector LorentzVector
std::vector< LorentzVector > getVisibleFourVectors() const
std::vector< LorentzVector > GeneratorTau::getVisibleFourVectors ( ) const

Definition at line 295 of file GeneratorTau.cc.

References convertMCVectorToLorentzVectors(), and visibleDecayProducts_.

Referenced by getVisibleFourVector().

295  {
297 }
std::vector< LorentzVector > convertMCVectorToLorentzVectors(const std::vector< const reco::GenParticle * > &theList) const
std::vector< const reco::GenParticle * > visibleDecayProducts_
Definition: GeneratorTau.h:80
float GeneratorTau::getVisNuAngle ( ) const

Definition at line 3 of file GeneratorTau.cc.

References angleFinder, getVisibleFourVector(), and reco::LeafCandidate::p4().

3  {
4  LorentzVector suckVector = getVisibleFourVector();
5  LorentzVector suckNuVector = this->p4() - suckVector;
6  return angleFinder(suckVector, suckNuVector);
7 }
math::XYZTLorentzVector LorentzVector
LorentzVector getVisibleFourVector() const
Angle< LorentzVector > angleFinder
Definition: GeneratorTau.h:75
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
void GeneratorTau::init ( void  )

Definition at line 189 of file GeneratorTau.cc.

References funct::abs(), aFinalStateTau_, computeDecayMode(), computeStableDecayProducts(), findLeadTrack(), genChargedPions_, genGammas_, genNus_, kUndefined, stableDecayProducts_, theDecayMode_, theLeadTrack_, and visibleDecayProducts_.

Referenced by TruthTauDecayModeProducer::produce().

190 {
191  //make sure this tau really decays
193  aFinalStateTau_ = false;
194 
195  //get Decaymode
196  //edm::LogInfo("GeneratorTau") << "Computing decay mode..";
198 
199  //make sure it is a real tau decay
200  if (theDecayMode_ != kUndefined) {
201  aFinalStateTau_ = true;
202  //edm::LogInfo("GeneratorTau") << "Found decay type: " << theDecayMode_ << ", computing stable decay products.";
203  //get the stable decay products
205  //from the stable products, fill the lists
206  //edm::LogInfo("GeneratorTau") << "Found " << stableDecayProducts_.size() << " stable decay products, filtering.";
207  for (std::vector<const reco::GenParticle*>::const_iterator iter = stableDecayProducts_.begin();
208  iter != stableDecayProducts_.end();
209  ++iter)
210  {
211  //fill vectors
212  int pdg_id = std::abs( (*iter)->pdgId() );
213  if (pdg_id == 16 || pdg_id == 12 || pdg_id == 14)
214  genNus_.push_back( (*iter) );
215  else {
216  visibleDecayProducts_.push_back( (*iter) );
217  if (pdg_id == 211 || (*iter)->charge() != 0)
218  genChargedPions_.push_back( (*iter) );
219  else if (pdg_id == 22)
220  genGammas_.push_back( (*iter) );
221  }
222  }
223  // find the lead charged object
225  }
226 }
tauDecayModeEnum theDecayMode_
Definition: GeneratorTau.h:88
std::vector< const reco::GenParticle * > genNus_
Definition: GeneratorTau.h:85
int aFinalStateTau_
Definition: GeneratorTau.h:89
const reco::GenParticle * theLeadTrack_
Definition: GeneratorTau.h:86
tauDecayModeEnum computeDecayMode(const reco::GenParticle *)
Definition: GeneratorTau.cc:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< const reco::GenParticle * > genGammas_
Definition: GeneratorTau.h:83
void computeStableDecayProducts(const reco::GenParticle *, std::vector< const reco::GenParticle * > &)
std::vector< const reco::GenParticle * > stableDecayProducts_
Definition: GeneratorTau.h:84
const reco::GenParticle * findLeadTrack()
Definition: GeneratorTau.cc:13
std::vector< const reco::GenParticle * > genChargedPions_
Definition: GeneratorTau.h:81
std::vector< const reco::GenParticle * > visibleDecayProducts_
Definition: GeneratorTau.h:80
bool GeneratorTau::isFinalStateTau ( ) const
inline

Definition at line 51 of file GeneratorTau.h.

References aFinalStateTau_.

Referenced by TruthTauDecayModeProducer::produce().

51 {return aFinalStateTau_;};
int aFinalStateTau_
Definition: GeneratorTau.h:89

Member Data Documentation

int GeneratorTau::aFinalStateTau_
private

Definition at line 89 of file GeneratorTau.h.

Referenced by init(), and isFinalStateTau().

Angle<LorentzVector> GeneratorTau::angleFinder
private

Definition at line 75 of file GeneratorTau.h.

Referenced by getOpeningAngle(), and getVisNuAngle().

DeltaR<LorentzVector> GeneratorTau::deltaRFinder
private

Definition at line 76 of file GeneratorTau.h.

std::vector<const reco::GenParticle*> GeneratorTau::genChargedPions_
private
std::vector<const reco::GenParticle*> GeneratorTau::genGammas_
private

Definition at line 83 of file GeneratorTau.h.

Referenced by getGammaOpeningAngle(), getGammas(), getGenGammas(), and init().

std::vector<const reco::GenParticle*> GeneratorTau::genNeutralPions_
private

Definition at line 82 of file GeneratorTau.h.

Referenced by decayToPDGClassification(), and getGenNeutralPions().

std::vector<const reco::GenParticle*> GeneratorTau::genNus_
private

Definition at line 85 of file GeneratorTau.h.

Referenced by getGenNu(), and init().

std::vector<const reco::GenParticle*> GeneratorTau::stableDecayProducts_
private

Definition at line 84 of file GeneratorTau.h.

Referenced by getStableDecayProducts(), and init().

tauDecayModeEnum GeneratorTau::theDecayMode_
private

Definition at line 88 of file GeneratorTau.h.

Referenced by getDecayType(), and init().

const reco::GenParticle* GeneratorTau::theLeadTrack_
private

Definition at line 86 of file GeneratorTau.h.

Referenced by findLeadTrack(), GeneratorTau(), getLeadTrack(), getOpeningAngle(), and init().

std::vector<const reco::GenParticle*> GeneratorTau::visibleDecayProducts_
private

Definition at line 80 of file GeneratorTau.h.

Referenced by getVisibleFourVectors(), and init().