jlib
jlib is a collection of constants and functions designed for use with MyEvent.
You can get jlib at ~justinh/cleo/jlib.h
Before your main function, do #include "path_to_jlib/jlib.h"
Constants:
jlib defines constants for several common QQIds. For example, kPhoton corresponds to the QQID for a photon (1), and kD0 corresponds to the QQID for a D0 (27).
jlib also defines constants for DTag decay modes, as per DTag.h. For example, kD0toKpi corresponds to 0, and kDptoKPiPi corresponds to 200.
Good Particle Functions:
- isGoodPion - Returns true if z0 and d0 are within 5 cm/5 mm, respectively. Usage:
MyPion* pionPtr = (MyPion*)pions->At(iPion);
if ( isGoodPion(pionPtr) ) { }
- isGoodE9E25Shower - Returns true if shower is E9/E25 OK, not matched to a track, and not a hot channel. Usage:
MyShower* showerPtr =
(MyShower*)showers->At(iShower);
if ( isGoodE9E25Shower(showerPtr) ) { }
- isGoodShower - Returns true if shower is not matched to a track, and not a hot channel. Usage:
MyShower* showerPtr =
(MyShower*)showers->At(iShower);
if ( isGoodShower(showerPtr) ) { }
- isGoodPi0 - Returns true if both showers are E9/E25 OK, not matched to a track, not hot channels, and if the pull mass is within 3 σ. Usage:
MyPi0* pi0Ptr = (MyPi0*)pi0s->At(iPi0);
if ( isGoodPi0(pi0Ptr) ) { }
PID Functions:
- pikPID - Returns value of Δ σdE/dx2 - Δ LLH for K/π. This should return a negative number for pions, and a positive number for kaons. It takes a pion pointer. Usage:
MyPion* pionPtr = (MyPion*)pions->At(iPion);
if ( pikPID(pionPtr) < 5 ) { // Loose pion PID }
- kpiPID - Returns value of Δ σdE/dx2 - Δ LLH for K/π. This should return a negative number for pions, and a positive number for kaons. It takes a kaon pointer. Usage:
MyKaon* kaonPtr = (MyKaon*)kaons->At(iKaon);
if ( pikPID(kaonPtr) > -25 ) { // Loose kaon PID }
- emuPID - Returns value of Δ σdE/dx2 - Δ LLH for e/μ. This should return a negative number for muons, and a positive number for electrons. Due to the MyEvent structure, it requires both the electron pointer and the muon pointer to the same track. Usage:
MyElectron* electronPtr =
(MyElectron*)electrons->At(iElectron);
// Loop through muons
MyMuon* muonPtr = (MyMuon*)muons->At(iMuon);
if (muonPtr->GetTrack() == electronPtr->GetTrack() )
if ( emuPID(elecPtr, muPtr) < 5 ) { // Loose muon PID }
- passPiPID - Returns true if pion passes π/K balance from pikPID is less than zero. Usage:
MyPion* pionPtr = (MyPion*)pions->At(iPion);
if ( passPiPID(pionPtr) ) { // Standard pion PID }
- passKPID - Returns true if kaon passes π/K balance from pikPID is less than zero. Usage:
MyKaon* kaonPtr = (MyKaon*)kaons->At(iKaon);
if ( passKPID(kaonPtr) ) { // Standard kaon PID }
MC Functions:
- descendedFrom - Returns true if the MC particle has the parent particle as an ancestor. Usage:
MyMCParticle* mcPartPtr =
(MyMCParticle*)mcparticles->At(iMCPart);
if ( descendedFrom(mcPartPtr, kD0Bar) ) { }
- mcHaveDecay - Takes a MyMCParticle pointer and returns zero if the particle's decay does not have the proper daughter particles, returns 1 if it has the proper daughter particles only, and returns 2 if it has the proper daughter particles plus FSR. It is useful for looping through the decay tree to see if a particular decay is there. This function requires an integer array with the QQIDs of the desired daughters, the QQID of the desired parent, and the size of the array.
Note: There is a constant with the QQID of the FSR photon, which depends upon the release. It is currently set up for older releases (FSR QQID = 1). Usage:
MyMCParticle* mcPartPtr = (MyMCParticle*)mcparticles->At(iMCPart);
Int_t desired_decay[4] = {kKPlus, kPiMinus, kPiMinus, kPi0};
if ( mcHaveDecay(mcPartPtr, kDMinus, 4, desired_decay ) {// Don't care about FSR, finds D- -> K+ Pi- Pi- Pi0 }
- mcTrueDtag - Takes a MyDTag pointer (reconstructed particle) and the desired mode, and mcTrueDtag checks to see if the monte carlo says that the DTag is reconstructed correctly.
Note: By choice, modes like D0 -> KsKs are included in D0 -> KsPiPi. You can change this if desired by running mcTrueDtag on each and taking the difference.
This will not ensure that the proper particles came from the proper intermediates; if you have a KPiPi from K*Pi and you swap pions, it will still return true.
FSR particles are ignored (so mcTrueDtag will still return true)
Currently, modes like KsKplusPiPi and KsKminusPiPi are not differentiated (only the overall charge needs to be correct, not the charges of constituents).
Usage:
MyDTag* dtagPtr = (MyDTag*)dtags->At(iDtag);
if ( mcTrueDtag(dtagPtr, kDptoKPiPi) ) { // the D+ -> KPiPi was properly reconstructed }
- mcTrueKs - Returns true if the reconstructed Ks was properly reconstructed. Usage:
MyK0short* kshortPtr =
(MyK0short*)kshorts->At(iKshort);
if ( mcTrueKs(kshortPtr) ) { // Have a good Ks }
MC Write Functions:
- showDecay -- Prints the MyMCParticle's decay, using particle names. Usage:
MyMCParticle* mcPartPtr =
(MyMCParticle*)mcparticles->At(iMCPart);
showDecay(mcPartPtr); // Prints something like Pi0 -> gamma gamma
- showTree -- Shows the whole tree of decays starting from the given particle, to a maximum given by a parameter. If you want the whole decay tree, set the starting particle to the virtual photon and depth to something large (e.g. 20). Usage:
MyMCParticle* mcPartPtr =
(MyMCParticle*)mcparticles->At(iMCPart);
showTree(mcPartPtr, 3); // Shows all decays up to 3 branches down from mcPartPtr
- showFinalParticles -- Shows the observable particles that ultimately descend from the input MyMCParticle. Usage:
MyMCParticle* mcPartPtr =
(MyMCParticle*)mcparticles->At(iMCPart);
showFinalParticles(mcPartPtr); // If D0->K*Pi, displays D0 -> K- Pi0 Pi+
Last modified: Thu Oct 9 12:54:46 CDT 2008