AnalysisTimingATLASpix.h 5.09 KB
Newer Older
1
2
/**
 * @file
3
 * @brief Definition of [AnalysisTimingATLASpix] module
4
5
 *
 * @copyright Copyright (c) 2018-2020 CERN and the Corryvreckan authors.
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * This software is distributed under the terms of the MIT License, copied verbatim in the file "LICENSE.md".
 * In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an
 * Intergovernmental Organization or submit itself to any jurisdiction.
 * *
 * Refer to the User's Manual for more details.
 */

#include <iostream>
#include "TGraphErrors.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TProfile2D.h"
#include "core/module/Module.hpp"

namespace corryvreckan {
    /** @ingroup Modules
     * @brief Module to do function
     *
     * More detailed explanation of module
     */
26
    class AnalysisTimingATLASpix : public Module {
27
28
29
30
31
32
33

    public:
        /**
         * @brief Constructor for this unique module
         * @param config Configuration object for this module as retrieved from the steering file
         * @param detector Pointer to the detector for this module instance
         */
34
        AnalysisTimingATLASpix(Configuration config, std::shared_ptr<Detector> detector);
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
        void initialise();
        StatusCode run(std::shared_ptr<Clipboard> clipboard);
        void finalise();

    private:
        std::shared_ptr<Detector> m_detector;

        // timing correction functions:
        void correctClusterTimestamp(Cluster*, int mode);

        // 1D histograms:
        TH1F* hTrackCorrelationTime;
        TH1F* hTrackCorrelationTimeAssoc;
        TH1F* hTrackCorrelationTime_rowCorr;
        TH1F* hTrackCorrelationTime_rowAndTimeWalkCorr;
        TH1F* hTrackCorrelationTime_rowAndTimeWalkCorr_l25;
        TH1F* hTrackCorrelationTime_rowAndTimeWalkCorr_l40;
        TH1F* hTrackCorrelationTime_rowAndTimeWalkCorr_g40;
        TH1D* hTrackCorrelationTime_example;
54
        TH1F* hClusterTimeMinusPixelTime;
55
56

        // 2D histograms:
57
        TH2F* hTrackCorrelationTimeAssocVsTime;
58
59
60
61
62
63
64
65
66
67
68
69
70
71
        TH2F* hTrackCorrelationTimeVsCol; // control plot only
        TH2F* hTrackCorrelationTimeVsRow;
        TH2F* hTrackCorrelationTimeVsRow_1px;
        TH2F* hTrackCorrelationTimeVsRow_npx;
        TH2F* hTrackCorrelationTimeVsRow_rowCorr;
        TH2F* hTrackCorrelationTimeVsTot;
        TH2F* hTrackCorrelationTimeVsTot_1px;
        TH2F* hTrackCorrelationTimeVsTot_npx;
        TH2F* hTrackCorrelationTimeVsTot_rowCorr;
        TH2F* hTrackCorrelationTimeVsTot_rowCorr_1px;
        TH2F* hTrackCorrelationTimeVsTot_rowCorr_npx;
        TH2F* hTrackCorrelationTimeVsRow_rowAndTimeWalkCorr;
        TH2F* hTrackCorrelationTimeVsTot_rowAndTimeWalkCorr;

72
73
        TProfile2D* hPixelTrackCorrelationTimeMap;

74
75
76
        TH2F* hClusterSizeVsTot_Assoc;

        TH2F* hHitMapAssoc;
77
        TH2F* hHitMapAssoc_highCharge;
78
        TH2F* hHitMapAssoc_inPixel;
79
        TH2F* hHitMapAssoc_inPixel_highCharge;
80
81
        TH2F* hClusterMapAssoc;

82
        TH2F* hTotVsTime;
83
        TH2F* hTotVsTime_high;
84
        TH2F* hTotVsTime_low;
85

86
        // Control Plots for "left/right tail" and "main peak" of time correlation
87
        TH2F* hInPixelMap_leftTail;
88
89
        TH2F* hInPixelMap_rightTail;
        TH2F* hInPixelMap_mainPeak;
90
        TH2F* hClusterMap_leftTail;
91
        TH2F* hClusterMap_rightTail;
92
        TH2F* hClusterMap_mainPeak;
93
        TH1F* hTot_leftTail;
94
        TH1F* hTot_rightTail;
95
        TH1F* hTot_mainPeak;
96
97
98
        TH1F* hTot_leftTail_1px;
        TH1F* hTot_rightTail_1px;
        TH1F* hTot_mainPeak_1px;
99
        TH1F* hPixelTimestamp_leftTail;
100
        TH1F* hPixelTimestamp_rightTail;
101
        TH1F* hPixelTimestamp_mainPeak;
102
        TH1F* hClusterSize_leftTail;
103
        TH1F* hClusterSize_rightTail;
104
        TH1F* hClusterSize_mainPeak;
105
106
107
108
109
110
111
112
113
114
115
116

        // TGraphErrors:
        TGraphErrors* gTimeCorrelationVsRow;
        TGraphErrors* gTimeCorrelationVsTot_rowCorr;
        TGraphErrors* gTimeCorrelationVsTot_rowCorr_1px;
        TGraphErrors* gTimeCorrelationVsTot_rowCorr_npx;

        TGraphErrors* gRowCorr;
        TGraphErrors* gTimeWalkCorr;

        // Member Variables:
        std::string m_DUT;
117
        double m_timeCut;
118
119
        double m_chi2ndofCut;
        double m_timeCutFrameEdge;
120
        double m_clusterChargeCut;
121
        size_t m_clusterSizeCut;
122
        int m_highTotCut;       // for pixel->tot()
123
        int m_lowTotCut;        // for pixel->tot()
124
        double m_highChargeCut; // for cluster->charge()
125
        double m_leftTailCut;
126
        double m_rightTailCut;
127
128

        std::string m_correctionFile_row;
129
        std::string m_correctionGraph_row;
130
        std::string m_correctionFile_timewalk;
131
        std::string m_correctionGraph_timewalk;
132
133
134
135
        bool m_calcCorrections;
        bool m_pointwise_correction_row;
        bool m_pointwise_correction_timewalk;
        int m_totBinExample;
136
        double m_inpixelBinSize;
137
138
139
140
141
142
143
144

        int total_tracks_uncut;
        int tracks_afterChi2Cut;
        int tracks_hasIntercept;
        int tracks_isWithinROI;
        int tracks_afterMasking;
        int total_tracks;
        int matched_tracks;
145
        int tracks_afterClusterChargeCut;
146
147
148
149
        int tracks_afterClusterSizeCut;
    };

} // namespace corryvreckan