ROOT logo
HYDRA - THE HADES ANALYSIS PACKAGE » (UNKNOWN) » HParticleGeantEvent

class HParticleGeantEvent: public TObject

_HADES_CLASS_DESCRIPTION



 HParticleGeantEvent

 Simulation object keeping HGeant pointers and decays to ease
 the geant use.



 USAGE:


  HParticleGeantEvent geantevent; // create the object out side event loop



  for (Int_t i=0; i < entries; i++) {
    Int_t nbytes =  loop.nextEvent(i);             // get next event. categories will be cleared before
    if(nbytes <= 0) { cout<<nbytes<<endl; break; } // last event reached


    geantevent.nextEvent(); // fill the geant event structure

    cout<<"event "<<i<<"------------------------------------------"<<endl;
    cout<<"impact : "<<geantevent.getImpactParam()<<", beam E: "<< geantevent.getBeamEnergy()<< ", event plane: "<<geantevent.getEventPlane()<<endl;
    cout<<"mult charged prim 4pi "<<geantevent.getMultiplicity(-1,0,0,0)             // id,generation,charge,type,detbits
        <<" acc "<< geantevent.getMultiplicity(-1,0,0,1)
        <<" reco true iMDC+oMDC+META "<<geantevent.getMultiplicity(-1,0,0,2,kIsInInnerMDC|kIsInOuterMDC|kIsInMETA)
        <<" reco true all "<<geantevent.getMultiplicity(-1,0,0,2,0)
        <<endl;

    //----------------------------------------------------
    // example 1:
    for(UInt_t j = 0; j < geantevent.getDecays().size(); j++ ){
        HParticleGeantDecay* decay = geantevent.getDecays()[j];
        if(decay->getDistFromVertex()<100 ) decay->print(); // print all decays max 10cm arround 0,0,0
    }

    //----------------------------------------------------
    // example 2 :
    vector<HParticleGeantDecay*> decays;      // a decay keeps pointer to mother and daughters and the mother decay
    geantevent.isDecay(decays,52,-1);         // all omgegas from PLUTO (external : generation = -1) filter params :  motherid, generation, med, dist
    for(UInt_t j = 0; j < decays.size(); j++) {
       decays[j] ->print();
    }
    //----------------------------------------------------
    // example 3 :
    geantevent.isDecay(decays,18,0);          // all primary lambda decays (urqmd+PLUTO(is not decayed outside GEANT))
    vector<Int_t > pids;
    pids.push_back(14);  // proton
    pids.push_back(9);   // pion
    for(UInt_t j = 0; j < decays.size(); j++) {
       HParticleGeantDecay* lambda = decays[j];
       if(!lambda->isExternalSource()) continue;  // keep only PLUTO
       if(lambda->isDaughter(pids)) // both particles found

       vector<HGeantKine*>& daughters = lambda->getDaughters();
       for(UInt_t l = 0; l < daughters.size(); j++){
           HParticleGeant* p = geantevent.getParticle(daughters[l]);
           if(p->isInAcceptance()){
             Int_t nReco p->getNRecoCand(); // number of HParticleCandSim keeping this geant track
             for(Int_t k=0; k < nReco; k++){
                 if(!p->getRecoCand(k)->isGhostTrack() && p->getRecoCand(k)->isIndDetectors(kIsInInnerMDC||kIsInOuterMDC|kIsInMETA)) { // true reco

                 }
             }
           }
        }

    }

    //----------------------------------------------------
    // example 4 :
    vector<HParticleGeant*> particles;
    geantevent.isParticle(particles,2,-2,0); // all primary positrons  possible filter params : id,motherid,generation,med,dist
    for(UInt_t j = 0; j < particles.size(); j++) {
        particles[j]->print();
        HParticleGeantDecay* d = particles[j]->getMotherDecay(); // will even work for PLUTO decayed particles
        if(d) d->print();
    }
    //----------------------------------------------------
    // example 5 :
    HParticleCandSim* cand1=0;
    for(Int_t j = 0; j < particleCat->getEntries(); j ++){
        cand1 = HCategoryManager::getObject(cand1,particleCat,j);
        if(!cand1->isFlagBit(Particle::kIsLepton)) continue;

        Int_t tr = cand1->getGeantTrack();
        HParticleGeant* p      = geantevent.getParticle(tr);
        HParticleGeantDecay* d = p->getMotherDecay();    // mother decay
        Int_t nDaughter        = d ->getNDaughters();
        HGeantKine* sister = 0;
        for(Int_t k=0; k < nDaughter; k++){              // find sister track
            sister = d->getDaughter(k);
            if(sister->getTrack() != p->getParticle()->getTrack()) break;
        }
        HParticleGeant* pSister = geantevent.getParticle(sister);

        Int_t nReco p->getNRecoCand(); // number of HParticleCandSim keeping this geant track
        for(Int_t k=0; k < nReco; k++){
           p->getRecoCand(k)->print(); // all candidates sharing the same geant track
        }
        nReco pSister->getNRecoCand(); // number of HParticleCandSim keeping this geant track
        for(Int_t k=0; k < nReco; k++){
           p->getRecoCand(k)->print(); // all candidates sharing the same geant track
        }
    }
  } // end eventloop

