Difference between revisions of "Analysis TTreeFormat"
From GlueXWiki
(→DTreeStep) |
|||
Line 16: | Line 16: | ||
== DTreeParticle == | == DTreeParticle == | ||
− | * Roughly mirrors DKinematicData | + | * Roughly mirrors DKinematicData: kinematics + PID info of track |
* p3, v3, and t are stored at both the start (production) and end points (decay, TOF/BCAL/FCAL hit) of the track. | * p3, v3, and t are stored at both the start (production) and end points (decay, TOF/BCAL/FCAL hit) of the track. | ||
** This is primarily motivated by the Ξ<sup>-</sup>, which is long-lived and whose trajectory is bent by the magnetic field before it decays. | ** This is primarily motivated by the Ξ<sup>-</sup>, which is long-lived and whose trajectory is bent by the magnetic field before it decays. | ||
+ | * Extensible: maps can be used by users to add their own custom information. | ||
<syntaxhighlight> | <syntaxhighlight> | ||
class DTreeParticle : public TObject | class DTreeParticle : public TObject | ||
Line 68: | Line 69: | ||
== DTreeStep == | == DTreeStep == | ||
− | * | + | * Roughly mirrors DParticleComboStep: collection of DTreeParticle's for a given step of a reaction (e.g. photoproduction, Λ decay, π<sup>0</sup> decay, etc.) |
+ | * Extensible: maps can be used by users to add their own custom information. | ||
<syntaxhighlight> | <syntaxhighlight> | ||
class DTreeStep : public TObject | class DTreeStep : public TObject | ||
Line 90: | Line 92: | ||
== DTreeCombo == | == DTreeCombo == | ||
+ | * Roughly mirrors DParticleCombo (collection of DTreeStep's for a given reaction), + detected particles not used in the combo | ||
+ | * Extensible: maps can be used by users to add their own custom information. | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | |||
class DTreeCombo : public TObject | class DTreeCombo : public TObject | ||
{ | { | ||
Line 121: | Line 124: | ||
== DTreeEvent == | == DTreeEvent == | ||
+ | * Contains DTreeCombo's for each output DReaction, + thrown tracks | ||
+ | * Extensible: maps can be used by users to add their own custom information. | ||
<syntaxhighlight> | <syntaxhighlight> | ||
class DTreeEvent : public TObject | class DTreeEvent : public TObject |
Revision as of 11:43, 12 April 2013
Why?
- With a standard TTree format can streamline (and provide a best-practices implementation of): analysis utilities, BDT setup/input, amplitude analysis setup/input(?)
- Makes it easy for users to keep everything organized, especially the combinatoric background information.
- Can be enabled/disabled with a single flag.
- Is extensible (customizable) at every level.
Summary
- Data Structures:
- DTreeParticle roughly mirrors DKinematicData: kinematics + PID info of track
- DTreeStep roughly mirrors DParticleComboStep: collection of DTreeParticle's for a given step of a reaction (e.g. photoproduction, Λ decay, π0 decay, etc.)
- DTreeCombo roughly mirrors DParticleCombo (collection of DTreeStep's for a given reaction), + detected particles not used in the combo
- DTreeEvent contains DTreeCombo's for each output DReaction, + thrown tracks
- Extensible:
- Each class has maps to contain additional data (TObject* and double, map keys are string): users can add their own custom information here
- Otherwise they can make a friend TTree to add branches to the existing tree.
DTreeParticle
- Roughly mirrors DKinematicData: kinematics + PID info of track
- p3, v3, and t are stored at both the start (production) and end points (decay, TOF/BCAL/FCAL hit) of the track.
- This is primarily motivated by the Ξ-, which is long-lived and whose trajectory is bent by the magnetic field before it decays.
- Extensible: maps can be used by users to add their own custom information.
class DTreeParticle : public TObject { public: // PID: Particle_t dPID; // KINEMATICS: //If kinematic fit was performed, this is the kinematic fit results. Else is measured results. TVector3 dPosition_Start; //the position where the particle is produced double dTime_Start; //time of the track at dPosition_Start: if value is not kinfit, is projected from measured TOF/BCAL/FCAL time TVector3 dMomentum_Start; //momentum of the track at dPosition_Start TVector3 dPosition_End; //detected particles: the reconstructed position of the BCAL/FCAL/TOF hit; decaying particles: the point where it decays double dTime_End; //time of the track at dPosition_End TVector3 dMomentum_End; //momentum of the track at dPosition_End double dPathLength; //from dPosition_Start to dPosition_End TMatrixDSym dCovarianceMatrix; //at dPosition_Start // Order is (px, py, pz, x, y, z, t) // PID QUALITY: unsigned int dNDF_Tracking; //0 if neutral or decaying double dChiSq_Tracking; //NaN if neutral or decaying unsigned int dNDF_Timing; //0 if no TOF/BCAL/FCAL hit (e.g. slow protons) double dChiSq_Timing; //NaN if no TOF/BCAL/FCAL hit (e.g. slow protons) unsigned int dNDF_DCdEdx; //0 if neutral or decaying double dChiSq_DCdEdx; //NaN if neutral or decaying // DEPOSITED ENERGY: //0.0 if no hit double ddEdx_FDC; double ddEdx_CDC; double dEnergy_BCAL; double dEnergy_FCAL; double dEnergy_TOF; // DTREESTEP POINTERS: DTreeStep* dProductionStep; //the step object in which this DTreeParticle is produced (is a final-state particle) DTreeStep* dDecayStep; //the step object in which this DTreeParticle decays (is an initial-state particle) (will be null if not a decaying particle!) // CUSTOM VARIABLES: map<string, double> dCustomVariables; //key is unique string, double is value map<string, const TObject*> dCustomObjects; //key is unique string, TObject* is object ClassDef(DTreeParticle, 1) };
DTreeStep
- Roughly mirrors DParticleComboStep: collection of DTreeParticle's for a given step of a reaction (e.g. photoproduction, Λ decay, π0 decay, etc.)
- Extensible: maps can be used by users to add their own custom information.
class DTreeStep : public TObject { public: // INITIAL PARTICLES: const DTreeParticle* dInitialParticle; //if is null: decaying or beam particle not yet set! const DTreeParticle* dTargetParticle; //NULL for no target // FINAL PARTICLES: deque<DParticle_t> dFinalParticleIDs; //separate in case particle is NULL (e.g. decaying resonance) deque<const DTreeParticle*> dFinalParticles; //particle may be NULL if it is decaying or missing (especially if no kinematic fit was performed!!) // CUSTOM VARIABLES: map<string, double> dCustomVariables; //key is unique string, double is value map<string, const TObject*> dCustomObjects; //key is unique string, TObject* is object ClassDef(DTreeStep, 1) };
DTreeCombo
- Roughly mirrors DParticleCombo (collection of DTreeStep's for a given reaction), + detected particles not used in the combo
- Extensible: maps can be used by users to add their own custom information.
class DTreeCombo : public TObject { public: // STEPS: deque<const DTreeStep*> dTreeSteps; // RF: bool dRFTimeMatchQuality; //true if good (certain), false if bad (not confident in value (e.g. no "good" tracks have TOF hits)) double dRFTime; double dRFTimeUncertainty; // UNUSED PARTICLES: vector<const DTreeParticle*> dUnusedDetectedParticles; vector<const DTreeShower*> dUnusedDetectedShowers; // KINEMATIC FIT: DKinFitType dKinematicFitType; //Defined in DKinFitResults.h //d_NoFit if not performed double dChiSq_KinematicFit; //NaN if not performed unsigned int dNDF_KinematicFit; //0 if not performed // CUSTOM VARIABLES: map<string, double> dCustomVariables; //key is unique string, double is value map<string, const TObject*> dCustomObjects; //key is unique string, TObject* is object ClassDef(DTreeCombo, 1) };
DTreeEvent
- Contains DTreeCombo's for each output DReaction, + thrown tracks
- Extensible: maps can be used by users to add their own custom information.
class DTreeEvent : public TObject { public: // RUN, EVENT #'s: unsigned int locRunNumber; unsigned int locEventNumber; // DATA: map<string, deque<const DTreeCombo*> > dTreeCombos; //string key is (D)Reaction name, deque is the particle combos deque<const DTreeParticle*> dThrownParticles; // CUSTOM VARIABLES: map<string, double> dCustomVariables; //key is unique string, double is value map<string, const TObject*> dCustomObjects; //key is unique string, TObject* is object ClassDef(DTreeEvent, 1) };