ROOT logo
#ifndef __HPARTICLEPAIR_H__
#define __HPARTICLEPAIR_H__

#include "hvirtualcand.h"
#include "hvirtualcandsim.h"
#include "hparticletool.h"
#include "hgeomvector.h"
#include "hgeantkine.h"
#include "TLorentzVector.h"




class HParticlePair : public TLorentzVector
{
protected:


    HVirtualCand* fcand[2];    //! pointer to cand1 (reference: should be a lepton candidate) and cand2
    HParticlePair* fpair[2];    //! pointer to cand1 and cand2  from pairs
    TLorentzVector    fc[2];    // local copy of lorentz vector of cand1 and cand2

    UInt_t fpairFlags;          // pair classifier
    UInt_t fstatusFlags;        //  bit  0x01   true cand1
                                //       0x02   true cand2

    Int_t fPID[2];              // assigned PID for cand1 and cand2
    Int_t fMotherPID;           // assigned PID for Mother
    Float_t foAngle;            // opening angle of pair [deg]
    Bool_t  fIsSimulation ;     // kTRUE if HVirtualCandSim is used


    HGeomVector  fEventVertex;  // used event vertex
    HGeomVector  fDecayVertex;  // secondary vertex of both candidates
    Float_t fVerMinDistCand[2]; // vertex cut vars : mindist cand1 and cand2 to event vertex
    Float_t fVerMinDistMother;  // vertex cut vars : mindist mother to event vertex
    Float_t fVerDistMother;     // vertex cut vars
    Float_t fMinDistCandidates; // vertex cut vars : mindist between cand1 and cand2

    static Bool_t fDoMomCorrection; //!


    Bool_t          calcVertex();
    Bool_t          isSimulation();
    void            setTruePair();
public:
    HParticlePair();
    ~HParticlePair();


    HVirtualCand*      getCand    (Int_t ind)       { return fcand[ind];  }
    HParticlePair*     getPair    (Int_t ind)       { return fpair[ind];  }
    HVirtualCandSim*   getCandSim (Int_t ind)       { return dynamic_cast<HVirtualCandSim*>(fcand[ind]);  }
    TLorentzVector&    getCandVect(Int_t ind)       { return fc[ind];}
    Int_t              index(Int_t pid)             { return fPID[0] == pid ? 0 : 1; }
    Float_t            getOpeningAngle()            { return foAngle; }
    Float_t            getPhi()                     { return (Phi() < 0 ? Phi()*TMath::RadToDeg()+360 : Phi()*TMath::RadToDeg());}
    Float_t            getTheta()                   { return Theta()*TMath::RadToDeg();}

    Int_t              getCandPID(Int_t ind)        { return fPID[ind];}
    Int_t              getMotherPID()               { return fMotherPID;}
    UInt_t             getPairFlags()               { return fpairFlags ;}
    Int_t              isFakePair();
    Bool_t             isTruePair();
    HVirtualCandSim*   getFirstDaughter();
    Bool_t             isGeantDecay();
    Bool_t             isSameExternalSource();
    void               getSourceInfo(Int_t index,Int_t& parentTr,Int_t& grandparenttr,Int_t& geninfo,Int_t& geninfo1,Int_t& geninfo2);
    Bool_t             getIsSimulation()            { return fIsSimulation;}

    Float_t            getVerMinDistCand(Int_t ind) { return fVerMinDistCand[ind];}
    Float_t            getVerMinDistMother()        { return fVerMinDistMother;}
    Float_t            getMinDistCandidates()       { return fMinDistCandidates;}
    Float_t            getVerDistMother()           { return fVerDistMother;}
    HGeomVector&       getEventVertex()             { return fEventVertex; }
    HGeomVector&       getDecayVertex()             { return fDecayVertex; }

    void               printFlags();
    void               print(UInt_t selection=63);
    void               clear();

    UInt_t             getStatusFlags() { return fstatusFlags; }
    Bool_t             checkStatus(UInt_t flag)  { return  (fstatusFlags|flag) == flag ? kTRUE: kFALSE; }

