CFEL - ASG Software Suite  2.5.0
CASS
achimsorter_hex.h
Go to the documentation of this file.
1 // Copyright (C) 2008-2011 Lutz Foucar
2 
3 /**
4  * @file achimsorter_hex.h file contains class that uses achims resort routine
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _ACHIMSORTER_HEX_H_
10 #define _ACHIMSORTER_HEX_H_
11 
12 #include <tr1/memory>
13 #include <vector>
14 #include <utility>
15 #include <stdint.h>
16 
18 #include "delayline_detector.h"
19 
20 
21 class sort_class;
22 
23 namespace cass
24 {
25 namespace ACQIRIS
26 {
27 /** Achims resort routine wrapper
28  *
29  * this class will use achims resort routine to calculate the detectorhits
30  * from the signals on the wireends and the mcp. It needs to be used closely
31  * together with PostProcessor 170 (cass::HexCalibrator) that will calculate
32  * parameters for full functionality of achims resort routine.
33  *
34  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{TimeSumU}\n
35  * Center of the timesum of layer U. Default is 100.
36  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{TimeSumUWidth}\n
37  * With at the base of timesum of layer U. Default is 0.
38  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{TimeSumV}\n
39  * Center of the timesum of layer W. Default is 100.
40  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{TimeSumVWidth}\n
41  * With at the base of timesum of layer U. Default is 0.
42  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{TimeSumW}\n
43  * Center of the timesum of layer W. Default is 100.
44  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{TimeSumWWidth}\n
45  * With at the base of timesum of layer U. Default is 0.
46  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{MaxRuntime}\n
47  * the maximum time it takes a signal to get across the delayline wire.
48  * Default is 150.
49  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{DeadTimeAnode}\n
50  * the deadtime betwenn 2 anode singals in ns. Default is 20.
51  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{DeadTimeMCP}\n
52  * the deadtime between 2 mcp signals in ns. Default is 20.
53  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{MCPRadius}\n
54  * The radius of the MCP in mm. Should be ~10 percent bigger that the
55  * actual value. Default is 88.
56  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{UseMCP}\n
57  * use the mcp signal when reconstructing the detector hits. Default
58  * is 'true'
59  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{ScalefactorU}\n
60  * Conversion factor to convert position from ns to mm. The scalefactors
61  * of the other two layers will be determined by the calibrator and
62  * written into the settingsfile (see parameter SettingsFilename)
63  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{CenterX|CenterY}\n
64  * Center position of the detector image, if not centered around 0.
65  * Default is 0|0
66  * @cassttng AcqirisDetectors/\%detectorname\%/HexSorting/{SettingsFilename}\n
67  * Name of the file that contains the advanced settings. This will be
68  * created by the PostProcessor that does the Hex calibration (pp170).
69  * See cass::HexCalibrator for descriptions of this PostProcessor.
70  *
71  * @author Lutz Foucar
72  */
73 class HexSorter
75 {
76 public:
77  /** constructor
78  *
79  * creates and intitializes the achims routine
80  */
81  HexSorter();
82 
83  /** the function creating the detectorhit list
84  *
85  * @return reference to the hit container
86  * @param hits the hitcontainer
87  */
89 
90  /** load the detector analyzers settings from .ini file
91  *
92  * retrieve all necessary information to be able to sort the signals of
93  * the detector to detector hits. Also retrieve the signal producers of
94  * the layers whos signals we should sort.
95  *
96  * @param s the CASSSetting object
97  * @param d the detector object that we are belonging to
98  */
100 
101 private:
102  /** container for tdc like arrays mapped to the corrosponding signalproducer
103  *
104  * the order in the vector is as follows:
105  * - 0: mcp
106  * - 1: u1
107  * - 2: u2
108  * - 3: v1
109  * - 4: v2
110  * - 5: w1
111  * - 6: w2
112  */
113  std::vector<std::pair<SignalProducer*,std::vector<double> > > _signals;
114 
115  /** the instance of Achims routine */
116  std::tr1::shared_ptr<sort_class> _sorter;
117 
118  /** counter array for achims routine
119  *
120  * this is used so that the routine knows how many signals are in each
121  * array
122  */
123  std::vector<int32_t> _count;
124 
125  /** the timesums
126  *
127  * the timesums in this containers are layed out as follows:
128  * - 0: u layer
129  * - 1: v layer
130  * - 2: w layer
131  */
132  std::vector<double> _timesums;
133 
134  /** the center of the detector */
135  std::pair<double,double> _center;
136 
137  /** the w-layer offset */
139 };
140 
141 }//end namespace acqiris
142 }//end namespace cass
143 #endif
std::vector< int32_t > _count
counter array for achims routine
void loadSettings(CASSSettings &s, DelaylineDetector &d)
load the detector analyzers settings from .ini file
std::vector< double > _timesums
the timesums
Settings for CASS.
Definition: cass_settings.h:30
detectorHits_t & operator()(detectorHits_t &hits)
the function creating the detectorhit list
std::vector< detectorHit_t > detectorHits_t
define container for all detector hits
std::vector< std::pair< SignalProducer *, std::vector< double > > > _signals
container for tdc like arrays mapped to the corrosponding signalproducer
Average out the iShit status to get the avererage hits
file contains the classes that describe a delayline detector.
Achims resort routine wrapper.
std::tr1::shared_ptr< sort_class > _sorter
the instance of Achims routine
file contains base class for all delayline detector analyzers.
double _wLayerOffset
the w-layer offset
std::pair< double, double > _center
the center of the detector
Base class for all detector analyzers.