StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiDefaultToolkit.cxx
1 /***************************************************************************
2  *
3  * $Id: StiDefaultToolkit.cxx,v 2.3 2016/06/30 19:50:26 perev Exp $
4  *
5  * @file StiDefaultToolkit.cxx
6  * @brief Default Implementation of the StiToolkit Abstract interface
7  * @author Claude A Pruneau, Wayne State University,
8  * @date March 2001
9  * @copyright 2001, STAR Experiment at BNL, All rights reserved.
10  *
11  * Permission to use, copy, modify and distribute this software and its
12  * documentation strictly for non-commercial purposes is hereby granted
13  * without fee, provided that the above copyright notice appears in all
14  * copies and that both the copyright notice and this permission notice
15  * appear in the supporting documentation. The authors make no claims
16  * about the suitability of this software for any purpose. It is
17  * provided "as is" without express or implied warranty.
18  *
19  ***************************************************************************
20  *
21  * $Log: StiDefaultToolkit.cxx,v $
22  * Revision 2.3 2016/06/30 19:50:26 perev
23  * StiTrackMerger removed
24  *
25  * Revision 2.2 2016/06/29 18:03:13 perev
26  * Added two seed finders CA & KNN
27  *
28  * Revision 1.1.2.1 2016/05/24 22:49:17 smirnovd
29  * Squashed commit of the following:
30  *
31  * commit 169aac1e9a4e5291586418783d9b969a1d047035
32  * Author: Dmitri Smirnov <d.s@plexoos.com>
33  * Date: Mon May 23 18:07:56 2016 -0400
34  *
35  * StiMaker: Included missing header for templated class
36  *
37  * commit ebf9abbd2d31db0bfb053a5c1e2715c969496b8f
38  * Author: Dmitri Smirnov <d.s@plexoos.com>
39  * Date: Mon May 23 17:30:47 2016 -0400
40  *
41  * Moved StiDefaultToolkit from StiMaker/ to Sti/ to break circular dependancy
42  *
43  * Relevant include paths and LinkDef's have been updated.
44  *
45  * commit 3dfd849439f6350577937ac042944d9d1b0b0978
46  * Author: Dmitri Smirnov <d.s@plexoos.com>
47  * Date: Mon May 23 17:19:33 2016 -0400
48  *
49  * StiMaker: Added method to update internal toolkit to StiCA
50  *
51  * commit 9e34887223d52f7ab3a784bb81879f303ac5d2fc
52  * Author: Dmitri Smirnov <d.s@plexoos.com>
53  * Date: Mon May 23 17:11:10 2016 -0400
54  *
55  * StiKalmanTrack: Make initialize() virtual
56  *
57  * We call it for StiCAKalmanTrack via a base pointer. For example, see
58  *
59  * bool StiLocalTrackSeedFinder::fit(StiKalmanTrack* track)
60  *
61  * commit 04044129cc01bf326261b5934e8feb48fcac9798
62  * Author: Dmitri Smirnov <d.s@plexoos.com>
63  * Date: Mon May 23 17:09:36 2016 -0400
64  *
65  * StiCAKalmanTrack: [Style] Mark refit() virtual as that's what it is
66  *
67  * commit fac70613e865d1d3f9312dcac6a3c4bc5270abc6
68  * Author: Dmitri Smirnov <d.s@plexoos.com>
69  * Date: Mon May 23 16:25:56 2016 -0400
70  *
71  * StiFactory: Include proper dependency
72  *
73  * commit 45404e1dcdcff8311184663c40cd0f8fe4ef0625
74  * Author: Dmitri Smirnov <d.s@plexoos.com>
75  * Date: Thu May 12 19:05:32 2016 -0400
76  *
77  * StiCATpcSeedFinder: [Cosmetic] Removed irrelevant code/comments
78  *
79  * commit 4bb50aac320c58c2fa2c2da47c8875800d92fac0
80  * Author: Dmitri Smirnov <d.s@plexoos.com>
81  * Date: Mon May 16 21:36:08 2016 -0400
82  *
83  * Make use of StiKalmanTrack's static members
84  *
85  * commit 90c647615138540a1f59810d9259da70f6f162f4
86  * Author: Dmitri Smirnov <d.s@plexoos.com>
87  * Date: Mon May 16 21:34:17 2016 -0400
88  *
89  * StiKalmanTrack: Moved static global entities from file scope to class
90  *
91  * commit 1105164c6f4c569ee5e2a3ff64fa8132c5f95914
92  * Author: Dmitri Smirnov <d.s@plexoos.com>
93  * Date: Mon May 16 15:41:50 2016 -0400
94  *
95  * StiCAKalmanTrackFinder: Accept pointers to base class StiKalmanTrack
96  *
97  * The method does not do anything specific to derived class StiCAKalmanTrack hence
98  * it is safe to accept a pointer to the base class
99  *
100  * commit 1e7e9f26806bad39cec6e02d83a12e8def577671
101  * Author: Dmitri Smirnov <d.s@plexoos.com>
102  * Date: Mon May 16 12:38:01 2016 -0400
103  *
104  * StiCAKalmanTrack: Added include declaring kTpcId
105  *
106  * commit ed22761b7dd81a2a3bc9efa55d037541bbaad2bd
107  * Author: Dmitri Smirnov <d.s@plexoos.com>
108  * Date: Fri May 13 00:07:18 2016 -0400
109  *
110  * StiKalmanTrackFinder: Changed access to protected for private data member
111  *
112  * This member is used in derived StiCAKalmanTrackFinder class so allow direct use
113  *
114  * commit fe547209f89d8d9981aade883fd86fae1ee8b304
115  * Author: Dmitri Smirnov <d.s@plexoos.com>
116  * Date: Thu May 12 23:47:14 2016 -0400
117  *
118  * StiCATpcSeedFinder: Cast StiKalmanTrack to StiCAKalmanTrack
119  *
120  * In StiCA we would like to work with StiCAKalmanTrack's
121  * It is safe to cast to derived class as derived class does not introduce any new
122  * data members
123  *
124  * commit 2ee090b303f76c2f431173c81b3a54cdbb492682
125  * Author: Dmitri Smirnov <d.s@plexoos.com>
126  * Date: Tue May 24 16:50:47 2016 -0400
127  *
128  * StiCADefaultToolkit: Modifed config for StiCA to instantiate StiCA specific objects
129  *
130  * commit 62e6095815e15dad7ddb66f20a8151d0c9b4c7fd
131  * Author: Dmitri Smirnov <d.s@plexoos.com>
132  * Date: Mon May 23 16:20:25 2016 -0400
133  *
134  * StiCADefaultToolkit: Remove duplicate code belonging to base class
135  *
136  * commit 05cbe67227dc31778148cd8a92707d940bf77e72
137  * Author: Dmitri Smirnov <d.s@plexoos.com>
138  * Date: Mon May 23 15:50:41 2016 -0400
139  *
140  * StiCADefaultToolkit: Inherit from StiDefaultToolkit
141  *
142  * commit c56f4d0a216f905f734d6af2764c9f9c6df41337
143  * Author: Dmitri Smirnov <d.s@plexoos.com>
144  * Date: Tue May 24 16:14:35 2016 -0400
145  *
146  * StiCAKalmanTrackFinder: Removed duplicate code that exists in parent class StiKalmanTrackFinder
147  *
148  * commit 6becbb84ed39a587d3c4d01e71f9210c7d683a65
149  * Author: Dmitri Smirnov <d.s@plexoos.com>
150  * Date: Thu May 12 23:43:37 2016 -0400
151  *
152  * StiCAKalmanTrackFinder inherits from StiKalmanTrackFinder
153  *
154  * commit a992c34fc7d1642617952053327378cf39f3af0d
155  * Author: Dmitri Smirnov <d.s@plexoos.com>
156  * Date: Mon May 16 12:35:51 2016 -0400
157  *
158  * StiCAKalmanTrack: Removed duplicate code that exists in parent class StiKalmanTrack
159  *
160  * commit 805f37719570820a95069144dfb9d28356a95e1c
161  * Author: Dmitri Smirnov <d.s@plexoos.com>
162  * Date: Mon May 16 12:37:10 2016 -0400
163  *
164  * StiCAKalmanTrack: Inherit from Sti/ to avoid duplicate code
165  *
166  * Conflicts:
167  * StiCA/StiCAKalmanTrack.h
168  *
169  * commit e967b188bad7f7cdc0f48ededa58365a1f145697
170  * Author: Dmitri Smirnov <d.s@plexoos.com>
171  * Date: Thu May 12 15:42:30 2016 -0400
172  *
173  * StiCA: Removed DO_TPCCATRACKER protection
174  *
175  * For StiCA we assume DO_TPCCATRACKER is defined
176  *
177  * commit e80e0659619f2d0369549bfb717639a4a5b02eb7
178  * Author: Dmitri Smirnov <d.s@plexoos.com>
179  * Date: Thu May 12 14:49:04 2016 -0400
180  *
181  * Sti: Removed DO_TPCCATRACKER protection
182  *
183  * For Sti we assume DO_TPCCATRACKER is not defined
184  *
185  * commit e9df39949dc387f2eab3cb1812ebf99832fafaaf
186  * Author: Dmitri Smirnov <d.s@plexoos.com>
187  * Date: Thu May 12 18:13:26 2016 -0400
188  *
189  * StiCA: Path of includes corrected
190  *
191  * commit dbc98816057b09b843e86e6b36ed1c81a7932ea0
192  * Author: Dmitri Smirnov <d.s@plexoos.com>
193  * Date: Thu May 12 18:08:46 2016 -0400
194  *
195  * StiCA: Classes renamed for consistency
196  *
197  * The following substitutions were made:
198  *
199  * s/StiKalmanTrackFinder/StiCAKalmanTrackFinder/
200  * s/StiTpcSeedFinder/StiCATpcSeedFinder/
201  * s/StiKalmanTrack/StiCAKalmanTrack/
202  * s/StiTPCCATrackerInterface/StiCATpcTrackerInterface/
203  * s/StiDefaultToolkit/StiCADefaultToolkit/
204  *
205  * commit b0c26b55a4b491ce0dd92b6da1c4c74a70440c52
206  * Author: Dmitri Smirnov <d.s@plexoos.com>
207  * Date: Mon May 23 15:11:48 2016 -0400
208  *
209  * StiCA: Renamed StiDefaultToolkit.cxx -> StiCADefaultToolkit
210  *
211  * commit 4a738dbe2290203cbdc69dc213bd97661693661a
212  * Author: Dmitri Smirnov <d.s@plexoos.com>
213  * Date: Thu May 12 15:31:11 2016 -0400
214  *
215  * Added in StiCA/ direct copies of corresponding files from Sti/
216  *
217  * commit 25cf766787a65f6d6b1b2789637941c0dd016b55
218  * Author: Dmitri Smirnov <d.s@plexoos.com>
219  * Date: Thu May 12 14:33:45 2016 -0400
220  *
221  * Moved StiCA related files from Sti/ to StiCA/
222  *
223  * Some files have been renamed. We'll use StiCA prefix for files in StiCA/
224  *
225  * commit a51e816f2d21645cc4768098a6867b78724e5215
226  * Author: Dmitri Smirnov <d.s@plexoos.com>
227  * Date: Thu May 12 19:47:58 2016 -0400
228  *
229  * Fixes to catch up with latest changes in Sti
230  *
231  * commit 27264048a6fd93ff9b03613df04eec9452aa332f
232  * Author: Dmitri Smirnov <d.s@plexoos.com>
233  * Date: Tue May 24 12:11:25 2016 -0400
234  *
235  * StiKalmanTrack: Change from original code found in "eval"
236  *
237  * This change was reverted by Irakli but in fact needed to avoid triggereing of assert
238  * See commit 4d993f28
239  *
240  * commit 8391c593621c48e775efa453c9b694c46229aba8
241  * Author: Irakli Chakaberia <iraklic@rcas6007.rcf.bnl.gov>
242  * Date: Tue Apr 26 11:39:42 2016 -0400
243  *
244  * assert removed to allow for multiple use of hit
245  *
246  * Revision 2.46 2015/08/28 23:57:53 perev
247  * Cleanup
248  *
249  * Revision 2.45 2015/07/28 00:43:57 perev
250  * Added StiKNNSeedFinder. There is no direct dependency, new made by CINT
251  *
252  * Revision 2.44 2015/07/09 17:22:54 jeromel
253  * Back-step from StiKNNSeedFinder / will branch
254  *
255  * Revision 2.43 2015/07/07 14:52:45 perev
256  * Added selection of KNN Seed finder
257  *
258  * Revision 2.42 2009/03/18 19:55:39 fisyak
259  * remove StiDetectorFinder class
260  *
261  * Revision 2.41 2009/03/16 13:50:14 fisyak
262  * Move out all Sti Chairs into StDetectorDb
263  *
264  * Revision 2.40 2008/02/29 16:28:00 fisyak
265  * Fix unassigned variable (_trackNodeInfFactory), synchronize name with BigFullChain.h
266  *
267  * Revision 2.39 2007/04/16 22:45:34 perev
268  * endl added
269  *
270  * Revision 2.38 2006/12/18 01:26:32 perev
271  * StiNodeInf factory added
272  *
273  * Revision 2.37 2006/12/06 00:47:40 fine
274  * rename StiGeomMake to StiDetectorVolume
275  *
276  * Revision 2.36 2006/10/16 20:30:42 fisyak
277  * Clean dependencies from Sti useless classes
278  *
279  * Revision 2.35 2006/07/19 18:39:22 perev
280  * Max NHits=2000000
281  *
282  * Revision 2.34 2006/05/31 03:59:04 fisyak
283  * Add Victor's dca track parameters, clean up
284  *
285  * Revision 2.33 2006/04/07 17:39:49 perev
286  * Cleanup: redundant comments removed
287  *
288  * Revision 2.31 2005/12/07 23:13:31 perev
289  * last traces of StiMaker and associated maker removed
290  *
291  * Revision 2.30 2005/10/26 21:54:10 fisyak
292  * Remove dead classes, gid rid off dependencies from StMcEvent and StiGui
293  *
294  * Revision 2.29 2005/10/06 19:36:38 fisyak
295  * Clean up
296  *
297  * Revision 2.28 2005/08/09 15:22:41 perev
298  * Add new factory for Node extention
299  *
300  * Revision 2.27 2005/07/20 17:32:39 perev
301  * IdTruth
302  *
303  * Revision 2.26 2005/05/31 17:12:02 perev
304  * Fast delete used
305  *
306  * Revision 2.25 2005/05/12 18:31:02 perev
307  * New factory IMP
308  *
309  * Revision 2.24 2004/10/08 14:50:11 pruneau
310  * changed hit factory allocation
311  *
312  * Revision 2.23 2004/09/15 21:34:40 pruneau
313  * Increased maximum allocation for track factory.
314  *
315  * Revision 2.22 2004/08/12 14:06:19 pruneau
316  * doubled StiKalmanTrackNode factory allocation
317  *
318  * Revision 2.21 2004/03/18 17:09:11 calderon
319  * Change the StiXXXVertexFinder from StiDummy to StiStar for Y2004 chain,
320  * as per Lee's example.
321  *
322  * Revision 2.20 2004/02/24 01:59:46 jeromel
323  * Commented out include of disappeared .h
324  *
325  * Revision 2.19 2004/02/21 19:17:38 pruneau
326  * removing reference to evaluable tracks and finder
327  *
328  * Revision 2.18 2004/02/21 18:28:29 pruneau
329  * Updates to comply to changes in interfaces
330  *
331  * Revision 2.17 2003/09/21 02:19:28 perev
332  * several initializations to 0 added
333  *
334  * Revision 2.16 2003/05/07 03:06:32 pruneau
335  * *** empty log message ***
336  *
337  * Revision 2.15 2003/05/06 15:36:36 mmiller
338  * Committing changes to turn on multiple regions (StiPlacement::StiRegion -> kMidRapidity, kForwardRapidity, etc).
339  * Also added a point to StiToolkit for StiMaker. This allows for the req. GetDataSet calls in the FTPC code.
340  * Not so elegant...
341  *
342  * Revision 2.14 2003/04/30 15:39:32 pruneau
343  * Integrating StiResidual in main stream Sti
344  *
345  * Revision 2.13 2003/04/11 16:51:53 pruneau
346  * various fixes
347  *
348  * Revision 2.12 2003/04/10 14:53:03 pruneau
349  * removing obsolete files and classes
350  *
351  * Revision 2.11 2003/04/10 12:10:08 pruneau
352  * Changed StiMaker and Default Toolkit to accomodate the new Event Display
353  *
354  * Revision 2.10 2003/04/09 21:16:19 andrewar
355  * Changed limits for StiHitFactory: maxIncrements (from 10 to 20)
356  *
357  * Revision 2.9 2003/03/31 17:19:26 pruneau
358  * various
359  *
360  * Revision 2.8 2003/02/11 10:38:18 andrewar
361  * Changed limits for StiHitFactory:: maxIncrements (from 5 to 10).
362  *
363  */
364 
365 #include "TSystem.h"
366 #include "TROOT.h"
367 #include "StiDefaultToolkit.h"
368 #include "Sti/Base/Filter.h"
369 #include "Sti/Base/Factory.h"
370 #include "Sti/Base/EditableParameter.h"
371 #include "Sti/Base/StiFactory.h"
372 #include "Sti/StiHit.h"
373 #include "Sti/StiHitContainer.h"
374 #include "Sti/StiMasterDetectorBuilder.h"
375 #include "Sti/StiMasterHitLoader.h"
376 #include "Sti/StiDetector.h"
377 #include "Sti/StiDetectorContainer.h"
378 #include "Sti/StiTrackContainer.h"
379 #include "Sti/StiLocalTrackSeedFinder.h"
380 #include "Sti/StiTrackFinder.h"
381 #include "Sti/StiTrackFitter.h"
382 #include "Sti/StiDefaultTrackFilter.h"
383 #include "Sti/StiTrack.h"
384 #include "Sti/StiKalmanTrack.h"
385 #include "Sti/StiKalmanTrackNode.h"
386 #include "Sti/StiKalmanTrackFitter.h"
387 #include "Sti/StiKalmanTrackFinder.h"
388 #include "Sti/StiTrackMerger.h"
389 #include "Sti/StiStarVertexFinder.h"
390 #include "Sti/StiDefaultTrackFilter.h"
391 #include "Sti/StiDetectorGroup.h"
392 #include "Sti/StiDetectorGroups.h"
393 #include "Sti/StiCATpcSeedFinder.h"
394 #include "StDetectorDbMaker/StiHitErrorCalculator.h"
395 #include "StiTpc/StiTpcHitLoader.h"
396 #include "StiSvt/StiSvtHitLoader.h"
397 #include "StDetectorDbMaker/StiHitErrorCalculator.h"
398 
399 #include "StEvent/StHit.h"
400 #include "StarClassLibrary/StMCTruth.h"
401 
402 
403 //______________________________________________________________________________
404 StiDefaultToolkit::StiDefaultToolkit()
405  :
406  _evaluatorEnabled(false),
407  _trackFilterFactory(0),
408  _parameterFactory(0),
409  _hitFactory(0),
410  _trackFactory(0),
411  _detectorFactory(0),
412  _detectorNodeFactory(0),
413  _trackNodeFactory(0),
414  _trackNodeExtFactory(0),
415  _trackNodeInfFactory(0),
416  _detectorBuilder(),
417  _detectorContainer(0),
418  _detectorGroups(0),
419  _hitContainer(0),
420  _trackContainer(0),
421  _trackSeedFinder(0),
422  _trackFinder(0),
423  _trackFitter(0),
424  _vertexFinder(0),
425  _hitLoader(0),
426  _loaderHitFilter(0),
427  _loaderTrackFilter(0),
428  _finderTrackFilter(0)
429 {
430  cout<<"StiDefaultToolkit::StiDefaultToolkit() -I- Started"<<endl;
431  _detectorGroups = new StiDetectorGroups("StarDetectorGroups","StarDetectorGroups");
432  cout<<"StiDefaultToolkit::StiDefaultToolkit() -I- Done"<<endl;
433 };
434 
435 //______________________________________________________________________________
436 StiDefaultToolkit::~StiDefaultToolkit()
437 {
438  delete _trackFilterFactory;
439  delete _hitFactory;
440  delete _hitContainer;
441  delete _detectorFactory;
442  delete _detectorContainer;
443  delete _trackNodeFactory;
444  delete _trackNodeExtFactory;
445  delete _trackNodeInfFactory;
446  delete _trackContainer;
447  delete _trackFactory;
448  delete _parameterFactory;
449  delete _trackSeedFinder;
450  delete _trackFinder;
451  delete _trackFitter;
452 }
453 
454 //______________________________________________________________________________
455 Factory< Filter<StiTrack> > * StiDefaultToolkit::getTrackFilterFactory()
456 {
457  if (_trackFilterFactory)
458  return _trackFilterFactory;
459  cout << "StiDefaultToolkit::getTrackFilterFactory() -I- Instantiating StiTrackFilterFactory" << endl;
460  _trackFilterFactory = StiFactory<StiDefaultTrackFilter,
461  Filter<StiTrack> >::myInstance();
462  return _trackFilterFactory;
463 }
464 
465 //______________________________________________________________________________
466 Factory<EditableParameter> * StiDefaultToolkit::getParameterFactory()
467 {
468  if (_parameterFactory)
469  return _parameterFactory;
471  return _parameterFactory;
472 }
473 
474 //______________________________________________________________________________
475 Factory<StiHit>* StiDefaultToolkit::getHitFactory()
476 {
477  if (_hitFactory) return _hitFactory;
479  _hitFactory->setFastDelete();
480  _hitFactory->setMaxIncrementCount(2000000);
481  return _hitFactory;
482 }
483 
484 //______________________________________________________________________________
485 Factory<StiKalmanTrack>* StiDefaultToolkit::getTrackFactory()
486 {
487  if (_trackFactory) return _trackFactory;
488  cout << "StiDefaultToolkit::getTrackFactory() -I- ";
490  _trackFactory->setFastDelete();
491  return _trackFactory;
492 }
493 
494 
495 //______________________________________________________________________________
496 Factory<StiDetector>* StiDefaultToolkit::getDetectorFactory()
497 {
498  if (_detectorFactory)
499  return _detectorFactory;
500  cout << "StiDefaultToolkit::getDetectorFactory() -I- Instantiating Detector Factory"<<endl;
502  return _detectorFactory;
503 }
504 
505 //______________________________________________________________________________
506 Factory< StiCompositeTreeNode<StiDetector> >* StiDefaultToolkit::getDetectorNodeFactory()
507 {
508  if (_detectorNodeFactory)
509  return _detectorNodeFactory;
510  _detectorNodeFactory = StiFactory< StiCompositeTreeNode<StiDetector> ,
511  StiCompositeTreeNode<StiDetector> >::myInstance();
512  return _detectorNodeFactory;
513 }
514 
515 
516 //______________________________________________________________________________
517 Factory<StiKalmanTrackNode>* StiDefaultToolkit::getTrackNodeFactory()
518 {
519  if (_trackNodeFactory)
520  return _trackNodeFactory;
522  _trackNodeFactory->setMaxIncrementCount(4000000);
523  _trackNodeFactory->setFastDelete();
525  return _trackNodeFactory;
526 }
527 
528 //______________________________________________________________________________
529 Factory<StiNodeExt>* StiDefaultToolkit::getTrackNodeExtFactory()
530 {
531  if (_trackNodeExtFactory)
532  return _trackNodeExtFactory;
533  _trackNodeExtFactory= StiFactory<StiNodeExt,StiNodeExt>::myInstance();
534  _trackNodeExtFactory->setMaxIncrementCount(4000000);
535  _trackNodeExtFactory->setFastDelete();
536  return _trackNodeExtFactory;
537 }
538 //______________________________________________________________________________
539 Factory<StiNodeInf>* StiDefaultToolkit::getTrackNodeInfFactory()
540 {
541  if (_trackNodeInfFactory)
542  return _trackNodeInfFactory;
543  _trackNodeInfFactory= StiFactory<StiNodeInf,StiNodeInf>::myInstance();
544  _trackNodeInfFactory->setMaxIncrementCount(4000000);
545  _trackNodeInfFactory->setFastDelete();
546  return _trackNodeInfFactory;
547 }
548 
549 //______________________________________________________________________________
550 StiDetectorGroups *StiDefaultToolkit::getDetectorGroups()
551 {
552  return _detectorGroups;
553 }
554 
555 
556 //______________________________________________________________________________
557 void StiDefaultToolkit::add(StiDetectorGroup<StEvent>* detectorGroup)
558 {
559  _detectorGroups->push_back((StiGenericDetectorGroup *)detectorGroup);
561  masterLoader = static_cast<StiMasterHitLoader<StEvent,StiDetectorBuilder> *>(getHitLoader());
562  StiHitLoader<StEvent,StiDetectorBuilder> * loader = detectorGroup->getHitLoader();
563  if (loader)
564  {
565  cout << "StiDefaultToolkit::add() -I- Adding hit loader for detector group:"
566  << detectorGroup->getName()<<endl;
567  masterLoader->addLoader(loader);
568  }
569  else
570  cout << "StiDefaultToolkit::add() -I- Not adding hit loader for detector group:"<< detectorGroup->getName()<<endl;
571 
572  StiMasterDetectorBuilder * masterBuilder = getDetectorBuilder();
573  StiDetectorBuilder * builder = detectorGroup->getDetectorBuilder();
574  if (builder)
575  {
576  cout << "StiDefaultToolkit::add() -I- Adding builder for detector group:"<< detectorGroup->getName()<<endl;
577  masterBuilder->add(builder);
578  }
579  else
580  cout << "StiDefaultToolkit::add() -I- Not adding builder for detector group:"<< detectorGroup->getName()<<endl;
581 }
582 
583 //______________________________________________________________________________
584 StiMasterDetectorBuilder * StiDefaultToolkit::getDetectorBuilder()
585 {
586  if (_detectorBuilder)
587  return _detectorBuilder;
588  _detectorBuilder = new StiMasterDetectorBuilder(true);
589  return _detectorBuilder;
590 }
591 
592 //______________________________________________________________________________
593 StiDetectorContainer * StiDefaultToolkit::getDetectorContainer()
594 {
595  if (_detectorContainer)
596  return _detectorContainer;
597  _detectorContainer = new StiDetectorContainer("DetectorContainer","Detector Container", getDetectorBuilder());
598  // _detectorContainer->build(getDetectorBuilder());
599  //_detectorContainer->reset();
600  return _detectorContainer;
601 }
602 
603 //______________________________________________________________________________
604 StiHitContainer * StiDefaultToolkit::getHitContainer()
605 {
606  if (_hitContainer)
607  return _hitContainer;
608  _hitContainer = new StiHitContainer("HitContainer","Reconstructed Hits", getHitFactory() );
609  return _hitContainer;
610 }
611 
612 
613 
614 //______________________________________________________________________________
615 StiTrackContainer * StiDefaultToolkit::getTrackContainer()
616 {
617  if (_trackContainer)
618  return _trackContainer;
619  _trackContainer = new StiTrackContainer("TrackContainer","Reconstructed Tracks");
620  return _trackContainer;
621 }
622 //______________________________________________________________________________
623 StiTrackFinder * StiDefaultToolkit::getTrackSeedFinder()
624 {
625  auto *mySeed = new StiLocalTrackSeedFinder("DefaultSeedFinder",
626  "Local Track Seed Finder",
627  getTrackFactory(),
628  getHitContainer(),
629  getDetectorContainer());
630  assert(mySeed);
631  return mySeed;
632 }
633 //______________________________________________________________________________
634 StiTrackFinder * StiDefaultToolkit::getTrackSeedFinderKNN()
635 {
636  auto *mySeed = (StiTrackFinder*)gROOT->ProcessLineFast("new StiKNNSeedFinder");
637  assert(mySeed);
638  return mySeed;
639 }
640 //______________________________________________________________________________
641 StiTrackFinder * StiDefaultToolkit::getTrackSeedFinderCA()
642 {
643  return new StiCATpcSeedFinder();
644 }
645 
646 //______________________________________________________________________________
647 StiTrackFinder * StiDefaultToolkit::getTrackFinder()
648 {
649  if (_trackFinder)
650  return _trackFinder;
651  _trackFinder = new StiKalmanTrackFinder(this);
652  StiTrack::setTrackFinder(_trackFinder);
653  getTrackFitter();
654  return _trackFinder;
655 }
656 
657 //______________________________________________________________________________
658 StiTrackFitter * StiDefaultToolkit::getTrackFitter()
659 {
660  if (_trackFitter)
661  return _trackFitter;
662  _trackFitter = new StiKalmanTrackFitter();
663  StiTrack::setTrackFitter(_trackFitter);
664  return _trackFitter;
665 }
666 
667 
668 //______________________________________________________________________________
669 StiVertexFinder * StiDefaultToolkit::getVertexFinder()
670 {
671  cout << "StiDefaultToolkit::getVertexFinder() -I- Started"<<endl;
672  if (_vertexFinder)
673  return _vertexFinder;
674  _vertexFinder = new StiStarVertexFinder("GenericVertex"); // MCBS, for Y2004 chain
675  return _vertexFinder;
676 }
677 
678 
679 //______________________________________________________________________________
680 StiHitLoader<StEvent,StiDetectorBuilder> * StiDefaultToolkit::getHitLoader()
681 {
682  if (_hitLoader)
683  return _hitLoader;
684  _hitLoader = new StiMasterHitLoader<StEvent,StiDetectorBuilder>("StarHitLoader",
685  getHitContainer(),
686  getHitFactory(),
687  0);
688  return _hitLoader;
689 }
690 
691 //______________________________________________________________________________
692 void StiDefaultToolkit::setEvaluatorEnabled(bool evaluatorEnabled)
693 {
694  _evaluatorEnabled = evaluatorEnabled;
695 }
696 
697 //______________________________________________________________________________
698 bool StiDefaultToolkit::isEvaluatorEnabled() const
699 {
700  return _evaluatorEnabled;
701 }
702 
703 
704 //______________________________________________________________________________
705 EditableFilter<StiHit> * StiDefaultToolkit::getLoaderHitFilter()
706 {
707  return _loaderHitFilter;
708 }
709 
710 //______________________________________________________________________________
711 EditableFilter<StiTrack> * StiDefaultToolkit::getLoaderTrackFilter()
712 {
713  return _loaderTrackFilter;
714 }
715 
716 //______________________________________________________________________________
717 EditableFilter<StiTrack> * StiDefaultToolkit::getFinderTrackFilter()
718 {
719  return _finderTrackFilter;
720 }
721 
722 //______________________________________________________________________________
723 void StiDefaultToolkit::setLoaderHitFilter(EditableFilter<StiHit> * loaderHitFilter)
724 {
725  _loaderHitFilter = loaderHitFilter;
726 }
727 
728 //______________________________________________________________________________
729 void StiDefaultToolkit::setLoaderTrackFilter(EditableFilter<StiTrack> * loaderTrackFilter)
730 {
731  _loaderTrackFilter = loaderTrackFilter;
732 }
733 
734 //______________________________________________________________________________
735 void StiDefaultToolkit::setFinderTrackFilter(EditableFilter<StiTrack> * finderTrackFilter)
736 {
737  _finderTrackFilter = finderTrackFilter;
738 }
739 
740 //______________________________________________________________________________
741 int StiDefaultToolkit::getTruth(const StiHit *stiHit)
742 {
743  if (!stiHit->detector()) return 0;
744  StHit *stHit = (StHit*)stiHit->stHit();
745  if (!stHit) return 0;
746  return StMCTruth(stHit->idTruth(),stHit->qaTruth());
747 }
748 
749 
Definition: StHit.h:125
Definition: StiHit.h:51
const StiDetector * detector() const
Definition: StiHit.h:96
Definition of Kalman Track.
Default Implementation of the StiToolkit Abstract interface.
virtual StiDetectorBuilder * getDetectorBuilder()
Get a detector builder appropriate for this detector group.
const StMeasuredPoint * stHit() const
Definition: StiHit.h:104
An abstract class defining the interface to the track finder.
static void setKalmanTrackNodeFactory(Factory< StiKalmanTrackNode > *)
Set the factory used for the creation of kalman track nodes.
virtual StiHitLoader< Event, StiDetectorBuilder > * getHitLoader()
Get a hit loader appropriate for this detector group.
const string & getName() const
Get the name of the object.
Definition: Named.cxx:22