BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcAliRecHit.cxx
Go to the documentation of this file.
2
3#include "GaudiKernel/Bootstrap.h"
4#include "GaudiKernel/IDataProviderSvc.h"
5#include "GaudiKernel/IMessageSvc.h"
6#include "GaudiKernel/ISvcLocator.h"
7#include "GaudiKernel/MsgStream.h"
8#include "GaudiKernel/SmartDataPtr.h"
9#include "GaudiKernel/StatusCode.h"
10
11#include <iostream>
12
13const double MdcAliRecHit::m_df = 10.0;
14const double MdcAliRecHit::m_qf = 1.0;
15
16void MdcAliRecHit::setRecHit( HitRefVec::iterator it_hit ) {
17 IMessageSvc* msgSvc;
18 Gaudi::svcLocator()->service( "MessageSvc", msgSvc );
19 MsgStream log( msgSvc, "MdcAliRecHit" );
20 log << MSG::DEBUG << "MdcAliRecHit::setRecHit()" << endmsg;
21
22 Identifier identifier;
23 MdcID mdcid;
24
25 log << MSG::DEBUG << "hit Id: " << ( *it_hit )->getId() << " hits drift time "
26 << ( *it_hit )->getDriftT() << " hits doca " << ( *it_hit )->getDoca() << endmsg;
27
28 identifier = ( *it_hit )->getMdcId();
29 m_layid = mdcid.layer( identifier );
30 m_cellid = mdcid.wire( identifier );
31 m_lr = ( *it_hit )->getFlagLR();
32 m_stat = ( *it_hit )->getStat();
33
34 m_docaInc = ( *it_hit )->getDoca();
35 m_docaExc = m_docaInc;
36
37 if ( 0 == m_lr )
38 {
39 m_dmeas = ( *it_hit )->getDriftDistLeft();
40 m_errdmeas = ( *it_hit )->getErrDriftDistLeft();
41 }
42 else
43 {
44 m_dmeas = ( *it_hit )->getDriftDistRight();
45 m_errdmeas = ( *it_hit )->getErrDriftDistRight();
46 }
47
48 m_rawtime = ( *it_hit )->getTdc();
49 m_tdrift = ( *it_hit )->getDriftT();
50
51 m_qhit = ( *it_hit )->getAdc();
52 m_zhit = ( *it_hit )->getZhit();
53 m_entra = ( *it_hit )->getEntra();
54 m_chisqadd = ( *it_hit )->getChisqAdd();
55
56 double flen = ( *it_hit )->getFltLen(); // cm
57 m_tof = flen / 30.0;
58
59 // the following is for cm to mm
60 m_docaInc *= m_df;
61 m_docaExc *= m_df;
62 m_dmeas *= m_df;
63 m_errdmeas *= m_df;
64 m_zhit *= m_df;
65 m_qhit *= m_qf;
66
67 m_resiInc = fabs( m_dmeas ) - fabs( m_docaInc );
68 if ( 0 == m_lr ) m_resilrInc = -1.0 * m_resiInc; // for recon of pat
69 else m_resilrInc = m_resiInc;
70
71 m_resiExc = fabs( m_dmeas ) - fabs( m_docaExc );
72 if ( 0 == m_lr ) m_resilrExc = -1.0 * m_resiExc;
73 else m_resilrExc = m_resiExc;
74}
75
76void MdcAliRecHit::setKalHit( HelixSegRefVec::iterator it_hit ) {
77 IMessageSvc* msgSvc;
78 Gaudi::svcLocator()->service( "MessageSvc", msgSvc );
79 MsgStream log( msgSvc, "MdcAliRecHit" );
80 log << MSG::DEBUG << "MdcAliRecHit::setKalHit()" << endmsg;
81
82 Identifier identifier;
83 MdcID mdcid;
84
85 identifier = ( *it_hit )->getMdcId();
86 m_layid = mdcid.layer( identifier );
87 m_cellid = mdcid.wire( identifier );
88 m_stat = 1;
89
90 m_lr = ( *it_hit )->getFlagLR();
91 if ( -1 == m_lr ) m_lr = 0; // definition not same as MdcRecHit
92
93 m_docaInc = ( *it_hit )->getDocaIncl();
94 m_docaExc = ( *it_hit )->getDocaExcl();
95
96 if ( 1 == m_lr )
97 {
98 m_docaInc *= -1.0;
99 m_docaExc *= -1.0;
100 }
101
102 m_dmeas = ( *it_hit )->getDD();
103 m_errdmeas = 0.013;
104
105 m_rawtime = ( *it_hit )->getTdc();
106 m_tdrift = ( *it_hit )->getDT();
107
108 m_qhit = ( *it_hit )->getAdc();
109 m_zhit = ( *it_hit )->getZhit();
110 m_entra = ( *it_hit )->getEntra();
111 m_chisqadd = 0.0;
112 m_tof = ( *it_hit )->getTof();
113
114 m_Dr = ( *it_hit )->getDrExcl();
115 m_Fi0 = ( *it_hit )->getFi0Excl();
116 m_Cpa = ( *it_hit )->getCpaExcl();
117 m_Dz = ( *it_hit )->getDzExcl();
118 m_Tanl = ( *it_hit )->getTanlExcl();
119
120 // the following is for cm to mm
121 m_docaInc *= m_df;
122 m_docaExc *= m_df;
123 m_dmeas *= m_df;
124 m_errdmeas *= m_df;
125 m_zhit *= m_df;
126 m_qhit *= m_qf;
127
128 m_resiInc = fabs( m_dmeas ) - fabs( m_docaInc );
129 if ( 0 == m_lr ) m_resilrInc = -1.0 * m_resiInc;
130 else m_resilrInc = m_resiInc;
131
132 m_resiExc = fabs( m_dmeas ) - fabs( m_docaExc );
133 if ( 0 == m_lr ) m_resilrExc = -1.0 * m_resiExc;
134 else m_resilrExc = m_resiExc;
135}
IMessageSvc * msgSvc()
void setKalHit(HelixSegRefVec::iterator it_hit)
void setRecHit(HitRefVec::iterator it_hit)
static int layer(const Identifier &id)
Values of different levels (failure returns 0).
Definition MdcID.cxx:47
static int wire(const Identifier &id)
Definition MdcID.cxx:52