BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcFastTrkAlg Class Reference

#include <MdcFastTrkAlg.h>

+ Inheritance diagram for MdcFastTrkAlg:

Public Member Functions

 MdcFastTrkAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
StatusCode beginRun ()
 
 MdcFastTrkAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
StatusCode beginRun ()
 

Detailed Description

Constructor & Destructor Documentation

◆ MdcFastTrkAlg() [1/2]

MdcFastTrkAlg::MdcFastTrkAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 64 of file MdcFastTrkAlg.cxx.

64 :
65 Algorithm(name, pSvcLocator)
66{
67 // Declare the properties
68 declareProperty("bunchtime", m_bunchtime_MC=8.0);
69 declareProperty("T0cal", m_mdc_tcal=200.0);
70 m_ftFinder = 0;
71
72}

◆ MdcFastTrkAlg() [2/2]

MdcFastTrkAlg::MdcFastTrkAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Member Function Documentation

◆ beginRun() [1/2]

StatusCode MdcFastTrkAlg::beginRun ( )

Definition at line 236 of file MdcFastTrkAlg.cxx.

236 {
237
238 MsgStream log(msgSvc(), name());
239 log << MSG::INFO << "in beginRun()" << endreq;
240
241 m_ftFinder->begin_run();
242
243 return StatusCode::SUCCESS;
244}
void begin_run()
begin run function(reads constants)
Definition: FTFinder.cxx:331

◆ beginRun() [2/2]

StatusCode MdcFastTrkAlg::beginRun ( )

◆ execute() [1/2]

StatusCode MdcFastTrkAlg::execute ( )

Definition at line 188 of file MdcFastTrkAlg.cxx.

188 {
189
190 MsgStream log(msgSvc(), name());
191 log << MSG::DEBUG << "in execute()" << endreq;
192
193#ifndef OnlineMode
194 m_timer[1]->start();
195#endif
196
197 m_ftFinder->event();
198
199#ifndef OnlineMode
200 m_timer[1]->stop();
201
202 //cout << "m_timer[1]->elapsed()::" << m_timer[1]->elapsed() << endl;
203 //cout << "m_timer[1]->mean()::" << m_timer[1]->mean() << endl;
204 g_eventtime = m_timer[1]->elapsed();
205
206 if(m_tuple){
207 StatusCode status = m_tuple->write();
208 if (!status.isSuccess()) {
209 log << MSG::ERROR << "Can't fill ntuple!" << endreq;
210 }
211 }
212#endif
213
214 return StatusCode::SUCCESS;
215}
void start(void)
Definition: BesTimer.cxx:27
void stop(void)
Definition: BesTimer.cxx:39
void event()
track finder core
Definition: FTFinder.cxx:472

◆ execute() [2/2]

StatusCode MdcFastTrkAlg::execute ( )

◆ finalize() [1/2]

StatusCode MdcFastTrkAlg::finalize ( )

Definition at line 218 of file MdcFastTrkAlg.cxx.

218 {
219
220 MsgStream log(msgSvc(), name());
221 log << MSG::INFO << "in finalize()" << endreq;
222
223 m_ftFinder->term();
224#ifndef OnlineMode
225 log << MSG::DEBUG <<"num_2Dtrk: " << num_2Dtrk
226 <<" num_3Dtrk: " << num_3Dtrk
227 <<" num_finaltrk: " << num_finaltrk
228 << endmsg;
229 m_timersvc->print();
230#endif
231
232 return StatusCode::SUCCESS;
233}
int num_3Dtrk
Definition: FTFinder.cxx:101
int num_2Dtrk
int num_finaltrk
Definition: FTFinder.cxx:101
void term()
terminator
Definition: FTFinder.cxx:319
virtual void print(void)=0

◆ finalize() [2/2]

StatusCode MdcFastTrkAlg::finalize ( )

◆ initialize() [1/2]

StatusCode MdcFastTrkAlg::initialize ( )

