BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcUtilitySvc.h
Go to the documentation of this file.
1#ifndef MDCUTILITYSVC_H
2#define MDCUTILITYSVC_H
3
4#include "GaudiKernel/IInterface.h"
5#include "GaudiKernel/Kernel.h"
6#include "GaudiKernel/Service.h"
7#include "GaudiKernel/IDataProviderSvc.h"
8#include "CLHEP/Matrix/Vector.h"
9#include "CLHEP/Matrix/SymMatrix.h"
10#include "CLHEP/Geometry/Vector3D.h"
11#include "CLHEP/Geometry/Point3D.h"
12
14#include "MdcRawEvent/MdcDigi.h"
20#include "Identifier/MdcID.h"
21#include "McTruth/McParticle.h"
22#include "McTruth/MdcMcHit.h"
23#include "TrackUtil/Helix.h"
24
25#include <vector>
26#include <map>
27
28//class MdcDigi;
29
30#ifndef ENABLE_BACKWARDS_COMPATIBILITY
31// backwards compatibility will be enabled ONLY in CLHEP 1.9
33#endif
34
35#ifndef ENABLE_BACKWARDS_COMPATIBILITY
36// backwards compatibility will be enabled ONLY in CLHEP 1.9
38#endif
39
40class MdcUtilitySvc: public extends<Service, IMdcUtilitySvc>{
41//class MdcUtilitySvc: public Service, virtual public IMdcUtilitySvc{
42 public:
43 MdcUtilitySvc( const std::string& name, ISvcLocator* svcloc );
45
46 virtual StatusCode initialize();
47 virtual StatusCode finalize();
48 //StatusCode queryInterface(const InterfaceID& riid, void** ppvUnknown);
49
50 int nLayerTrackPassed(const HepVector helix) const;
51 int nLayerTrackPassed(const double helix[5]) const;
52
53 HepVector patPar2BesPar(const HepVector& helixPar) const;
54 HepSymMatrix patErr2BesErr(const HepSymMatrix& err) const;
55 HepVector besPar2PatPar(const HepVector& helixPar) const;
56 HepSymMatrix besErr2PatErr(const HepSymMatrix& err) const;
57
58 double doca(int layer, int cell, const HepVector helix, const HepSymMatrix errMat, bool passCellRequired = true, bool doSag = true) const;
59 double doca(int layer, int cell, HepPoint3D eastP, HepPoint3D westP, const HepVector helixBes,const HepSymMatrix errMatBes, bool passCellRequired = true, bool doSag = true) const;
60 double doca(int layer, int cell, const MdcSWire* sWire, const HepVector helixPat, const HepSymMatrix errMatPat, bool passCellRequired = true) const;
61 double docaPatPar(int layer, int cell, const HepVector helixPat, const HepSymMatrix errMatPat, bool passCellRequired = true, bool doSag = true) const;
62 double docaPatPar(int layer, int cell, HepPoint3D eastP, HepPoint3D westP, const HepVector helixBes,const HepSymMatrix errMatBes, bool passCellRequired = true, bool doSag = true) const;
63 double docaPatPar(int layer, int cell, const MdcSWire* sWire, const HepVector helixPat, const HepSymMatrix errMatPat, bool passCellRequired = true) const;
64
65 HepPoint3D pointOnHelix(const HepVector helixPar, int lay, int innerOrOuter) const;
66 HepPoint3D pointOnHelixPatPar(const HepVector helixPat, int lay, int innerOrOuter) const;
67 bool cellTrackPassedByPhi(const HepVector helix,int layer, int& cellId_in, int& cellId_out) const;
68 bool cellTrackPassedByPhiPatPar(const HepVector helix,int layer, int& cellId_in, int& cellId_out) const;
69 bool cellTrackPassed(const HepVector helix,int layer, int& cellId_in, int& cellId_out) const;
70 bool cellTrackPassedPatPar(const HepVector helix,int layer,int& cellId_in,int& cellId_out) const;
71
72 HepPoint3D Hel(HepPoint3D piv, double dr,double phi0,double Alpha_L,double kappa,double dz,double dphi,double tanl) const;
73 double p_cms(HepVector helix, int runNo, double mass) const;
74 Hep3Vector momentum(const RecMdcTrack* trk) const;
75 double probab(const int& ndof, const double& chisq) const;
76 //std::vector<MdcDigi*> getMdcDigiVec() const;
78 //vector<vector<MdcDigi*> > ConnectionHitsGroup(int SameLRange = 1,int DiffLRange = 1) const;
79 //vector<vector<MdcDigi*> > ConnectionHitsGroup(vector<MdcDigi*> &MdcHits,int SameLRange = 1,int DiffLRange = 1) const;
80
81 void getHelixOfMcParticle(const Event::McParticle* mcParticle,Helix& helix);
82 float getChargeOfMcParticle(const Event::McParticle* mcParticle);
83 void getMomPosOfMcParticle(const Event::McParticle* mcParticle,HepVector3D& pos,
84 HepVector3D& mom);
85 void getMdcDigiOnMcParticle(int trackIndex,
86 const std::map<int, std::map<MdcDigi*,Event::MdcMcHit*> > mdcMCAssociation,
87 MdcDigiVec& mdcDigiInput,
88 MdcDigiVec& mdcDigiAssociated);
89 ///Get association of MdcDigi and MdcMcHit according to track id
90 void getMdcMCAssoiciation(int trackIndex,
91 const std::vector<MdcDigi*> mdcDigiVecInput,
92 std::map<int,std::map<MdcDigi*,Event::MdcMcHit*> >& mdcMCAssociation);
93private:
94 double Bz() const { return m_pIMF->getReferField()*1000.; }
95 int myNWire[43];
96 int myOuterWire[43][288][2];
97 int myInnerWire[43][288][2];
98 double myWirePhi[43][288];
99 double dPhi(double phi1, double phi2);
100 RawDataProviderSvc* m_RawDataProviderSvc;
101 MdcGeomSvc* m_mdcGeomSvc;
102 IMagneticFieldSvc* m_pIMF;
103 int m_debug;
104 bool m_doSag;
105
106};
107#endif /* MDCUTILITYSVC_H*/
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
double mass
int runNo
Definition: DQA_TO_DB.cxx:12
Double_t phi2
Double_t phi1
std::vector< MdcDigi * > MdcDigiVec
HepGeom::Point3D< double > HepPoint3D
Definition: MdcUtilitySvc.h:32
HepGeom::Vector3D< double > HepVector3D
Definition: MdcUtilitySvc.h:37
virtual double getReferField()=0
HepVector besPar2PatPar(const HepVector &helixPar) const
bool cellTrackPassedByPhi(const HepVector helix, int layer, int &cellId_in, int &cellId_out) const
virtual StatusCode initialize()
HepSymMatrix patErr2BesErr(const HepSymMatrix &err) const
HepPoint3D Hel(HepPoint3D piv, double dr, double phi0, double Alpha_L, double kappa, double dz, double dphi, double tanl) const
MdcDigiVec getMdcDigiVec() const
HepSymMatrix besErr2PatErr(const HepSymMatrix &err) const
float getChargeOfMcParticle(const Event::McParticle *mcParticle)
void getMdcMCAssoiciation(int trackIndex, const std::vector< MdcDigi * > mdcDigiVecInput, std::map< int, std::map< MdcDigi *, Event::MdcMcHit * > > &mdcMCAssociation)
Get association of MdcDigi and MdcMcHit according to track id.
bool cellTrackPassedByPhiPatPar(const HepVector helix, int layer, int &cellId_in, int &cellId_out) const
HepVector patPar2BesPar(const HepVector &helixPar) const
void getHelixOfMcParticle(const Event::McParticle *mcParticle, Helix &helix)
virtual StatusCode finalize()
void getMomPosOfMcParticle(const Event::McParticle *mcParticle, HepVector3D &pos, HepVector3D &mom)
double probab(const int &ndof, const double &chisq) const
double doca(int layer, int cell, const HepVector helix, const HepSymMatrix errMat, bool passCellRequired=true, bool doSag=true) const
int nLayerTrackPassed(const HepVector helix) const
bool cellTrackPassed(const HepVector helix, int layer, int &cellId_in, int &cellId_out) const
void getMdcDigiOnMcParticle(int trackIndex, const std::map< int, std::map< MdcDigi *, Event::MdcMcHit * > > mdcMCAssociation, MdcDigiVec &mdcDigiInput, MdcDigiVec &mdcDigiAssociated)
double p_cms(HepVector helix, int runNo, double mass) const
double docaPatPar(int layer, int cell, const HepVector helixPat, const HepSymMatrix errMatPat, bool passCellRequired=true, bool doSag=true) const
HepPoint3D pointOnHelixPatPar(const HepVector helixPat, int lay, int innerOrOuter) const
HepPoint3D pointOnHelix(const HepVector helixPar, int lay, int innerOrOuter) const
bool cellTrackPassedPatPar(const HepVector helix, int layer, int &cellId_in, int &cellId_out) const