CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/RecoTauTag/TauTagTools/interface/GeneratorTau.h

Go to the documentation of this file.
00001 #ifndef RECOTAUTAG_TAUMVADISCRIMINATOR_GENERATORTAU
00002 #define RECOTAUTAG_TAUMVADISCRIMINATOR_GENERATORTAU
00003 
00004 
00005 /*
00006  * Class GeneratorTau
00007  *
00008  * Tool for retrieving visible decay products and determining PDG-style tau decay mode
00009  * from Pythia output (in CMS genParticle format)
00010  *
00011  * Author: Evan K. Friis, UC Davis; friis@physics.ucdavis.edu
00012  *
00013  * with code and contributions from Ricardo Vasquez Sierra and Christian Veelken, UC Davis
00014  *
00015  */
00016 
00017 #include "FWCore/ServiceRegistry/interface/Service.h"
00018 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00019 #include "FWCore/Framework/interface/Frameworkfwd.h"
00020 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00021 #include "DataFormats/Candidate/interface/Particle.h"
00022 #include "CommonTools/Utils/interface/Angle.h"
00023 #include "DataFormats/Math/interface/deltaR.h"
00024 #include <vector>
00025 
00026 typedef math::XYZTLorentzVector LorentzVector;
00027 
00028 class GeneratorTau : public reco::GenParticle {
00029    public:
00030 
00031       enum tauDecayModeEnum {kElectron, kMuon,
00032          kOneProng0pi0, kOneProng1pi0, kOneProng2pi0,
00033          kThreeProng0pi0, kThreeProng1pi0,
00034          kOther, kUndefined};
00035 
00036       //default constructor
00037       GeneratorTau(const reco::GenParticle& input):GenParticle(input){
00038         theLeadTrack_ = NULL;
00039       };
00040       GeneratorTau();
00041 
00042       ~GeneratorTau(){};
00043 
00044       std::vector<const reco::Candidate*>         getGenChargedPions() const;
00045       std::vector<const reco::Candidate*>         getGenGammas() const;
00046       std::vector<const reco::Candidate*>         getGenNeutralPions() const;
00047       std::vector<const reco::Candidate*>         getStableDecayProducts() const;
00048       std::vector<const reco::Candidate*>         getGenNu() const;
00049 
00050       tauDecayModeEnum                          getDecayType() const {return theDecayMode_;};
00051       bool                                      isFinalStateTau() const {return aFinalStateTau_;};
00052 
00053       void                                      init(); //called to update class after downcasting
00054 
00055       std::vector<LorentzVector>                     getChargedPions() const;
00056       std::vector<LorentzVector>                     getGammas() const;
00057       LorentzVector                             getVisibleFourVector() const;
00058       std::vector<LorentzVector>                     getVisibleFourVectors() const;
00059       const reco::Candidate*                    getLeadTrack() const;
00060       const reco::GenParticle*         findLeadTrack();
00061 
00062       float                                    getVisNuAngle() const;
00063       float                                    getOpeningAngle(const std::vector<const reco::GenParticle*>& aCollection) const;
00064       float                                    getChargedOpeningAngle() const;
00065       float                                    getGammaOpeningAngle() const;
00066 
00067       void                                      decayToPDGClassification(const reco::GenParticle*, std::vector<const reco::GenParticle *>&);
00068       void                                      computeStableDecayProducts(const reco::GenParticle*, std::vector<const reco::GenParticle *>&);
00069       tauDecayModeEnum                          computeDecayMode(const reco::GenParticle*);
00070       LorentzVector                             convertHepMCFourVec(const reco::GenParticle* theParticle);
00071       std::vector<LorentzVector>                     convertMCVectorToLorentzVectors(const std::vector<const reco::GenParticle*>& theList) const;
00072 
00073    private:
00074 
00075       Angle<LorentzVector>                              angleFinder;
00076       DeltaR<LorentzVector>                             deltaRFinder;
00077 
00078 
00079       //only fill these with stable particles
00080       std::vector<const reco::GenParticle*>         visibleDecayProducts_;
00081       std::vector<const reco::GenParticle*>         genChargedPions_;
00082       std::vector<const reco::GenParticle*>         genNeutralPions_;
00083       std::vector<const reco::GenParticle*>         genGammas_;
00084       std::vector<const reco::GenParticle*>         stableDecayProducts_;
00085       std::vector<const reco::GenParticle*>         genNus_;
00086       const reco::GenParticle*                      theLeadTrack_;
00087 
00088       tauDecayModeEnum                                  theDecayMode_;
00089       int                                               aFinalStateTau_;
00090 
00091 };
00092 
00093 
00094 #endif