AnalysisTimingATLASpix.h 4.37 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
        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;

        // 2D histograms:
        TH2F* hTrackCorrelationTimeVsCol; // control plot only
        TH2F* hTrackCorrelationTimeVsRow;
        TH2F* hTrackCorrelationTimeVsRow_1px;
        TH2F* hTrackCorrelationTimeVsRow_npx;
        TH2F* hTrackCorrelationTimeVsRow_rowCorr;
        TH2F* hTrackCorrelationTimeVsTot;
        TH2F* hTrackCorrelationTimeVsTot_1px;
        TH2F* hTrackCorrelationTimeVsTot_npx;
        TH1F* hClusterTimeMinusPixelTime;
        TH2F* hTrackCorrelationTimeVsTot_rowCorr;
        TH2F* hTrackCorrelationTimeVsTot_rowCorr_1px;
        TH2F* hTrackCorrelationTimeVsTot_rowCorr_npx;
        TH2F* hTrackCorrelationTimeVsRow_rowAndTimeWalkCorr;
        TH2F* hTrackCorrelationTimeVsTot_rowAndTimeWalkCorr;

        TH2F* hClusterSizeVsTot_Assoc;

        TH2F* hHitMapAssoc;
        TH2F* hHitMapAssoc_highTot;
        TH2F* hHitMapAssoc_inPixel;
        TH2F* hHitMapAssoc_inPixel_highTot;
        TH2F* hClusterMapAssoc;

        TH2F* hTotVsTime_low;
        TH2F* hTotVsTime_high;

        // Control Plots for "left tail":
        TH2F* hClusterMap_leftTail;
        TH1F* hTot_leftTail;
84
        TH1F* hPixelTimestamp_leftTail;
85
86
        TH1F* hClusterSize_leftTail;

87
88
89
90
        TH2F* hClusterMap_mainpeak;
        TH1F* hTot_mainpeak;
        TH1F* hPixelTimestamp_mainpeak;
        TH1F* hClusterSize_mainpeak;
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

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

        TGraphErrors* gRowCorr;
        TGraphErrors* gTimeWalkCorr;

        // Member Variables:
        std::string m_DUT;
        double m_timingCut;
        double m_chi2ndofCut;
        double m_timeCutFrameEdge;
        double m_clusterTotCut;
        size_t m_clusterSizeCut;
108
109
        int m_highTotCut;
        double m_leftTailCut;
110
111

        std::string m_correctionFile_row;
112
        std::string m_correctionGraph_row;
113
        std::string m_correctionFile_timewalk;
114
        std::string m_correctionGraph_timewalk;
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
        bool m_calcCorrections;
        bool m_pointwise_correction_row;
        bool m_pointwise_correction_timewalk;
        int m_totBinExample;

        int total_tracks_uncut;
        int tracks_afterChi2Cut;
        int tracks_hasIntercept;
        int tracks_isWithinROI;
        int tracks_afterMasking;
        int total_tracks;
        int matched_tracks;
        int tracks_afterClusterTotCut;
        int tracks_afterClusterSizeCut;
    };

} // namespace corryvreckan