630 likes | 791 Views
BESIII Analysis Software and Event Data Model. Kanglin He 23 Feb, 2006 hekl@ihep.ac.cn. Outline. BESIII Analysis Software Analysis Tools -- K.L He Analysis Framework -- X.B Ji Event/Physics Tag -- X.H Mo BESIII Event Data Model MC Truth Event Data Model -- W.D Li
E N D
BESIII Analysis Software andEvent Data Model Kanglin He 23 Feb, 2006 hekl@ihep.ac.cn
Outline • BESIII Analysis Software • Analysis Tools -- K.L He • Analysis Framework -- X.B Ji • Event/Physics Tag -- X.H Mo • BESIII Event Data Model • MC Truth Event Data Model -- W.D Li • Rec/Dst Event Data Model -- S.P Wen • Analysis Event Data Model -- K.L He • Physics Event Data Model -- Physics Group • Statistic Analysis Software -- Y.S Zhu • Statistical Significance • Toy Monte Carlo • PWA and Dalitz Analysis -- H.B Li
Analysis Software • Tools Project (K.L. He) • Particle ID • Composition Tools • BParticle Project (X. B. Ji) • Charged, Neutral Track Selection • Ks, Λ, π0/η Reconstruction • Event/Physics Tag Project (X. H. Mo) • Event Classification • Luminosity Determination • Event Collection, filter • Physics Performance Check (X. B. Ji)
Particle ID • DedxPID: dE/dx info • Ready now, correction was made • Tof1PID: inner barrel TOF • Ready now, correction was made • Tof2PID: outer barrel TOF • Ready now, correction was made • TofEPID: Endcap TOF • Not readdy now, due to reconstruction • TofQPID: Q of Barrel TOF • Not ready now, need detail study on Calibration • EmcPID: energy deposit in EMC • Not ready now, Wang Liangliang is working at • ParticleID • Combine the above info • MuonID • Develop by PKU • ParticleIDBase • For developer only
ParticleIDBase class (I)common interface public: virtual bool IsPidInfoValid() = 0; virtual double chi(int n) const = 0; virtual double prob(int n) const = 0; virtual int ndof() const = 0; DstTrkList* PidTrk() const {return m_trk;} protected: // PID calculation routines(include PID correction) virtual int particleIDCalculation() = 0;
Sub-PidSys class design class Tof1PID : public ParticleIDBase { public: // constructor & desconstructor Tof1PID(DstTrkList *dstTrk, double chi=4); ~Tof1PID(){;} bool IsPidInfoValid() {return (m_ndof > 0); } double chi(int n) const {return m_chi[n];} double prob(int n) const {return m_prob[n];} int ndof() const {return m_ndof;} protected: int particleIDCalculation(); double offsetTof1(int n, int cntr, double ptrk, double ztof, double ph); double sigmaTof1(int n, int cntr, double ptrk, double ztof, double ph); private: xxxxx; }
How to use ParticleID // Be careful to avoid memory leakage ParticleID *pid = 0; for (int i = 0; i < ncharg; i++) { DstTrkList *dstTrk = *(dstTrkListCol->begin() + i); if(pid) delete pid; pid = new ParticleID(dstTrk); pid->usePidSys(pid->useDedx() | pid->useTof1() | pid->useTof2() )|; // pid->usePidSys(pid->useDedx()); // pid->usePidSys(pid->useTof1()); // pid->usePidSys(pid->useTof2()); pid->identify(pid->onlyPion() | pid->onlyKaon()); // pid->identify(pid->onlyPion()); // pid->identify(pid->onlyKaon()); pid->calculate(); if(!(pid->IsPidInfoValid())) continue; // user's selections } if(pid) delete pid;
Composition Tools • Telesis • BESII Kinematic Fit package • C++ implemented by SDU • BKlamsVTX • BESII Ks, Λ reconstruction package • C++ implemented by Dr. B.J. Liu • VertexFit • New stuff, by K. L He • VertexFit • SecondVertexFit • KinematicFit
Status of Telesis • Track presentation • (φ,κ,λ) for charged track • (φ,λ, E) for neutral track • Constraints • Resonance • Momentum-energy conservation • Miss track • Worked smoothly in BOSS
TKinematicFit #include"Telesis/TKinematicFit.h" TKinematicFit* kmfit = TKinematicFit::instance(); DstMdcTrack *pipTrk=xxx; DstMdcTrack *pimTrk = xxx; DstEmcTrack *g1Trk = xxx; DstEmcTrack *g2Trk = xxx; kmfit->init(ecms); kmfit->AddTrack(1, pipTrk, mpi, 0); kmfit->AddTrack(2, pimTrk, mpi, 0); kmfit->AddTrack(3, g1Trk, 0.0, 0); kmfit->AddTrack(4, g2Trk, 0.0, 0); kmfit->AddResonance(1, 0.135, 3, 4); If(kmfit->fit()) { HepLorentzVector ppip = kmfit->pfit(1); HepLorentzVector ppim = kmfit->pfit(2); HepLorentzVector ppi0 = kmfit->pfit(3) + kmfit->pfit(4); // user code, fill histogram/ntuple } // see Analysis/Physics/RhopiAlg/RhopiAlg-00-00-02 for detail
Status of BKlamsVTX • Get the point (s) of intersection of two helices in transverse plane • Check if the 2nd vertex candidate is located in reasonable region • Worked smoothly in BOSS Analysis/Physics/KlamsTestAlg for detail
Status of Vertex Fit • Formulas (adopt from Paul Avery’s Lessons) • Include: VertexFit, KinematicFit and 3-D SecondVertexFit • Support Composed Particle • Reconstructed π0, η • Reconstructed Ks, Λ • Particle and Vertex presentation
Vertex Constraints • Vertex constraint to a fixed position • Vertex constraint to an unknown position • General Vertex fit • Swimming Track parameters and Error matrix to vertex position
SecondVertexFit • Find decay vertex position of Ks/Λthrough VertexFit • Performing a 2-C fit by applying the alignment constraints • Calculating the decay length and its error Xp: production position (beam position) Xd: decay position
Build Virtual Particle • Virtual Particle from KinematicFit • π0/η,… • Virtual Particle from VertexFit • Ks/Λ, … • Can be treated as a normal particle in further kinematic/Vertex fit • BuildVirtualParticle(number) in KinematicFit / VertexFit
AddTrack Utility // event data model dependent void AddTrack(const int number, const double mass, const DstMdcTrack *trk); void AddTrack(const int number, const double mass, const DstMdcKalTrack *trk); void AddTrack(const int number, const double mass, const DstEmcTrack *trk); // event data model independent void AddTrack(const int number, const WTrackParameter wtrk);
Kinematic Constraints • Invariant mass constraints • AddResonance(number, mass, n1, n2, ...) • Total energy constraints • AddTotalEnergy(number, energy, n1, n2, …) • Total Momentum constraints • AddTotalMomentum(number, ptot, n1, n2, …) • Total 3-momentum constraints • AddThreeMomentum(number, Hep3Vector p3, n1, n2, …) • Total 4-momentum constraints • AddFourMomentum(number, HepLorentzVector p4, n1, n2, …) • AddFourMomentum(number, etot, n1, n2, …) • Equal mass constraints • AddEqualMass(kmfitAddList(n1, n2, …), kmfitAddList(m1, m2, ….))
How to use compose tools TKinematicFit *kmfit=TKinematicFit::instance(); VertexFit *vtxfit=VertexFit::instance(); SecondVertexFit *vtxfit = SecondVertexFit::instance(); KinematicFit *kmfit=KinematicFit::instance(); kmfit->init(); // Track and constraints if(kmfit->Fit()) {//extract kinematic fit information;} vtxfit->init(); // Track and constraints if(vtxfit->Fit()) {// extract (Second)VertexFit information;}
Summary of Analysis Tools • Particle ID package • Hadron identification by combined TOF and dE/dx information • Muon identification by MuonID • Electron identification is not completed • All Composition Tools packaged are worked smoothly and stably in BOSS
B(es)Particle Project • Write Particle (Charged tracks, neutrals, Vertice and composed particle) information into TDS. Analysis Algorithm can access these info. • May develop to a common standard platform, make Analysis job easily and friendly • Allow Physics groups to design Physics Data model easily
Contents • BParticle Collection • Event Analysis Event Data Model • BParticleID Collection • Particle identification data • BTrack Collection • Charged and Neutral Track infomation data • BVertex Collection • (2nd)Vertex Reconstruction data • BStableParticle Collection • Photon, Electron, Muon, Pion, Kaon, Proton • BComposedParticle Collection • π0,η,Ks,Λ etc
Event/Physics Tags Project • Event Classification • Bhabha/Dimu/Hadron/etc. • Luminosity Determination • Bhabha/Dimu/Di-photon • Physics Tags • Charm Meson Tags (D0, D+, Ds) • J.Y Zhang, Y.Z Sun, S.S Sun, M. Yang are working on • J/Ψ tags (Ψ’ππJ/Ψ) • X.H Mo, Li Gang are working on • Other Physics Tags • Event Collection/Filter (Y.Z Sun and Framework Team) • Event Collection • Filter: sub-sets of data containing selected tags
Statistic Analysis • Statistic Significance • Up Limit determination • Systematic Uncertainties Theory • Toy Monte Carlo
Event Data Model • MC Truth information • Monte Carlo Generator & Simulation • Dst Event Data Model • Reconstruction • Truth Match • MC track Rec/Dst track • Analysis Event Data Model • BParticle project • Physics Event Data Model • Defined by Physics/Working Group • Histograms, ntuples • Root, paw……
Generator McParticle So on Kinematic and vertex info Simulation MdcMcHit TofMcHit EmcMcHit MucMcHit MC Truth Data Model Please see Event/McTruth/ subdirectory For detail
Dst Event Data Model • DstMdcTrack • DstMdcKalTrack • DstDedx • DstTofTrack • DstEmcTrack • DstMucTrack • DstExtTrack Please see Event/DstEvent subdirctory For detail
int trackID() int charge() Double helix(int i) Double pxy() Double px() Double py() Double pz() Double p() Double theta() Double phi() Double x() Double y() Double z() Double r() Int stat() Double chi2() Int ndof() Double rms() Double err(int i) Int nhits() Int nster() DstMdcTrack
How to use DstMdcTrack #include “Event/DstMdcTrack.h” MsgStream log(msgSvc(), name()); SmartDataPtr<DstMdcTrackCol> mdcCol(eventSvc(), EventModel::Dst::DstMdcTrackCol); If(!mdcCol) return StatusCode::SUCCESS; DstMdcTrackCol::iterator it = mdcColbegin(); for( ; it < mdcColend() ; it++) { //px, py, pz log<<MSG::INFO<<“px, py, pz = “ <<(*it)px() <<“ , “ // px <<(*it)py() <<“ , “ // py <<(*it)pz() << endreq; // pz // x, y, z, r log<<MSG::INFO<<“ x0, y0, z0, rxy = “ << (*it)x() << “ , “ // x0 <<(*it)y() << “ , “ // y0 <<(*it)z() << “ , “ // z0 <<(*it)r() << endreq; // rxy }
Global Link • MDC reconstruction • dE/dx, Kalman fit track • Match to TOF and Muon counter Track • Applying Track Extrapolatio information, done in Reconstruction • Match to EMC • Position difference of extTrk and emc Track, treat as Neutral tracks if not matched See Wang L.L ‘s talk for detail
Dst Track List Collection • trackID() • MdcTrk() DstMdcTrack • MdcKalTrk() DstMdcKalTrack • Dedx() DstDedx • TofTrk() DstTofTrack • EmcTrk() DstEmcTrack • MucTrk() DstMucTrack • ExtTrk() DstExtTrack Access sub-detector info through a set of pointers
TrackList (track level) int trackID() const {return m_trackID;} bool IsMdcTrkValid() {return (m_originMdcTrack != 0);} bool IsMdcKalTrkValid() {return (m_originMdcKalTrack != 0);} bool IsDedxValid() {return (m_originDedx != 0);} bool IsTofTrkValid() {return (m_originTofTrack != 0);} bool IsEmcTrkValid() {return (m_originEmcTrack != 0);} bool IsMucTrkValid() {return (m_originMucTrack != 0);} bool IsExtTrkValid() {return (m_originExtTrack != 0);} DstMdcTrack* MdcTrk() {return m_originMdcTrack;} DstMdcKalTrack* MdcKalTrk() {return m_originMdcKalTrack;} DstDedx* DedxTrk() {return m_originDedx;} DstTofTrack* TofTrk() {return m_originTofTrack;} DstEmcTrack* EmcTrk() {return m_originEmcTrack;} DstMucTrack* MucTrk() {return m_originMucTrack;} DstExtTrack* ExtTrk() {return m_originExtTrack;}
How to access Dst Event Data In analysis source code: #include “Event/DstTrkList.h” SmartDataPtr<DstTrkListCol> dstCol ( eventSvc(), EventModel::Dst::DstTrackListCol) // To get Energy deposit in Emc DstTrkListCol::iterater itTrk = dstColbegin() For(; itTrk < dstColend(); itTrk++) { if((*itTrk)IsEmcTrkValid()) { DstEmcTrack *emcTrk = (*itTrk)EmcTrk(); double energy = emcTrkenergy(); // piece of analysis code, fill histogram/ntuple } } In analysis job option file: #include “$DSTEVENTASSEMBLYALGROOT/jobOptions_DstEventAssembly.txt”
MC Truth Track Association • Match MC truth track & Reconstructed Track • Dubna group is working on • MDC track part is ready now EventNavigator Package Documentation in BES3 Software Web Page
Analysis Event Data Model • BParticle Collection • Event Analysis Event Data Model • BParticleID Collection • Particle identification data • BTrack Collection • Charged and Neutral Track infomation data • BVertex Collection • (2nd)Vertex Reconstruction data • BStableParticle Collection • Photon, Electron, Muon, Pion, Kaon, Proton • BComposedParticle Collection • π0,η,Ks,Λ etc
BParticle Collection // track List ID int m_trackID; // PDG ID int m_particleID; // reference point(0, 0, 0) HepPoint3D m_refpoint; // WTrackparameters(charge, px, py, pz, e, x, y, z) WTrackParameter m_wtrk; SmartRef<DstTrkList> m_dstTrk; // Dst TrackList SmartRef<BParticleID> m_pid; // ParticleID info SmartRef<BVertex> m_vertex; // Vertex info SmartRef<BComposeParticle> m_bcompart; // ComposeParticle SmartRef<BParticle> m_mother; // mother SmartRefVector<BParticle> m_daughters; //decay daughters
BParticleID Collection int m_trackID; // TrackList ID int m_type; // 1: electron 2: muon 3: pi/K/p int m_ndof; double m_chiDedx[5]; double m_chiTof1[5]; double m_chiTof2[5]; double m_chiTofE[5]; double m_chiTofQ[5]; double m_chiEmc[5]; double m_prob[5]; double m_chisq[5];
BVertex Collection int m_vertexID; VertexType m_vertexType; VertexParameter m_vpar; double m_chisq; int m_ndof; WTrackParameter m_wtrk; double m_lxyz; double m_lxyz_err; SmartRefVector<BParticle> m_outgo;
bool isNeutral(); bool isCharged(); bool isGoodTrack(); bool isPhoton(); bool isDaughter(); bool isUnknown(); bool isElectron(); bool isMuon(); bool isPion(); bool isKaon(); bool isProton(); BTrack Collection Selection Criteria controlled by job option file
BParticle in Analysis #include “BParticle/BParticle.h” #include “BParticle/BParticleID.h” #include “BParticle/BVertex.h” #include “BParticle/StableParticle.h” #include “BParticle/BComposedParticle.h” // get pion Lists SmartDataPtr<BPionCol> pionCol(eventSvc(), EventModel::Analysis::BPionCol); // get Kaon Lists SmartDataPtr<BKaonCol> kaonCol(eventSvc(), EventModel::Analysis::BKaonCol); // get Photon Lists SmartDataPtr<BPhotonCol> photonCol(eventSvc(), EventModel::Analysis::BPhotonCol); //get KShort Lists SmartDataPtr<BKShortCol> ksCol(eventSvc(),EventModel::Analysis::BKShortCol); //get pi0 Lists SmartDataPtr<BPi0Col> pi0Col(eventSvc(), EventModel::Analysis::BPi0Col); //DO not forget to add following line in your job option file #include “$PARTICLESELECTIONALGROOT/share/jobOPtions_ParticleSelection.txt”
BParticleTestAlg • Package: Analysis/Physics/BParticleTestAlg • Contents • Inclusive Photon • Inclusive J/Psi • Inclusive phi/omega/K* • Inclusive pi0/eta • Inclusive Ks/Lambda • Job option file • #include “BPARTICLETESTALGROOT”/share/joboptions_BParticleTestAlg.txt
BCharmMeson Collection D0 K pi, K pi pi0, K pi pi pi, … D+ Ks pi, K pi pi, K pi pi pi0, … Ds Phi pi, K*K, K0K, … BJPsi Collection J/Psimu+ mu- J/Psie+ e- Psi’ pi pi J/Psi Physics Event Data Model Designed by Physics Group
Histogram and Ntuples • Root data format • HBOOK data format • Both are supported by Gaudi ROOT PAW
Versions Rec/Cal/Anal/MC/DAQ/… DAQ/Trigger Mode Cosmic Collision Separate Beam run Event Type Bhabha/Dimu/diphoton Calibration event Physics event … Run Status Good/Bad/Usable Run Parameters Beam parameters Luminosity Magnetic Field … Data Correction Constants PID (TOF, dE/dx, Emc, Muc) Momentum correction factor … Analysis Environment