Function Members (Methods)

public:
HParticleGeantEvent()
HParticleGeantEvent(const HParticleGeantEvent&)
virtual~HParticleGeantEvent()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Float_tgetBeamEnergy()
vector<HParticleGeantDecay*>&getDecays()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Float_tgetEventPlane()
HGeomVector&getEventVertex()
vector<HGeantKine*>&getExternalParticles()
virtual const char*TObject::GetIconName() const
Float_tgetImpactParam()
HGeantKine*getKine(Int_t track)
UInt_tgetMultiplicity(Int_t id = -10, Int_t generation = 0, Int_t charge = 0, UInt_t type = 1, UInt_t detbits = kIsInInnerMDC|kIsInOuterMDC|kIsInMETA)
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
HParticleGeant*getParticle(Int_t track)
HParticleGeant*getParticle(HGeantKine*)
vector<HParticleGeant*>&getParticles()
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
HParticleGeantDecay*isDaughterOfDecay(HGeantKine* daughter)
HParticleGeantDecay*isDaughterOfDecay(Int_t track)
Int_tisDecay(vector<HParticleGeantDecay*>& decays, Int_t motherid = -2, Int_t generation = -2, Int_t med = -2, Float_t dist = 0)
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
HParticleGeantDecay*isMotherOfDecay(Int_t track)
HParticleGeantDecay*isMotherOfDecay(HGeantKine* moth)
Bool_tTObject::IsOnHeap() const
Int_tisParticle(vector<HGeantKine*>& particles, Int_t id = -2, Int_t motherid = -2, Int_t generation = -2, Int_t med = -2, Float_t dist = 0)
Int_tisParticle(vector<HParticleGeant*>& particles, Int_t id = -2, Int_t motherid = -2, Int_t generation = -2, Int_t med = -2, Float_t dist = 0)
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
voidnextEvent()
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
HParticleGeantEvent&operator=(const HParticleGeantEvent&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidsetConvertExtThermal(Bool_t convert)
voidsetCorrectGenInfo(Bool_t cor)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
voidclear()

Data Members

private:
Bool_tbConvertExtThermal(default: kTRUE) convert id for external thermal source (sourceID-500)
Bool_tbCorrectInfo(default: kTRUE) correct geninfo bug from HGeant2 <= 3.2
Float_tfBeamEnergy[MeV]
Float_tfEventPlane[deg]
Float_tfImpactParam[fm]
HGeomVectorfeventVertex[mm]
map<HGeantKine*,vector<HGeantKine*> >mToDaughterskine -> vector of daughters
map<Int_t,HParticleGeant*>mToParticletrackNr -> particle
vector<HParticleGeantDecay*>vDecaysvector of all decays
vector<HParticleGeant*>vParticlesvector of all particles
vector<HGeantKine*>vexternalKinevector of all arteficial kine mother objects of external particle
vector<HGeantKine*>vexternalParticlesvector of all external (PLUTO) particles

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

HParticleGeantEvent()
~HParticleGeantEvent()
void clear()
void nextEvent()
HParticleGeantDecay* isDaughterOfDecay(HGeantKine* daughter)
 returns the decay for this daughter particle
 returns 0 if no matching decay is found
HParticleGeantDecay* isDaughterOfDecay(Int_t track)
 returns the decay for this kine daughter particle with tracknumber track
 returns 0 if no matching decay is found
HParticleGeantDecay* isMotherOfDecay(HGeantKine* moth)
 returns the decay for this mother particle
 returns 0 if no matching decay is found
HParticleGeantDecay* isMotherOfDecay(Int_t track)
 returns the decay for this kine mother particle with tracknumber track
 returns 0 if no matching decay is found
Int_t isDecay(vector<HParticleGeantDecay*>& decays, Int_t motherid = -2, Int_t generation = -2, Int_t med = -2, Float_t dist = 0)
 fills the vector of decays matching the conditions (vector is cleared automatically
 before filling).
 possible filters :   motherid (ID of the mother), ignored if < 0
                      generation of the decay (-1 : arteficial ext, 0 : primay mother ....), ignored if < -1
                      med (medium where the decay was created),  ignored if < 0
                      dist (distance of decay from primary vertex), ignored if ==0 ,
                            dist > 0 all decays < dist will be selected,
                            dist < 0 all decays > dist will be selected
Int_t isParticle(vector<HGeantKine*>& particles, Int_t id = -2, Int_t motherid = -2, Int_t generation = -2, Int_t med = -2, Float_t dist = 0)
 fills the vector of particles matching the conditions (vector is cleared automatically
 before filling).
 possible filters :   id (id of the particle), ignored if < 0
                      motherid (ID of the mother), ignored if < 0
                      generation of the decay (0 : primay mother ....), ignored if < 0
                      med (medium where the decay was created),  ignored if < 0
                      dist (distance of decay from primary vertex), ignored if ==0 ,
                            dist > 0 all decays < dist will be selected,
                            dist < 0 all decays > dist will be selected
Int_t isParticle(vector<HParticleGeant*>& particles, Int_t id = -2, Int_t motherid = -2, Int_t generation = -2, Int_t med = -2, Float_t dist = 0)
 fills the vector of particles matching the conditions (vector is cleared automatically
 before filling).
 possible filters :   id (id of the particle), ignored if < 0
                      motherid (ID of the mother), ignored if < 0
                      generation of the decay (0 : primay mother ....), ignored if < 0
                      med (medium where the decay was created),  ignored if < 0
                      dist (distance of decay from primary vertex), ignored if ==0 ,
                            dist > 0 all decays < dist will be selected,
                            dist < 0 all decays > dist will be selected
HParticleGeant* getParticle(Int_t track)
 return the particle belonging to the tracknumber track
 return 0 if no matching particle is found
HParticleGeant* getParticle(HGeantKine* )
 return the particle belonging to the kine track
 return 0 if no matching particle is found
HGeantKine* getKine(Int_t track)
 return the kine particle belonging to the track
 return 0 if no matching particle is found
UInt_t getMultiplicity(Int_t id = -10, Int_t generation = 0, Int_t charge = 0, UInt_t type = 1, UInt_t detbits = kIsInInnerMDC|kIsInOuterMDC|kIsInMETA)
 get particle multiplity
 id    :   id      < 0  -> all IDs,  (default)
           id      >= 0 -> particles of the given id
 gen   :   gen     < 0  -> all generations
           gen     = 0  -> primaries (default)
 charge  : charge  = 0  -> all charged particles (default)
           charge  = 1  -> all positive charged particles
           charge  =-1  -> all negative charged particles
           charge  =-2  -> all particles
 type  :   type    = 0  -> 4pi
           type    = 1  -> acceptance (default)
           type    = 2  -> reconstructed (requires kIsUsed + !isGhostTrack() + isInInnerMDC|isInOuterMDC|isInMETA)
 detbits : detbits = 0  -> ignored
           detbits = kIsInInnerMDC|kIsInOuterMDC|kIsInMETA  default
HParticleGeantEvent()
void setConvertExtThermal(Bool_t convert)
{ bConvertExtThermal = convert; }
void setCorrectGenInfo(Bool_t cor)
{ bCorrectInfo = cor; }
vector<HGeantKine*>& getExternalParticles()
HGeomVector& getEventVertex()
{ return feventVertex; }
vector<HParticleGeantDecay*>& getDecays()
{ return vDecays;}
vector<HParticleGeant*>& getParticles()
{ return vParticles;}
Float_t getBeamEnergy()
{ return fBeamEnergy;}
Float_t getEventPlane()
{ return fEventPlane;}
Float_t getImpactParam()
{ return fImpactParam;}