    Bool_t             calcVectors(Int_t pid1,Int_t pid2,Int_t motherpid,HGeomVector& vertex);
    Bool_t             setPair(HVirtualCand* cnd1,Int_t pid1,HVirtualCand* cnd2,Int_t pid2,Int_t motherpid,UInt_t pairflags,HGeomVector& vertex);
    Bool_t             setPair(HParticlePair* cnd1,Int_t pid1,HVirtualCand* cnd2,Int_t pid2,Int_t motherpid,UInt_t pairflags,HGeomVector& vertex);
    Bool_t             setPair(HParticlePair* cnd1,Int_t pid1,HParticlePair* cnd2,Int_t pid2,Int_t motherpid,UInt_t pairflags,HGeomVector& vertex);
    static void        setDoMomentumCorrection(Bool_t doit) { fDoMomCorrection = doit;}
    static Bool_t      getDoMomentumCorrection()            { return fDoMomCorrection ;}
    ClassDef(HParticlePair,2)

};
#endif // __HPARTICLEPAIR_H__

 hparticlepair.h:1
 hparticlepair.h:2
 hparticlepair.h:3
 hparticlepair.h:4
 hparticlepair.h:5
 hparticlepair.h:6
 hparticlepair.h:7
 hparticlepair.h:8
 hparticlepair.h:9
 hparticlepair.h:10
 hparticlepair.h:11
 hparticlepair.h:12
 hparticlepair.h:13
 hparticlepair.h:14
 hparticlepair.h:15
 hparticlepair.h:16
 hparticlepair.h:17
 hparticlepair.h:18
 hparticlepair.h:19
 hparticlepair.h:20
 hparticlepair.h:21
 hparticlepair.h:22
 hparticlepair.h:23
 hparticlepair.h:24
 hparticlepair.h:25
 hparticlepair.h:26
 hparticlepair.h:27
 hparticlepair.h:28
 hparticlepair.h:29
 hparticlepair.h:30
 hparticlepair.h:31
 hparticlepair.h:32
 hparticlepair.h:33
 hparticlepair.h:34
 hparticlepair.h:35
 hparticlepair.h:36
 hparticlepair.h:37
 hparticlepair.h:38
 hparticlepair.h:39
 hparticlepair.h:40
 hparticlepair.h:41
 hparticlepair.h:42
 hparticlepair.h:43
 hparticlepair.h:44
 hparticlepair.h:45
 hparticlepair.h:46
 hparticlepair.h:47
 hparticlepair.h:48
 hparticlepair.h:49
 hparticlepair.h:50
 hparticlepair.h:51
 hparticlepair.h:52
 hparticlepair.h:53
 hparticlepair.h:54
 hparticlepair.h:55
 hparticlepair.h:56
 hparticlepair.h:57
 hparticlepair.h:58
 hparticlepair.h:59
 hparticlepair.h:60
 hparticlepair.h:61
 hparticlepair.h:62
 hparticlepair.h:63
 hparticlepair.h:64
 hparticlepair.h:65
 hparticlepair.h:66
 hparticlepair.h:67
 hparticlepair.h:68
 hparticlepair.h:69
 hparticlepair.h:70
 hparticlepair.h:71
 hparticlepair.h:72
 hparticlepair.h:73
 hparticlepair.h:74
 hparticlepair.h:75
 hparticlepair.h:76
 hparticlepair.h:77
 hparticlepair.h:78
 hparticlepair.h:79
 hparticlepair.h:80
 hparticlepair.h:81
 hparticlepair.h:82
 hparticlepair.h:83
 hparticlepair.h:84
 hparticlepair.h:85
 hparticlepair.h:86
 hparticlepair.h:87
 hparticlepair.h:88
 hparticlepair.h:89
 hparticlepair.h:90
 hparticlepair.h:91
 hparticlepair.h:92
 hparticlepair.h:93
 hparticlepair.h:94
 hparticlepair.h:95