Definition at line 75 of file MdcFastTrkAlg.cxx.

75 {
76
77 MsgStream log(msgSvc(), name());
78 log << MSG::INFO << "in initialize()" << endreq;
79
80#ifndef OnlineMode
81 NTuplePtr nt(ntupleSvc(),"FILE102/n1");
82 if ( nt ) m_tuple = nt;
83 else {
84 m_tuple=ntupleSvc()->book("FILE102/n1",CLID_ColumnWiseTuple,"MdcRecEvent");
85 if( m_tuple ) {
86 m_tuple->addItem ("eventNo", g_eventNo);
87 m_tuple->addItem ("NtrackMC", g_ntrkMC,0,50);
88 m_tuple->addItem ("MCtheta0", g_ntrkMC, g_theta0MC);
89 m_tuple->addItem ("MCphi0", g_ntrkMC, g_phi0MC);
90 m_tuple->addItem ("pxMC", g_ntrkMC, g_pxMC);
91 m_tuple->addItem ("pyMC", g_ntrkMC, g_pyMC);
92 m_tuple->addItem ("pzMC", g_ntrkMC, g_pzMC);
93 m_tuple->addItem ("ptMC", g_ntrkMC, g_ptMC);
94 m_tuple->addItem ("Ntrack",g_ntrk, 0, 50);
95 m_tuple->addItem ("px", g_ntrk, g_px);
96 m_tuple->addItem ("py", g_ntrk, g_py);
97 m_tuple->addItem ("pz", g_ntrk, g_pz);
98 m_tuple->addItem ("pt", g_ntrk, g_pt);
99 m_tuple->addItem ("p", g_ntrk, g_p);
100 m_tuple->addItem ("phi", g_ntrk, g_phi);
101 m_tuple->addItem ("theta", g_ntrk, g_theta);
102 m_tuple->addItem ("vx", g_ntrk, g_vx);
103 m_tuple->addItem ("vy", g_ntrk, g_vy);
104 m_tuple->addItem ("vz", g_ntrk, g_vz);
105 m_tuple->addItem ("dr", g_ntrk, g_dr);
106 m_tuple->addItem ("phi0", g_ntrk, g_phi0);
107 m_tuple->addItem ("kappa", g_ntrk, g_kappa);
108 m_tuple->addItem ("dz", g_ntrk, g_dz);
109 m_tuple->addItem ("tanl", g_ntrk, g_tanl);
110 m_tuple->addItem ("eventtime", g_eventtime);
111 m_tuple->addItem ("Testime", g_estime);
112 }
113 else { // did not manage to book the N tuple....
114 log << MSG::ERROR <<"Cannot book N-tuple:" << long(m_tuple) << endmsg;
115 //return StatusCode::FAILURE;
116 }
117 }
118
119 g_sigmaxy = histoSvc()->book( "sigmaxy", "1D sigmaxy", 100, -0.2, 0.2 );
120 g_sigmaz = histoSvc()->book( "sigmaz", "1D sigmaz", 100, -3.5, 3.5);
121 g_chi2xy = histoSvc()->book( "chi2xy", "1D chi2xy", 100, -0.01, 0.01 );
122 g_chi2sz = histoSvc()->book( "chi2sz", "1D chi2sz", 100, -8.0, 8. );
123 g_ncellMC = histoSvc()->book( "ncellmc", "1D ncellMC", 100, 0.0, 7000. );
124 g_ncell = histoSvc()->book( "ncell", "1D ncell", 100, 0.0, 7000. );
125 g_naxialhit = histoSvc()->book( "naxialhit", "2D axial hit", 30, 0.0, 30. );
126 g_nstereohit = histoSvc()->book( "nstereohit", "2D stereo hit", 30, 0.0, 30. );
127 g_nhit = histoSvc()->book( "nhit", "2D hit", 50, 0.0, 50. );
128 g_hitmap[0] = histoSvc()->book( "hm0", "2d hitmap1", 80, -80., 80., 80, -80., 80. );
129 g_hitmap[1] = histoSvc()->book( "hm1", "2d hitmap2", 80, -80., 80., 80, -80., 80. );
130 g_hitmap[2] = histoSvc()->book( "hm2", "2d hitmap3", 80, -80., 80., 80, -80., 80. );
131 g_hitmap[3] = histoSvc()->book( "hm3", "2d hitmap4", 80, -80., 80., 80, -80., 80. );
132 g_hitmap[4] = histoSvc()->book( "hm4", "2d hitmap5", 80, -80., 80., 80, -80., 80. );
133 g_hitmap[5] = histoSvc()->book( "hm5", "2d hitmap6", 80, -80., 80., 80, -80., 80. );
134 g_hitmap[6] = histoSvc()->book( "hm6", "2d hitmap7", 80, -80., 80., 80, -80., 80. );
135 g_hitmap[7] = histoSvc()->book( "hm7", "2d hitmap8", 80, -80., 80., 80, -80., 80. );
136 g_hitmap[8] = histoSvc()->book( "hm8", "2d hitmap9", 80, -80., 80., 80, -80., 80. );
137 g_hitmap[9] = histoSvc()->book( "hm9", "2d hitmap10", 80, -80., 80., 80, -80., 80. );
138 g_hitmap[10] = histoSvc()->book( "hm10", "2d hitmap11", 80, -80., 80., 80, -80., 80. );
139
140#endif
141
142 /*NTuplePtr nth(ntupleSvc(),"FILE1/Hit/2");
143 if ( nth ) m_htuple = nth;
144 else {
145 m_htuple=ntupleSvc()->book("FILE1/Hit/2",CLID_ColumnWiseTuple,"MdcRecHit");
146 if( m_htuple ) {
147 m_htuple->addItem ("sigmaxy", g_sigmaxy);
148 m_htuple->addItem ("sigmaz", g_sigmaz);
149 m_htuple->addItem ("chi2xy", g_chi2xy);
150 m_htuple->addItem ("chi2sz", g_chi2sz);
151 m_htuple->addItem ("ncellMC", g_ncellMC);
152 m_htuple->addItem ("ncell", g_ncell);
153 }
154 else { // did not manage to book the N tuple....
155 log << MSG::ERROR <<"Cannot book N-tuple:" << long(m_tuple) << endmsg;
156 return StatusCode::FAILURE;
157 }
158 }*/
159#ifndef OnlineMode
160 num_2Dtrk=0;
161 num_3Dtrk=0;
162 num_finaltrk=0;
163#endif
164
165 //m_ftFinder->init();
166 m_ftFinder = new FTFinder();
167 m_ftFinder->init();
168 m_ftFinder->setBunchtime(m_bunchtime_MC);
169 m_ftFinder->setT0cal(m_mdc_tcal);
170 m_ftFinder->setAlgorithmPointer(this);
171
172
173#ifndef OnlineMode
174 StatusCode sc = service( "BesTimerSvc", m_timersvc);
175 if( sc.isFailure() ) {
176 log << MSG::WARNING << name() << ": Unable to locate BesTimer Service" << endreq;
177 return StatusCode::FAILURE;
178 }
179
180 m_timer[1] = m_timersvc->addItem("Execution");
181 m_timer[1]->propName("nExecution");
182#endif
183
184 return StatusCode::SUCCESS;
185}
void init()
initializer(creates geometry)
Definition: FTFinder.cxx:159
void setT0cal(double t0cal)
set crude mdc time calibconst (~200 ns) for t0 calculation
void setAlgorithmPointer(Algorithm *)
returns FTFinder pointer
void setBunchtime(double bunchtime)
set bunchtime for MC events
virtual BesTimer * addItem(const std::string &name)=0

◆ initialize() [2/2]

StatusCode MdcFastTrkAlg::initialize ( )

The documentation for this class was generated from the following files: