Belle II Software development
TRGCDC.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9//-----------------------------------------------------------------------------
10// Description : A class to represent CDC.
11//-----------------------------------------------------------------------------
12
13#ifndef TRGCDC_FLAG_
14#define TRGCDC_FLAG_
15
16#define TRGCDC_UNDEFINED 999999
17
18#include <vector>
19#include "trg/trg/Clock.h"
20#include "trg/trg/Signal.h"
21
22class TFile;
23class TTree;
24class TClonesArray;
25
26namespace HepGeom {
27 template <class T> class Point3D;
28}
29
30namespace Belle2 {
36 namespace CDC {
37 class CDCGeometryPar;
38 }
39
40 class TRGTime;
41 class TRGClock;
42 class TRGLink;
43 class TRGCDC;
44 class TRGCDCWire;
45 class TRGCDCLayer;
46 class TRGCDCWireHit;
47 class TRGCDCWireHitMC;
48 class TRGCDCSegment;
49 class TRGCDCSegmentHit;
50 class TRGCDCFrontEnd;
51 class TRGCDCMerger;
52 class TRGCDCTSFBoard;
53 class TRGCDCTracker2D;
54 class TRGCDCTrackSegmentFinder;
55 class TRGCDCPerfectFinder;
56 class TRGCDCHoughFinder;
57 class TRGCDCHough3DFinder;
58 class TRGCDCFitter3D;
59 class TRGCDCLUT;
60 class TRGCDCTrack;
61 class TRGCDCEventTime;
62
68
69 class TRGCDC {
70
71 public:
72
74 enum EReturnValueType {TSF = 1 << 0,
75 ETF = 1 << 1,
76 find2D = 1 << 2,
77 fit2D = 1 << 3,
78 find3D = 1 << 4,
79 fit3D = 1 << 5,
80 any = TSF | ETF | find2D | fit2D | find3D | fit3D
81 };
82
84 static TRGCDC* getTRGCDC(const std::string& configFile,
85 unsigned simulationMode = 0,
86 unsigned fastSimulationMode = 0,
87 unsigned firmwareSimulationMode = 0,
89 int firmwareSimulationStop = 32 * 32 - 1,
90 bool _makeRootFile = 0,
91 bool perfect2DFinder = false,
92 bool perfect3DFinder = false,
93 const std::string& innerTSLUTFile = "?",
94 const std::string& outerTSLUTFile = "?",
95 const std::string& rootTRGCDCFile = "?",
96 const std::string& rootFitter3DFile = "?",
97 unsigned houghFinderPeakMin = 5,
98 const std::string& houghMappingFilePlus = "?",
99 const std::string& houghMappingFileMinus = "?",
100 unsigned houghDoit = 2,
101 bool fLogicLUTTSF = 0,
102 bool fLRLUT = 1,
103 bool fFitter3Dsmclr = 0,
104 bool fFitter3Ds2DFit = 1,
105 bool fFitter3Ds2DFitDrift = 0,
106 double inefficiency = 0,
107 bool fileTSF = 0,
108 bool fileETF = 0,
109 int fverETF = 0,
110 bool fprintFirmETF = 0,
111 bool fileHough3D = 0,
112 int finder3DMode = 0,
113 bool fileFitter3D = 0,
114 bool fXtSimpleFitter3D = 0,
115 double TdcBinWidth = 1.,
116 int trgCDCDataInputMode = 0,
117 const std::string& cdchitCollectionName = "");
118
121 static TRGCDC* getTRGCDC(void);
122
123 private:
124
126 TRGCDC(const std::string& configFile,
127 unsigned simulationMode,
128 unsigned fastSimulationMode,
129 unsigned firmwareSimulationMode,
132 bool makeRootFile,
133 bool perfect2DFinder,
134 bool perfect3DFinder,
135 const std::string& innerTSLUTFile,
136 const std::string& outerTSLUTFile,
137 const std::string& rootTRGCDCFile,
138 const std::string& rootFitter3DFile,
139 unsigned houghFinderPeakMin,
140 const std::string& houghMappingFilePlus,
141 const std::string& houghMappingFileMinus,
142 unsigned houghDoit,
143 bool fLogicLUTTSF,
144 bool fLRLUT,
145 bool fFitter3Dsmclr,
146 bool fFitter3Ds2DFit,
147 bool fFitter3Ds2DFitDrift,
148 double inefficiecny,
149 bool fileTSF,
150 bool fileETF,
151 int fverETF,
152 bool fprintFirmETF,
153 bool fileHough3D,
154 int finder3DMode,
155 bool fileFitter3D,
156 bool fXtSimpleFitter3D,
157 double TdcBinWidth,
158 int trgCDCDataInputMode,
159 const std::string& cdchitCollectionName);
160
162 virtual ~TRGCDC();
163
165 void initialize(unsigned houghFinderPeakMin,
166 const std::string& houghMappingFilePlus,
167 const std::string& houghMappingFileMinus,
168 unsigned houghDoit);
169
171 void configure(void);
172
174 void simulate(void);
175
181 void storeSimulationResults(std::string collection2Dfinder,
182 std::string collection2Dfitter,
183 std::string collection3Dfitter);
184
186 void terminate(void);
187
189
190 public:// Selectors
191
193 std::string name(void) const;
194
196 std::string version(void) const;
197
199 std::string versionCDC(void) const;
200
202 unsigned mode(void) const;
203
205 unsigned mode(unsigned);
206
208 unsigned firmwareSimulationMode(void) const;
209
211 int getReturnValue(void) const;
212
214 int getReturnValue(EReturnValueType const& moduleName) const;
215
217 void setReturnValue(EReturnValueType const& moduleName, bool flag);
218
220 void setReturnValue(int);
221
223 void dump(const std::string& message) const;
224
226 int debugLevel(void) const;
227
229 int debugLevel(int) const;
230
232 float fudgeFactor(void) const;
233
235 float fudgeFactor(float);
236
238 std::vector<TRGCDCTrack*> getTrackList2D(void);
239
241 std::vector<TRGCDCTrack*> getTrackList2DFitted(void);
242
244 std::vector<TRGCDCTrack*> getTrackList3D(void);
245
247 std::string getCDCHitCollectionName() const { return _cdchitCollectionName; }
248
249 public:// Geometry
250
253
256 const TRGCDCWire* wire(unsigned wireId) const;
257
260 const TRGCDCWire* wire(unsigned layerId, int localId) const;
261
263// const TRGCDCWire * wire(const HepGeom::Point3D<double> & point) const;
264
266 const TRGCDCWire* wire(float r, float phi) const;
267
269 const TRGCDCLayer* layer(unsigned id) const;
270
273 const std::vector<TRGCDCLayer*>* superLayer(unsigned id) const;
274
277 unsigned nLocalLayers(unsigned superLayerId) const;
278
280 unsigned nWires(void) const;
281
283 unsigned nSuperLayers(void) const;
284
286 unsigned nLayers(void) const;
287
289 unsigned nAxialLayers(void) const;
290
292 unsigned nStereoLayers(void) const;
293
295 unsigned nAxialSuperLayers(void) const;
296
298 unsigned nStereoSuperLayers(void) const;
299
301 float cellWidth(unsigned superLayerId) const;
302
304 float superLayerR(unsigned superLayerId) const;
305
307 float superLayerR2(unsigned superLayerId) const;
308
310 unsigned nSegments(void) const;
311
313 const TRGCDCSegment& segment(unsigned id) const;
314
316 const TRGCDCSegment& segment(unsigned lyrId, unsigned id) const;
317
319 const TRGCDCSegment& axialSegment(unsigned lyrId, unsigned id) const;
320
322 const TRGCDCSegment& stereoSegment(unsigned lyrId, unsigned id) const;
323
325 unsigned nSegmentLayers(void) const;
326
329 const TRGCDCLayer* segmentLayer(unsigned id) const;
330
332 unsigned nSegments(unsigned id) const;
333
334 public:// Event by event hit information.
335
337 void clear(void);
338
340 void fastClear(void);
341
343 void update();
344
349 void updateByData(int inputMode);
350
353 std::vector<const TRGCDCWireHit*> hits(void) const;
354
357 std::vector<const TRGCDCWireHit*> axialHits(void) const;
358
361 std::vector<const TRGCDCWireHit*> stereoHits(void) const;
362
365 std::vector<const TRGCDCSegmentHit*> segmentHits(void) const;
366
369 std::vector<const TRGCDCSegmentHit*> segmentHits(unsigned) const;
370
373 std::vector<const TRGCDCSegmentHit*> axialSegmentHits(unsigned) const;
374
377 std::vector<const TRGCDCSegmentHit*> stereoSegmentHits(unsigned) const;
378
381 std::vector<const TRGCDCWireHitMC*> hitsMC(void) const;
382
384// std::vector<const TRGCDCWireHit *> badHits(void) const;
385
387 int getEventTime(void) const;
388
389 public:// Utility functions
390
392 std::string wireName(unsigned wireId) const;
393
395 unsigned localId(unsigned wireId) const;
396
398 unsigned layerId(unsigned wireId) const;
399
401 unsigned layerId(unsigned axialStereoSwitch,
402 unsigned axialStereoLayerId) const;
403
405 unsigned superLayerId(unsigned wireId) const;
406
408 unsigned localLayerId(unsigned wireId) const;
409
411 unsigned axialStereoSuperLayerId(unsigned axialStereo,
412 unsigned axialStereoLayerId) const;
413
415 bool neighbor(const TRGCDCWire& w0, const TRGCDCWire& w1) const;
416
418 void perfect3DFinder(std::vector<TRGCDCTrack*> trackList) const;
419
422// static void driftDistance(TLink & link,
423// const TTrack & track,
424// unsigned correctionFlag = 0,
425// float T0Offset = 0.);
426
427 public:// TRG information
428
430 const TRGClock& systemClock(void) const;
431
433 const TRGClock& systemClockFE(void) const;
434
437 const TRGClock& TDCClock(void) const;
438
440 const TRGClock& dataClock(void) const;
441
443 int firmwareSimulationStart(void) const;
444
446 int firmwareSimulationStop(void) const;
447
449 int firmwareSimulationStartDataClock(void) const;
450
452 int firmwareSimulationStopDataClock(void) const;
453
455 const TRGClock& userClock3125(void) const;
456
458 double systemOffsetMC(void) const;
459
461 const TRGCDCFrontEnd* frontEnd(unsigned id) const;
462
464 const TRGCDCMerger* merger(unsigned id) const;
465
467// const TRGCDCTrackSegmentFinder * tsfboard(unsigned id) const;
468 TRGCDCTrackSegmentFinder* tsfboard(unsigned id) const;
469
471 const TRGCDCTracker2D* tracker2D(unsigned id) const;
472
473 private:
474
476 void classification(void);
477
479 void updateMC(void);
480
482 void fastSimulation(void);
483
485 void firmwareSimulation(void);
486
487 private:
488
490 static TRGCDC* _cdc;
491
493 mutable int _debugLevel;
494
496 const std::string _cdcVersion;
497
499 std::string _configFilename;
500
503
506
516
519
522
525
528
531
534
536 std::vector<TRGCDCTrack*> _trackList2D;
537
539 std::vector<TRGCDCTrack*> _trackList2DFitted;
540
542 std::vector<TRGCDCTrack*> _trackList3D;
543
546
549
552
555
558
561
564
567
570
573
576
579
582
585
588
591
594
597
600
603
606
608 std::vector<std::vector<TRGCDCLayer*> *> _superLayers;
609
611 std::vector<std::vector<TRGCDCLayer*> *> _axialSuperLayers;
612
614 std::vector<std::vector<TRGCDCLayer*> *> _stereoSuperLayers;
615
617 std::vector<TRGCDCLayer*> _layers;
618
620 std::vector<TRGCDCLayer*> _axialLayers;
621
623 std::vector<TRGCDCLayer*> _stereoLayers;
624
626 std::vector<TRGCDCWire*> _wires;
627
629 std::vector<TRGCDCWire*> _hitWires;
630
632 std::vector<TRGCDCWireHit*> _hits;
633
635 std::vector<TRGCDCWireHit*> _axialHits;
636
638 std::vector<TRGCDCWireHit*> _stereoHits;
639
641 std::vector<TRGCDCWireHit*> _badHits;
642
644 std::vector<TRGCDCWireHitMC*> _hitsMC;
645
647 std::vector<TRGCDCSegment*> _tss;
648
650 std::vector<TRGCDCSegment*> _tsSL[9];
651
653 std::vector<TRGCDCLayer*> _tsLayers;
654
656 std::vector<TRGCDCSegmentHit*> _segmentHits;
657
659 std::vector<TRGCDCSegmentHit*> _segmentHitsSL[9];
660
663
665 float* _width;
666
668 float* _r;
669
671 float* _r2;
672
675
678
682
685
688
691
693 const double _offset;
694
696 std::vector<TRGLink*> _links;
697
699 std::vector<TRGCDCFrontEnd*> _fronts;
700
702 std::vector<TRGCDCMerger*> _mergers;
703
705 std::vector <TRGCDCTrackSegmentFinder*> _tsfboards;
706
708 std::vector <TRGCDCTracker2D*> _tracker2Ds;
709
712
715
718
721
724
727
729 std::vector<TRGCDCEventTime*> _eventTime;
730
733
735 TFile* m_file;
736
738 TTree* m_tree;
739
742
744 TTree* _tree2D;
745
747 TClonesArray* m_fitParameters;
748
750 TClonesArray* m_mcParameters;
751
753 TClonesArray* m_mcTrack4Vector;
754
757
759 TClonesArray* m_mcTrackStatus;
760
762 TClonesArray* m_evtTime;
763
765 TClonesArray* _tracks2D;
766
769
772
774 //int m_minCDCTdc;
775 //int m_maxCDCTdc;
776 //int m_minTRGTdc;
777 //int m_maxTRGTdc;
786 //TClonesArray* m_CDCTRGTimeMatch;
789
791 void saveCDCHitInformation(std::vector<std::vector<unsigned> >&);
793 void saveTRGHitInformation(std::vector<std::vector<int > >&);
795 void saveTRGRawInformation(std::vector<std::string >&);
796 //void saveCDCTRGTimeMatchInformation(std::vector<std::vector<std::map<int, int > > >& );
797
798 friend class TRGCDCModule;
799 };
800
801//-----------------------------------------------------------------------------
802
803 inline
804 int
806 {
807 return _debugLevel;
808 }
809
810 inline
811 int
813 {
814 return _debugLevel = a;
815 }
816
817 inline
818 unsigned
819 TRGCDC::nLocalLayers(unsigned superLayerId) const
820 {
821 std::vector<TRGCDCLayer*>* superLayer = _superLayers[superLayerId];
822 if (! superLayer) return 0;
823 return superLayer->size();
824 }
825
826 inline
827 const TRGCDCLayer*
828 TRGCDC::layer(unsigned id) const
829 {
830 return _layers[id];
831 }
832
833 inline
834 const std::vector<TRGCDCLayer*>*
835 TRGCDC::superLayer(unsigned id) const
836 {
837 return _superLayers[id];
838 }
839
840 inline
841 float
843 {
844 return _fudgeFactor;
845 }
846
847 inline
848 float
850 {
851 return _fudgeFactor = a;
852 }
853
854 inline
855 std::string
857 {
858 return std::string(_cdcVersion);
859 }
860
861 inline
862 unsigned
863 TRGCDC::nWires(void) const
864 {
865 return _wires.size();
866 }
867
868 inline
869 unsigned
871 {
872 return _superLayers.size();
873 }
874
875 inline
876 unsigned
878 {
879 return _stereoLayers.size();
880 }
881
882 inline
883 unsigned
885 {
886 return _axialLayers.size();
887 }
888
889 inline
890 unsigned
892 {
893 return _axialSuperLayers.size();
894 }
895
896 inline
897 unsigned
899 {
900 return _stereoSuperLayers.size();
901 }
902
903 inline
904 unsigned
905 TRGCDC::nLayers(void) const
906 {
907 return _layers.size();
908 }
909
910 inline
911 float
912 TRGCDC::cellWidth(unsigned a) const
913 {
914 return _width[a];
915 }
916
917 inline
918 float
919 TRGCDC::superLayerR(unsigned i) const
920 {
921 return _r[i];
922 }
923
924 inline
925 float
926 TRGCDC::superLayerR2(unsigned i) const
927 {
928 return _r2[i];
929 }
930
931 inline
932 const TRGCDCSegment&
933 TRGCDC::segment(unsigned id) const
934 {
935 return * _tss[id];
936 }
937
938 inline
939 const TRGCDCSegment&
940 TRGCDC::axialSegment(unsigned a, unsigned b) const
941 {
942 return * _tsSL[a * 2][b];
943 }
944
945 inline
946 const TRGCDCSegment&
947 TRGCDC::stereoSegment(unsigned a, unsigned b) const
948 {
949 return * _tsSL[a * 2 + 1][b];
950 }
951
952 inline
953 unsigned
955 {
956 return _tss.size();
957 }
958
959 inline
960 const TRGClock&
962 {
963 return _clock;
964 }
965
966 inline
967 const TRGClock&
969 {
970 return _clockFE;
971 }
972
973 inline
974 const TRGClock&
976 {
977 return _clockTDC;
978 }
979
980 inline
981 const TRGClock&
983 {
984 return _clockD;
985 }
986
987 inline
988 double
990 {
991 return _offset;
992 }
993
994 inline
995 std::vector<const TRGCDCSegmentHit*>
997 {
998 std::vector<const TRGCDCSegmentHit*> t;
999 t.assign(_segmentHits.begin(), _segmentHits.end());
1000 return t;
1001 }
1002
1003 inline
1004 std::vector<const TRGCDCSegmentHit*>
1005 TRGCDC::segmentHits(unsigned a) const
1006 {
1007 std::vector<const TRGCDCSegmentHit*> t;
1008 t.assign(_segmentHitsSL[a].begin(), _segmentHitsSL[a].end());
1009 return t;
1010 }
1011
1012 inline
1013 std::vector<const TRGCDCSegmentHit*>
1015 {
1016 std::vector<const TRGCDCSegmentHit*> t;
1017 t.assign(_segmentHitsSL[a * 2].begin(), _segmentHitsSL[a * 2].end());
1018 return t;
1019 }
1020
1021 inline
1022 std::vector<const TRGCDCSegmentHit*>
1024 {
1025 std::vector<const TRGCDCSegmentHit*> t;
1026 t.assign(_segmentHitsSL[a * 2 + 1].begin(),
1027 _segmentHitsSL[a * 2 + 1].end());
1028 return t;
1029 }
1030
1031 inline
1032 const TRGCDCFrontEnd*
1033 TRGCDC::frontEnd(unsigned a) const
1034 {
1035 return _fronts[a];
1036 }
1037
1038 inline
1039 const TRGCDCMerger*
1040 TRGCDC::merger(unsigned a) const
1041 {
1042 return _mergers[a];
1043 }
1044
1045 inline
1047 TRGCDC::tsfboard(unsigned a)const
1048 {
1049 return _tsfboards[a];
1050 }
1051
1052 inline
1053 const TRGCDCTracker2D*
1054 TRGCDC::tracker2D(unsigned a)const
1055 {
1056 return _tracker2Ds[a];
1057 }
1058
1059 inline
1060 const TRGCDCLayer*
1061 TRGCDC::segmentLayer(unsigned id) const
1062 {
1063 if (id < _tsLayers.size())
1064 return _tsLayers[id];
1065 return 0;
1066 }
1067
1068 inline
1069 unsigned
1071 {
1072 return _tsLayers.size();
1073 }
1074
1075 inline
1076 unsigned
1077 TRGCDC::mode(void) const
1078 {
1079 return _simulationMode;
1080 }
1081
1082 inline
1083 unsigned
1084 TRGCDC::mode(unsigned a)
1085 {
1086 return _simulationMode = a;
1087 }
1088
1089 inline
1090 unsigned
1092 {
1094 }
1095
1096 inline
1097 int
1099 {
1100 return _returnValue;
1101 }
1102
1103 inline
1104 void
1105 TRGCDC::setReturnValue(int returnValue)
1106 {
1107 _returnValue = returnValue;
1108 }
1109
1110 inline
1111 int
1113 {
1115 }
1116
1117 inline
1118 int
1120 {
1122 }
1123
1124 inline
1125 int
1127 {
1129 }
1130
1131 inline
1132 int
1134 {
1136 }
1137
1139} // namespace Belle2
1140
1141#endif /* TRGCDC_FLAG_ */
This class is the interface between TSim/basf2 TSF module and the firmware simulation core of XSim/IS...
The Class for CDC Geometry Parameters.
A class to fit tracks in 3D.
Definition: Fitter3D.h:40
A class to represent a CDC front-end board.
Definition: FrontEnd.h:37
class of TRGCDCHough3DFinder
Definition: Hough3DFinder.h:35
A class to find tracks using Hough algorithm.
Definition: HoughFinder.h:42
A class to represent a cell layer.
Definition: Layer.h:33
A class to represent a CDC merger board.
Definition: Merger.h:36
A module to simulate the CDC trigger.
Definition: TRGCDCModule.h:31
A class to find 2D tracks using MC information.
Definition: PerfectFinder.h:33
A class to represent a wire in CDC.
Definition: Segment.h:39
a class of TrackSegmentFinder in TRGCDC
A class to represent a CDC 2D tracker board.
Definition: Tracker2D.h:37
A class to represent a wire in CDC.
Definition: Wire.h:56
The instance of TRGCDC is a singleton.
Definition: TRGCDC.h:69
TClonesArray * m_fitParameters
3D fit
Definition: TRGCDC.h:747
bool _fileFitter3D
Switch for Fitter3D.root file.
Definition: TRGCDC.h:602
std::vector< TRGCDCTrack * > _trackList3D
Track list for 3D fitted tracks.
Definition: TRGCDC.h:542
float * _r
R of cell.
Definition: TRGCDC.h:668
std::vector< TRGCDCTracker2D * > _tracker2Ds
CDC 2D finder boards.
Definition: TRGCDC.h:708
const double _offset
Timing offset of CDC trigger.
Definition: TRGCDC.h:693
bool _fFitter3Ds2DFitDrift
Switch to us wire 2D fit or drift 2D fit.
Definition: TRGCDC.h:578
int _firmwareSimulationStopDataClock
Firmware simulation stop clock in CDCTRG data clock.
Definition: TRGCDC.h:530
std::vector< TRGCDCWireHit * > _axialHits
CDC hits on axial wires.
Definition: TRGCDC.h:635
bool _fFitter3Ds2DFit
Switch to us 2D fit or Hough finder results.
Definition: TRGCDC.h:575
unsigned _simulationMode
Simulation mode.
Definition: TRGCDC.h:502
TClonesArray * m_rootTRGRawInformation
[0]: iLayer, [1]: iWire, [2]: Timing(CDC), [3]: MatchNumber MatchNumber: 1: Only CDC,...
Definition: TRGCDC.h:788
std::string _configFilename
CDC trigger configuration filename.
Definition: TRGCDC.h:499
TTree * m_tree
root tree for reconstructed 3D tracks
Definition: TRGCDC.h:738
std::vector< std::vector< TRGCDCLayer * > * > _superLayers
Super layers.
Definition: TRGCDC.h:608
unsigned _fastSimulationMode
Fast simulation mode.
Definition: TRGCDC.h:505
TTree * m_treeAllTracks
root tree for MC tracks
Definition: TRGCDC.h:741
std::vector< TRGCDCWire * > _hitWires
Wires with a hit.
Definition: TRGCDC.h:629
std::vector< TRGCDCSegment * > _tsSL[9]
Track Segments.
Definition: TRGCDC.h:650
int _trgCDCDataInputMode
Switch for TRG CDC input mode.
Definition: TRGCDC.h:768
std::string _cdchitCollectionName
name of the CDCHit DataStore array used as input
Definition: TRGCDC.h:771
int _debugLevel
Debug level.
Definition: TRGCDC.h:493
void perfect3DFinder(std::vector< TRGCDCTrack * > trackList) const
fills stereo TSs to tracks using MC info.
std::vector< TRGCDCTrack * > _trackList2DFitted
Track list for 2D fitted tracks.
Definition: TRGCDC.h:539
int _finder3DMode
Sets mode of 3DFinder.
Definition: TRGCDC.h:599
std::vector< TRGCDCTrackSegmentFinder * > _tsfboards
CDC trigger tsf boards.
Definition: TRGCDC.h:705
bool _fXtSimpleFitter3D
Switch for using simple x-t curve or non-linear x-t curve. 0: non-linear 1: simple.
Definition: TRGCDC.h:605
TClonesArray * m_mcParameters
MC.
Definition: TRGCDC.h:750
float _fudgeFactor
Fudge factor for position error.
Definition: TRGCDC.h:662
float * _width
Cell width in radian.
Definition: TRGCDC.h:665
std::string _outerTSLUTFilename
The filename of LUT for outer track segments.
Definition: TRGCDC.h:557
std::string _innerTSLUTFilename
The filename of LUT for the inner-most track segments.
Definition: TRGCDC.h:554
bool _fLogicLUTTSF
Switch for logic or LUT TSF.
Definition: TRGCDC.h:566
int _fverETF
Switch for selecting ETF version.
Definition: TRGCDC.h:590
std::vector< TRGCDCWireHitMC * > _hitsMC
MC info. of CDC hits.
Definition: TRGCDC.h:644
unsigned _firmwareSimulationMode
Firmware simulation mode.
Definition: TRGCDC.h:515
TClonesArray * m_mcTrackVertexVector
MC vertex.
Definition: TRGCDC.h:756
std::vector< TRGCDCSegment * > _tss
Track Segments.
Definition: TRGCDC.h:647
const bool _perfect2DFinder
Switch to activate perfect 2D finder.
Definition: TRGCDC.h:548
bool _fileHough3D
Switch for Hough3D.root file.
Definition: TRGCDC.h:596
std::vector< TRGCDCLayer * > _stereoLayers
Stereo layers.
Definition: TRGCDC.h:623
const TRGClock _clockD
CDC trigger data clock.
Definition: TRGCDC.h:684
bool _fileTSF
Switch for TSF.root file.
Definition: TRGCDC.h:584
bool _fileETF
Switch for ETF.root file.
Definition: TRGCDC.h:587
std::vector< std::vector< TRGCDCLayer * > * > _stereoSuperLayers
Stereo super layers.
Definition: TRGCDC.h:614
std::string _rootTRGCDCFilename
The filename of root file for TRGCDC.
Definition: TRGCDC.h:560
std::vector< TRGCDCSegmentHit * > _segmentHits
Track Segments with hits.
Definition: TRGCDC.h:656
std::vector< TRGCDCLayer * > _tsLayers
Track Segment layers.
Definition: TRGCDC.h:653
TTree * m_treeROOTInput
Debugging members for firmware ROOT input.
Definition: TRGCDC.h:779
std::vector< TRGCDCWireHit * > _badHits
Bad CDC hits.(not used now)
Definition: TRGCDC.h:641
bool _makeRootFile
Switch for TRGCDC.root file.
Definition: TRGCDC.h:545
std::vector< TRGLink * > _links
All serial links.
Definition: TRGCDC.h:696
EReturnValueType
Enum for returnValue types.
Definition: TRGCDC.h:74
int _returnValue
Return value for trg cdc module;.
Definition: TRGCDC.h:533
std::vector< TRGCDCTrack * > _trackList2D
Track list by 2D finding.
Definition: TRGCDC.h:536
bool _fprintFirmETF
Switch for printing Firmware inputs for ETF.
Definition: TRGCDC.h:593
TRGCDCHoughFinder * _hFinder
Hough finder.
Definition: TRGCDC.h:720
TRGCDCTrackSegmentFinder * _tsFinder
Track Segement Finder.
Definition: TRGCDC.h:711
std::vector< TRGCDCEventTime * > _eventTime
EventTime.
Definition: TRGCDC.h:729
TClonesArray * m_mcTrack4Vector
MC track.
Definition: TRGCDC.h:753
TRGSignal _firmwareSimulationWindow
Firmware simulation time window in FE.
Definition: TRGCDC.h:524
std::vector< TRGCDCWire * > _wires
All wires.
Definition: TRGCDC.h:626
TClonesArray * m_rootTRGHitInformation
[0]: iLayer, [1]: iWire, [2]: window number, [3]: priority timing
Definition: TRGCDC.h:783
std::vector< TRGCDCLayer * > _layers
All layers.
Definition: TRGCDC.h:617
const TRGClock _clock
CDC trigger system clock.
Definition: TRGCDC.h:674
TClonesArray * m_mcTrackStatus
MC track status.
Definition: TRGCDC.h:759
const bool _perfect3DFinder
Switch to activate perfect 3D finder.
Definition: TRGCDC.h:551
double _inefficiency
Hit inefficiency parameter.
Definition: TRGCDC.h:581
TClonesArray * m_evtTime
Event time.
Definition: TRGCDC.h:762
TFile * m_file
root file
Definition: TRGCDC.h:735
TRGCDCFitter3D * _fitter3D
3D fitter.
Definition: TRGCDC.h:726
std::string getCDCHitCollectionName() const
get name of the CDCHit DataStore array used as input
Definition: TRGCDC.h:247
std::vector< TRGCDCFrontEnd * > _fronts
CDC front-end boards.
Definition: TRGCDC.h:699
float * _r2
R^2 of cell.
Definition: TRGCDC.h:671
std::vector< TRGCDCSegmentHit * > _segmentHitsSL[9]
Track Segments with hits in each super layer.
Definition: TRGCDC.h:659
std::vector< TRGCDCWireHit * > _stereoHits
CDC hits on stereo wires.
Definition: TRGCDC.h:638
const TRGClock & userClock3125(void) const
returns the user clock for Aurora 3.125 Gbps.
int _firmwareSimulationStop
Fimrware simulation stop clock in FE.
Definition: TRGCDC.h:521
int _firmwareSimulationStart
Fimrware simulation start clock in FE.
Definition: TRGCDC.h:518
TRGCDCPerfectFinder * _pFinder
Perfect 2D finder.
Definition: TRGCDC.h:714
std::vector< std::vector< TRGCDCLayer * > * > _axialSuperLayers
Axial super layers.
Definition: TRGCDC.h:611
TClonesArray * _tracks2D
2D track information
Definition: TRGCDC.h:765
std::vector< TRGCDCLayer * > _axialLayers
Axial layers.
Definition: TRGCDC.h:620
int m_eventNum
Event number.
Definition: TRGCDC.h:732
TRGCDCPerfectFinder * _p3DFinder
Perfect 3D finder.
Definition: TRGCDC.h:717
CDC::CDCGeometryPar * m_cdcp
returns a pointer to CDCGeometryPar
Definition: TRGCDC.h:252
TRGCDCHough3DFinder * _h3DFinder
Hough 3D finder.
Definition: TRGCDC.h:723
const TRGClock _clockUser3125
CDC trigger user clock for Aurora 3.125 Gbps.
Definition: TRGCDC.h:687
void updateMC(void)
updates TRGCDC information for MC.
std::vector< TRGCDCWireHit * > _hits
CDC hits.
Definition: TRGCDC.h:632
const TRGClock _clockFE
CDC front end clock. Resolution is CDC TdcBinWidth.
Definition: TRGCDC.h:677
std::string _rootFitter3DFilename
The filename of root file for Fitter3D.
Definition: TRGCDC.h:563
bool _fFitter3Dsmclr
Switch for MC L/R information in Fitter3D.
Definition: TRGCDC.h:572
std::vector< TRGCDCMerger * > _mergers
CDC trigger merger boards.
Definition: TRGCDC.h:702
bool _fLRLUT
Switch for the LR LUT in Fitter3D.
Definition: TRGCDC.h:569
const TRGClock _clockUser6250
CDC trigger user clock for Aurora 6.250 Gbps.
Definition: TRGCDC.h:690
TTree * _tree2D
root tree for 2D tracks
Definition: TRGCDC.h:744
const TRGClock _clockTDC
CDC trigger TDC clock.
Definition: TRGCDC.h:681
const std::string _cdcVersion
CDC version.
Definition: TRGCDC.h:496
int _firmwareSimulationStartDataClock
Firmware simulation start clock in CDCTRG data clock.
Definition: TRGCDC.h:527
TClonesArray * m_rootCDCHitInformation
[0]: iLayer, [1]: iWire, [2]: CDCADC, [3]: CDCTDC, [4]: CDC FE TRG timing
Definition: TRGCDC.h:781
A class to represent a digitized signal. Unit is nano second.
Definition: Clock.h:38
A class to represent a digitized signal. Unit is nano second.
Definition: Signal.h:23
const TRGCDCMerger * merger(unsigned id) const
returns a merger board.
Definition: TRGCDC.h:1040
std::vector< const TRGCDCSegmentHit * > segmentHits(void) const
returns a list of TRGCDCSegmentHit.
Definition: TRGCDC.h:996
std::vector< TRGCDCTrack * > getTrackList2DFitted(void)
returns 2D fitted track list.
Definition: TRGCDC.cc:206
unsigned nAxialLayers(void) const
return # of axial layers.
Definition: TRGCDC.h:884
const TRGClock & systemClock(void) const
calculates corrected drift time.
Definition: TRGCDC.h:961
unsigned localId(unsigned wireId) const
returns local ID in a layer. This function is expensive.
Definition: TRGCDC.cc:1773
void configure(void)
configures trigger modules for firmware simulation.
Definition: TRGCDC.cc:2450
int debugLevel(void) const
returns debug level.
Definition: TRGCDC.h:805
std::vector< const TRGCDCSegmentHit * > axialSegmentHits(unsigned) const
returns a list of TRGCDCSegmentHit in a axial super layer N.
Definition: TRGCDC.h:1014
unsigned nSegmentLayers(void) const
returns # of track segment layers.
Definition: TRGCDC.h:1070
float fudgeFactor(void) const
returns fudge factor for drift time error.
Definition: TRGCDC.h:842
static TRGCDC * getTRGCDC(void)
returns TRGCDC object.
Definition: TRGCDC.cc:192
void setReturnValue(EReturnValueType const &moduleName, bool flag)
sets return value for trg cdc module.
Definition: TRGCDC.cc:2748
int firmwareSimulationStopDataClock(void) const
returns stop clock of the firmware simulation in data clock.
Definition: TRGCDC.h:1133
unsigned layerId(unsigned wireId) const
returns layer ID. This function is expensive.
Definition: TRGCDC.cc:1793
std::string name(void) const
simulates track segment decisions.
Definition: TRGCDC.cc:92
unsigned localLayerId(unsigned wireId) const
returns local layer ID in a super layer. This function is expensive.
Definition: TRGCDC.cc:1842
const TRGClock & TDCClock(void) const
returns the system clock of the trigger TDC after mergers (2 * front-end binwidth)
Definition: TRGCDC.h:975
void fastClear(void)
clears TRGCDC information.
Definition: TRGCDC.cc:981
std::vector< const TRGCDCSegmentHit * > stereoSegmentHits(unsigned) const
returns a list of TRGCDCSegmentHit in a stereo super layer N.
Definition: TRGCDC.h:1023
std::string wireName(unsigned wireId) const
returns wire name.
Definition: TRGCDC.cc:1759
const TRGCDCTracker2D * tracker2D(unsigned id) const
returns a 2D tracker board.
Definition: TRGCDC.h:1054
float cellWidth(unsigned superLayerId) const
returns cell width in unit of radian.
Definition: TRGCDC.h:912
const TRGCDCSegment & stereoSegment(unsigned lyrId, unsigned id) const
returns a track segment in stereo layers. (lyrId is stereo #)
Definition: TRGCDC.h:947
void terminate(void)
terminates when run is finished
Definition: TRGCDC.cc:739
const TRGCDCLayer * segmentLayer(unsigned id) const
returns a pointer to a track segment layer.
Definition: TRGCDC.h:1061
const TRGCDCFrontEnd * frontEnd(unsigned id) const
returns a front-end board.
Definition: TRGCDC.h:1033
TRGCDCTrackSegmentFinder * tsfboard(unsigned id) const
returns a TSF board.
Definition: TRGCDC.h:1047
bool neighbor(const TRGCDCWire &w0, const TRGCDCWire &w1) const
returns true if w0 and w1 are neighbor.
Definition: TRGCDC.cc:2030
virtual ~TRGCDC()
Destructor.
Definition: TRGCDC.cc:2003
void saveTRGHitInformation(std::vector< std::vector< int > > &)
Save functions for ROOT.
Definition: TRGCDC.cc:2775
std::vector< TRGCDCTrack * > getTrackList3D(void)
returns 3D track list (fitted).
Definition: TRGCDC.cc:212
unsigned mode(void) const
sets simulation mode.
Definition: TRGCDC.h:1077
unsigned nAxialSuperLayers(void) const
return # of axial super layers.
Definition: TRGCDC.h:891
std::vector< const TRGCDCWireHitMC * > hitsMC(void) const
returns a list of TRGCDCWireHitMC.
Definition: TRGCDC.cc:1751
const TRGClock & dataClock(void) const
returns the data clock.
Definition: TRGCDC.h:982
unsigned nSegments(void) const
returns # of track segments.
Definition: TRGCDC.h:954
unsigned nLocalLayers(unsigned superLayerId) const
returns # of wire layers in a super layer.
Definition: TRGCDC.h:819
float superLayerR(unsigned superLayerId) const
returns inner radius of super layer.
Definition: TRGCDC.h:919
unsigned axialStereoSuperLayerId(unsigned axialStereo, unsigned axialStereoLayerId) const
returns axialStereo super layer ID. This function is expensive.
Definition: TRGCDC.cc:1865
unsigned firmwareSimulationMode(void) const
returns firmware simulation mode.
Definition: TRGCDC.h:1091
unsigned nSuperLayers(void) const
returns # of super layers.
Definition: TRGCDC.h:870
int firmwareSimulationStart(void) const
returns start clock of the firmware simulation in FE clock.
Definition: TRGCDC.h:1112
unsigned nStereoLayers(void) const
returns # of stereo layers.
Definition: TRGCDC.h:877
int firmwareSimulationStartDataClock(void) const
returns start clock of the firmware simulation in data clock.
Definition: TRGCDC.h:1126
std::string versionCDC(void) const
returns CDC version.
Definition: TRGCDC.h:856
void initialize(unsigned houghFinderPeakMin, const std::string &houghMappingFilePlus, const std::string &houghMappingFileMinus, unsigned houghDoit)
initializes CDC geometry.
Definition: TRGCDC.cc:372
const TRGCDCSegment & segment(unsigned id) const
returns a track segment.
Definition: TRGCDC.h:933
void saveTRGRawInformation(std::vector< std::string > &)
Save functions for ROOT.
Definition: TRGCDC.cc:2789
unsigned nLayers(void) const
return # of layers.
Definition: TRGCDC.h:905
int getEventTime(void) const
returns bad hits(finding invalid hits).
Definition: TRGCDC.cc:2743
const std::vector< TRGCDCLayer * > * superLayer(unsigned id) const
returns a pointer to a super-layer.
Definition: TRGCDC.h:835
void dump(const std::string &message) const
dumps debug information.
Definition: TRGCDC.cc:767
std::vector< const TRGCDCWireHit * > stereoHits(void) const
returns a list of stereo hits.
Definition: TRGCDC.cc:1692
const TRGCDCSegment & axialSegment(unsigned lyrId, unsigned id) const
returns a track segment in axial layers. (lyrId is axial #)
Definition: TRGCDC.h:940
std::vector< TRGCDCTrack * > getTrackList2D(void)
returns 2D track list (no fit).
Definition: TRGCDC.cc:200
std::vector< const TRGCDCWireHit * > axialHits(void) const
returns a list of axial hits.
Definition: TRGCDC.cc:1679
unsigned superLayerId(unsigned wireId) const
returns super layer ID. This function is expensive.
Definition: TRGCDC.cc:1820
double systemOffsetMC(void) const
returns the system offset in MC.
Definition: TRGCDC.h:989
std::vector< const TRGCDCWireHit * > hits(void) const
returns a list of TRGCDCWireHit.
Definition: TRGCDC.cc:1705
int getReturnValue(void) const
gets return value for trg cdc module.
Definition: TRGCDC.h:1098
static TRGCDC * _cdc
CDC trigger singleton.
Definition: TRGCDC.h:490
const TRGCDCLayer * layer(unsigned id) const
returns a pointer to a layer. 0 will be returned if 'id' is invalid.
Definition: TRGCDC.h:828
void update()
updates TRGCDC wire information. clear() is called in this function.
Definition: TRGCDC.cc:984
unsigned nStereoSuperLayers(void) const
returns # of stereo super layers.
Definition: TRGCDC.h:898
void fastSimulation(void)
Fast simulation.
Definition: TRGCDC.cc:2064
std::string version(void) const
returns version.
Definition: TRGCDC.cc:98
float superLayerR2(unsigned superLayerId) const
returns (inner radius)^2 of super layer.
Definition: TRGCDC.h:926
unsigned nWires(void) const
return # of wires.
Definition: TRGCDC.h:863
void simulate(void)
fast trigger simulation.
Definition: TRGCDC.cc:2049
void clear(void)
clears all TRGCDC hit information.
Definition: TRGCDC.cc:942
void saveCDCHitInformation(std::vector< std::vector< unsigned > > &)
Save functions for ROOT.
Definition: TRGCDC.cc:2760
void firmwareSimulation(void)
Firmware simulation.
Definition: TRGCDC.cc:2363
void classification(void)
classify hits.
Definition: TRGCDC.cc:1604
void updateByData(int inputMode)
updates TRGCDC wire information by Hardware data 0: From CDC FE ASCII file (Implementing) 1: From CDC...
Definition: TRGCDC.cc:1179
const TRGClock & systemClockFE(void) const
returns the system clock of the front-end
Definition: TRGCDC.h:968
void storeSimulationResults(std::string collection2Dfinder, std::string collection2Dfitter, std::string collection3Dfitter)
Save results of fast simulation to data store (segment hits & tracks).
Definition: TRGCDC.cc:2248
int firmwareSimulationStop(void) const
returns stop clock of the firmware simulation in FE clock.
Definition: TRGCDC.h:1119
const TRGCDCWire * wire(unsigned wireId) const
returns a pointer to a wire.
Definition: TRGCDC.cc:892
Abstract base class for different kinds of events.