AnalysisTimingATLASpix.h 4.94 KB
Newer Older
1
2
/**
 * @file
3
 * @brief Definition of [AnalysisTimingATLASpix] module
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 * @copyright Copyright (c) 2018 CERN and the Allpix Squared authors.
 * 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
     */
25
    class AnalysisTimingATLASpix : public Module {
26
27
28
29
30
31
32

    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
         */
33
        AnalysisTimingATLASpix(Configuration config, std::shared_ptr<Detector> detector);
34
35
36
37
38
39
40
41
42
43
44
45
46
47
        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;
48
49
50
51
        TH1F* hTrackCorrelationTime_rowAndTWCorr;
        TH1F* hTrackCorrelationTime_rowAndTWCorr_l25;
        TH1F* hTrackCorrelationTime_rowAndTWCorr_l40;
        TH1F* hTrackCorrelationTime_rowAndTWCorr_g40;
52
        TH1D* hTrackCorrelationTime_example;
53
        TH1F* hClusterTimeMinusPixelTime;
54
55

        // 2D histograms:
56
        TH2F* hTrackCorrelationTimeAssocVsTime;
57
58
59
60
61
62
63
64
65
66
67
        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;
68
69
        TH2F* hTrackCorrelationTimeVsRow_rowAndTWCorr;
        TH2F* hTrackCorrelationTimeVsTot_rowAndTWCorr;
70

71
72
        TProfile2D* hPixelTrackCorrelationTimeMap;

73
74
75
        TH2F* hClusterSizeVsTot_Assoc;

        TH2F* hHitMapAssoc;
76
        TH2F* hHitMapAssoc_highToT;
77
        TH2F* hHitMapAssoc_inPixel;
78
        TH2F* hHitMapAssoc_inPixel_highToT;
79
80
        TH2F* hClusterMapAssoc;

81
        TH2F* hTotVsRow;
82
        TH2F* hTotVsTime;
83
84
        TH2F* hTotVsTime_high;

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

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

        TGraphErrors* gRowCorr;
        TGraphErrors* gTimeWalkCorr;

        // Member Variables:
        std::string m_DUT;
116
        double m_timeCut;
117
118
        double m_chi2ndofCut;
        double m_timeCutFrameEdge;
119
        double m_clusterChargeCut;
120
        size_t m_clusterSizeCut;
121
122
123
        int m_highTotCut; // for pixel->tot()
        int m_lowTotCut;  // for pixel->tot()
        double m_timingTailCut;
124
125

        std::string m_correctionFile_row;
126
        std::string m_correctionGraph_row;
127
        std::string m_correctionFile_timewalk;
128
        std::string m_correctionGraph_timewalk;
129
130
131
132
        bool m_calcCorrections;
        bool m_pointwise_correction_row;
        bool m_pointwise_correction_timewalk;
        int m_totBinExample;
133
        XYVector m_inpixelBinSize;
134
135
136
137
138
139
140
141

        int total_tracks_uncut;
        int tracks_afterChi2Cut;
        int tracks_hasIntercept;
        int tracks_isWithinROI;
        int tracks_afterMasking;
        int total_tracks;
        int matched_tracks;
142
        int tracks_afterClusterChargeCut;
143
144
145
146
        int tracks_afterClusterSizeCut;
    };

} // namespace corryvreckan