AnalysisTimingATLASpix.h 4.91 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
48
49
50
51
52
        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;
53
        TH1F* hClusterTimeMinusPixelTime;
54
55

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

71
72
        TProfile2D* hPixelTrackCorrelationTimeMap;

73
74
75
        TH2F* hClusterSizeVsTot_Assoc;

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

81
        TH2F* hTotVsTime;
82
83
        TH2F* hTotVsTime_high;

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

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

        TGraphErrors* gRowCorr;
        TGraphErrors* gTimeWalkCorr;

        // Member Variables:
        std::string m_DUT;
112
        double m_timeCut;
113
114
        double m_chi2ndofCut;
        double m_timeCutFrameEdge;
115
        double m_clusterChargeCut;
116
        size_t m_clusterSizeCut;
117
118
        int m_highTotCut;       // for pixel->tot()
        double m_highChargeCut; // for cluster->charge()
119
        double m_leftTailCut;
120
        double m_rightTailCut;
121
122

        std::string m_correctionFile_row;
123
        std::string m_correctionGraph_row;
124
        std::string m_correctionFile_timewalk;
125
        std::string m_correctionGraph_timewalk;
126
127
128
129
        bool m_calcCorrections;
        bool m_pointwise_correction_row;
        bool m_pointwise_correction_timewalk;
        int m_totBinExample;
130
        double m_inpixelBinSize;
131
132
133
134
135
136
137
138

        int total_tracks_uncut;
        int tracks_afterChi2Cut;
        int tracks_hasIntercept;
        int tracks_isWithinROI;
        int tracks_afterMasking;
        int total_tracks;
        int matched_tracks;
139
        int tracks_afterClusterChargeCut;
140
141
142
143
        int tracks_afterClusterSizeCut;
    };

} // namespace corryvreckan