00001 #ifndef RECOTAUTAG_TAUMVADISCRIMINATOR_GENERATORTAU
00002 #define RECOTAUTAG_TAUMVADISCRIMINATOR_GENERATORTAU
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
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 "PhysicsTools/Utilities/interface/Angle.h"
00023 #include "PhysicsTools/Utilities/interface/deltaR.h"
00024 #include <vector>
00025
00026 using namespace std;
00027
00028 typedef math::XYZTLorentzVector LorentzVector;
00029
00030 class GeneratorTau : public reco::GenParticle {
00031 public:
00032
00033 enum tauDecayModeEnum {kElectron, kMuon,
00034 kOneProng0pi0, kOneProng1pi0, kOneProng2pi0,
00035 kThreeProng0pi0, kThreeProng1pi0,
00036 kOther, kUndefined};
00037
00038
00039 GeneratorTau(const reco::GenParticle& input):GenParticle(input){};
00040 GeneratorTau();
00041
00042 ~GeneratorTau(){};
00043
00044 vector<const reco::Candidate*> getGenChargedPions() const;
00045 vector<const reco::Candidate*> getGenGammas() const;
00046 vector<const reco::Candidate*> getGenNeutralPions() const;
00047 vector<const reco::Candidate*> getStableDecayProducts() const;
00048 vector<const reco::Candidate*> getGenNu() const;
00049
00050 tauDecayModeEnum getDecayType() const {return theDecayMode_;};
00051 bool isFinalStateTau() const {return aFinalStateTau_;};
00052
00053 void init();
00054
00055 vector<LorentzVector> getChargedPions() const;
00056 vector<LorentzVector> getGammas() const;
00057 LorentzVector getVisibleFourVector() const;
00058 vector<LorentzVector> getVisibleFourVectors() const;
00059 const reco::Candidate* getLeadTrack() const;
00060 const reco::GenParticle* findLeadTrack();
00061
00062 float getVisNuAngle() const;
00063 float getOpeningAngle(const 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 vector<LorentzVector> convertMCVectorToLorentzVectors(const vector<const reco::GenParticle*>& theList) const;
00072
00073 private:
00074
00075 Angle<LorentzVector> angleFinder;
00076 DeltaR<LorentzVector> deltaRFinder;
00077
00078
00079
00080 vector<const reco::GenParticle*> visibleDecayProducts_;
00081 vector<const reco::GenParticle*> genChargedPions_;
00082 vector<const reco::GenParticle*> genNeutralPions_;
00083 vector<const reco::GenParticle*> genGammas_;
00084 vector<const reco::GenParticle*> stableDecayProducts_;
00085 vector<const reco::GenParticle*> genNus_;
00086 const reco::GenParticle* theLeadTrack_;
00087
00088 tauDecayModeEnum theDecayMode_;
00089 int aFinalStateTau_;
00090
00091 };
00092
00093
00094 #endif