BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
ValidRecMdcTrackAlg Class Reference

#include <ValidRecMdcTrackAlg.h>

+ Inheritance diagram for ValidRecMdcTrackAlg:

Public Member Functions

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

Detailed Description

Definition at line 18 of file ValidRecMdcTrackAlg.h.

Constructor & Destructor Documentation

◆ ValidRecMdcTrackAlg()

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

Definition at line 16 of file ValidRecMdcTrackAlg.cxx.

16 :
17 Algorithm(name, pSvcLocator) {
18
19
20
21 // m_tuple1 = 0;
22 // m_tuple2 = 0;
23
24
25}

Member Function Documentation

◆ execute()

StatusCode ValidRecMdcTrackAlg::execute ( )

Definition at line 150 of file ValidRecMdcTrackAlg.cxx.

150 {
151 MsgStream log(msgSvc(), name());
152
153
154 int ntrk=0;
155
156 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
157 if (!eventHeader) {
158 log << MSG::FATAL << "Could not find Event Header" << endreq;
159 return( StatusCode::SUCCESS);
160 }
161
162 log << MSG::INFO << "retrieved event: " << eventHeader->eventNumber() << " run: " << eventHeader->runNumber() << endreq;
163 int eventNo=eventHeader->eventNumber();
164 int runNo=eventHeader->runNumber();
165 if(m_tuple1){
166 g_eventNo = eventNo;
167 g_runNo = runNo;
168 }
169
170 SmartDataPtr<RecMdcTrackCol> mdcTracks(eventSvc(),"/Event/Recon/RecMdcTrackCol");
171 if( ! mdcTracks )
172 {
173 log << MSG::ERROR << "Unable to retrieve RecMdcTrackCol" << endreq;
174 return StatusCode::FAILURE;
175 } else {
176 log << MSG::DEBUG << "RecMdcTrackCol retrieved of size "<< mdcTracks->size() << endreq;
177 for(RecMdcTrackCol::iterator it=mdcTracks->begin(); it!=mdcTracks->end(); it++)
178 {
179
180/* g_hits=0;
181
182 HitRefVec gothits = (*it)->getVecHits();
183 HitRefVec::iterator it_gothit = gothits.begin();
184 for( ; it_gothit != gothits.end(); it_gothit++){
185 g_hits_id = (*it_gothit)->getId();
186 g_hits_ddl = (*it_gothit)->getDriftDistLeft();
187 g_hits_ddr = (*it_gothit)->getDriftDistRight();
188 g_doca = (*it_gothit)->getDoca();
189 g_hits_mdc_id = (*it_gothit)->getMdcId();
190 g_layer = MdcID::layer((*it_gothit)->getMdcId());
191 g_wire = MdcID::wire((*it_gothit)->getMdcId());
192
193
194
195 g_hits_tdc = (*it_gothit)->getTdc();
196 g_hits_adc = (*it_gothit)->getAdc();
197
198 g_hits++;
199 m_tuple2->write();
200 }*/
201
202 g_track_id = (*it)->trackId();
203 g_phi0 = (*it)->helix()[1];
204 g_kappa = (*it)->helix()[2];
205 g_tanl = (*it)->helix()[4];
206
207 g_dr = (*it)->helix()[0];
208 g_dz = (*it)->helix()[3];
209 g_chisq_of_fit = (*it)->chi2();
210 g_phi_terminal = (*it)->getFiTerm();
211 g_number_of_hits = (*it)->getNhits();
212 g_number_of_stereo_hits=(*it)->nster();
213 g_p = (*it)->p();
214
215 g_px = (*it)->px();
216 g_py = (*it)->py();
217 g_pz = (*it)->pz();
218 g_pxy = (*it)->pxy();
219 g_charge = (*it)->charge();
220 g_stat = (*it)->stat();
221 g_x = (*it)->x();
222 g_y = (*it)->y();
223 g_z = (*it)->z();
224 g_r = (*it)->r();
225 g_chi2 = (*it)->chi2();
226 g_ndof = (*it)->ndof();
227 g_firstLayer = (*it)->firstLayer();
228 g_lastLayer = (*it)->lastLayer();
229
230
231 g_hits=0;
232 HitRefVec gothits = (*it)->getVecHits();
233 HitRefVec::iterator it_gothit = gothits.begin();
234 for( ; it_gothit != gothits.end(); it_gothit++){
235 g_hits_id = (*it_gothit)->getId();
236
237 g_hits_ddl = (*it_gothit)->getDriftDistLeft();
238 g_hits_ddr = (*it_gothit)->getDriftDistRight();
239
240 g_doca = (*it_gothit)->getDoca();
241 g_hits_mdc_id = (*it_gothit)->getMdcId();
242 g_layer = MdcID::layer((*it_gothit)->getMdcId());
243 g_wire = MdcID::wire((*it_gothit)->getMdcId());
244
245
246
247
248 g_hits_tdc = (*it_gothit)->getTdc();
249 g_hits_adc = (*it_gothit)->getAdc();
250
251 g_hits++;
252 m_tuple2->write();
253 }
254
255 m_tuple1->write();
256
257
258
259
260
261
262
263
264
265
266
267 }
268
269 }
270 return StatusCode::SUCCESS;
271}
int runNo
int eventNo
SmartRefVector< RecMdcHit > HitRefVec
Definition: RecMdcTrack.h:22
IMessageSvc * msgSvc()
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
Definition: MdcID.cxx:49
static int wire(const Identifier &id)
Definition: MdcID.cxx:54

◆ finalize()

StatusCode ValidRecMdcTrackAlg::finalize ( )

Definition at line 274 of file ValidRecMdcTrackAlg.cxx.

274 {
275
276 MsgStream log(msgSvc(), name());
277 log << MSG::INFO << "Finalizing..." << endreq;
278 return StatusCode::SUCCESS;
279
280}

◆ initialize()

StatusCode ValidRecMdcTrackAlg::initialize ( )

Definition at line 27 of file ValidRecMdcTrackAlg.cxx.

27 {
28 MsgStream log( msgSvc(), name() );
29 log << MSG::INFO << "Booking Histograms" << endreq;
30
31
32 NTuplePtr nt1(ntupleSvc(),"FILE101/mdcTrack");
33 if( nt1 ) m_tuple1 = nt1;
34 else{
35 m_tuple1 = ntupleSvc()->book("FILE101/mdcTrack",CLID_RowWiseTuple,"ValidRecMdcTrackNTuple1");
36
37 if( m_tuple1 ) {
38 m_tuple1->addItem ("eventNo",g_eventNo);
39 m_tuple1->addItem ("runNo", g_runNo);
40 m_tuple1->addItem("nhits",g_hits);
41 m_tuple1->addItem ("Id",g_track_id);
42 m_tuple1->addItem ("Phi0",g_phi0);
43 m_tuple1->addItem ("Cpa",g_kappa);
44 m_tuple1->addItem ("Tanl",g_tanl);
45 m_tuple1->addItem ("p",g_p);
46
47 m_tuple1->addItem ("Dr",g_dr);
48 m_tuple1->addItem ("Dz",g_dz);
49 m_tuple1->addItem ("Chisq",g_chisq_of_fit);
50 m_tuple1->addItem ("FiTerm",g_phi_terminal);
51 m_tuple1->addItem ("Nhits",g_number_of_hits);
52 m_tuple1->addItem ("Nster",g_number_of_stereo_hits);
53
54 m_tuple1->addItem ("px",g_px);
55 m_tuple1->addItem ("py",g_py);
56 m_tuple1->addItem ("pz",g_pz);
57 m_tuple1->addItem ("pxy",g_pxy);
58 m_tuple1->addItem ("charge",g_charge);
59 m_tuple1->addItem ("stat",g_stat);
60 m_tuple1->addItem ("x",g_x);
61 m_tuple1->addItem ("y",g_y);
62 m_tuple1->addItem ("z",g_z);
63 m_tuple1->addItem ("r",g_r);
64 m_tuple1->addItem ("chi2",g_chi2);
65 m_tuple1->addItem ("ndof",g_ndof);
66 m_tuple1->addItem ("firstLayer",g_firstLayer);
67 m_tuple1->addItem ("lastLayer",g_lastLayer);
68 m_tuple1->addItem ("theta",g_theta);
69 m_tuple1->addItem ("phi",g_phi);
70
71 } else {
72 log << MSG::ERROR << "----- Cannot book or register histograms -----" << endreq;
73 return StatusCode::FAILURE;
74 }
75 }
76 NTuplePtr nt2(ntupleSvc(),"FILE101/mdcHit");
77 if( nt2 ) m_tuple2 = nt2;
78 else{
79 m_tuple2 = ntupleSvc()->book("FILE101/mdcHit",CLID_RowWiseTuple,"ValidRecMdcHitNTuple1");
80
81 if( m_tuple2 ) {
82 m_tuple2->addItem ("Hits_id",g_hits_id);
83 m_tuple2->addItem ("Hits_ddl",g_hits_ddl);
84 m_tuple2->addItem ("Hits_ddr",g_hits_ddr);
85
86 m_tuple2->addItem ("doca",g_doca);
87 m_tuple2->addItem ("Hits_mdc_id",g_hits_mdc_id);
88 m_tuple2->addItem ("layer", g_layer);
89 m_tuple2->addItem ("wire", g_wire );
90
91 m_tuple2->addItem ("Hits_tdc",g_hits_tdc);
92 m_tuple2->addItem ("Hits_adc",g_hits_adc);
93 } else {
94 log << MSG::ERROR << "----- Cannot book or register histograms -----" << endreq;
95 return StatusCode::FAILURE;
96 }
97 }
98
99 log << MSG::INFO << "Finished booking Histograms" << endreq;
100 return StatusCode::SUCCESS;
101
102/*
103
104 NTuplePtr nt2(ntupleSvc(),"FILE101/mdcHit");
105 if( nt2 ) m_tuple2 = nt2;
106 else{
107 m_tuple2 = ntupleSvc()->book("FILE101/mdcHit",CLID_ColumnWiseTuple,"ValidRecMdcTrackNTuple2");
108
109 if( m_tuple2 ) {
110 m_tuple1->addItem ("eventNo",g_eventNo);
111 m_tuple1->addItem ("runNo", g_runNo);
112 m_tuple1->addItem("nhits",g_hits,0,5000);
113 m_tuple1->addItem ("Id",g_track_id);
114 m_tuple1->addItem ("Phi0",g_phi0);
115 m_tuple1->addItem ("Cpa",g_kappa);
116 m_tuple1->addItem ("Tanl",g_tanl);
117 m_tuple1->addItem ("p",g_p);
118
119 m_tuple1->addItem ("Dr",g_dr);
120 m_tuple1->addItem ("Dz",g_dz);
121 m_tuple1->addItem ("Chisq",g_chisq_of_fit);
122 m_tuple1->addItem ("FiTerm",g_phi_terminal);
123 m_tuple1->addItem ("Nhits",g_number_of_hits);
124 m_tuple1->addItem ("Nster",g_number_of_stereo_hits);
125
126 m_tuple2->addItem ("Hits_id",g_hits_id);
127 m_tuple2->addItem ("Hits_ddl",g_hits_ddl);
128 m_tuple2->addItem ("Hits_ddr",g_hits_ddr);
129
130 m_tuple2->addItem ("doca",g_doca);
131 m_tuple2->addItem ("Hits_mdc_id",g_hits_mdc_id);
132 m_tuple2->addItem ("layer",g_layer);
133 m_tuple2->addItem ("wire",g_wire );
134
135 m_tuple2->addItem ("Hits_tdc",g_hits_tdc);
136 m_tuple2->addItem ("Hits_adc",g_hits_adc);
137 }
138 else {
139 log << MSG::ERROR << "----- Cannot book or register histograms -----" << endreq;
140 return StatusCode::FAILURE;
141 }
142
143 log << MSG::INFO << "Finished booking Histograms" << endreq;
144 return StatusCode::SUCCESS;
145
146 }*/
147
148 }
INTupleSvc * ntupleSvc()

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