Tracking4D.h 3.26 KB
Newer Older
Simon Spannagel's avatar
Simon Spannagel committed
1
2
3
4
5
6
7
8
9
10
/**
 * @file
 * @brief Definition of module Tracking4D
 *
 * @copyright Copyright (c) 2017-2020 CERN and the Corryvreckan 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.
 */

11
12
#ifndef TRACKING4D_H
#define TRACKING4D_H 1
13

14
15
16
#include <TCanvas.h>
#include <TH1F.h>
#include <TH2F.h>
17
#include <iostream>
18
#include "core/module/Module.hpp"
19
#include "objects/Cluster.hpp"
Simon Spannagel's avatar
Simon Spannagel committed
20
#include "objects/Pixel.hpp"
21
#include "objects/Track.hpp"
22

23
namespace corryvreckan {
24
    /** @ingroup Modules
Simon Spannagel's avatar
Simon Spannagel committed
25
     */
26
    class Tracking4D : public Module {
Simon Spannagel's avatar
Simon Spannagel committed
27
28
29

    public:
        // Constructors and destructors
30
        Tracking4D(Configuration& config, std::vector<std::shared_ptr<Detector>> detectors);
31
        ~Tracking4D() {}
Simon Spannagel's avatar
Simon Spannagel committed
32
33

        // Functions
34
        void initialize() override;
35
        StatusCode run(const std::shared_ptr<Clipboard>& clipboard) override;
Simon Spannagel's avatar
Simon Spannagel committed
36

37
    private:
Simon Spannagel's avatar
Simon Spannagel committed
38
39
40
41
42
43
44
        // Histograms
        TH1F* trackChi2;
        TH1F* clustersPerTrack;
        TH1F* trackChi2ndof;
        TH1F* tracksPerEvent;
        TH1F* trackAngleX;
        TH1F* trackAngleY;
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
        std::map<std::string, TH1F*> residualsX_local;
        std::map<std::string, TH1F*> residualsXwidth1_local;
        std::map<std::string, TH1F*> residualsXwidth2_local;
        std::map<std::string, TH1F*> residualsXwidth3_local;
        std::map<std::string, TH1F*> pullY_local;
        std::map<std::string, TH1F*> residualsY_local;
        std::map<std::string, TH1F*> residualsYwidth1_local;
        std::map<std::string, TH1F*> residualsYwidth2_local;
        std::map<std::string, TH1F*> residualsYwidth3_local;
        std::map<std::string, TH1F*> pullX_local;

        std::map<std::string, TH1F*> residualsX_global;
        std::map<std::string, TH1F*> residualsXwidth1_global;
        std::map<std::string, TH1F*> residualsXwidth2_global;
        std::map<std::string, TH1F*> residualsXwidth3_global;
        std::map<std::string, TH1F*> pullX_global;
        std::map<std::string, TH1F*> residualsY_global;
        std::map<std::string, TH1F*> residualsYwidth1_global;
        std::map<std::string, TH1F*> residualsYwidth2_global;
        std::map<std::string, TH1F*> residualsYwidth3_global;
        std::map<std::string, TH1F*> pullY_global;
        std::map<std::string, TH1F*> residualsZ_global;
Simon Spannagel's avatar
Simon Spannagel committed
67

68
69
        std::map<std::string, TH1F*> kinkX;
        std::map<std::string, TH1F*> kinkY;
Simon Spannagel's avatar
Simon Spannagel committed
70
        // Cuts for tracking
71
72
73
74
75
76
        double momentum_;
        double volume_radiation_length_;
        size_t min_hits_on_track_;
        bool exclude_DUT_;
        bool use_volume_scatterer_;
        bool reject_by_ROI_;
77
        bool uinque_cluster_usage_;
78
        std::vector<std::string> require_detectors_;
79
        std::map<std::shared_ptr<Detector>, double> time_cuts_;
80
        std::map<std::shared_ptr<Detector>, XYVector> spatial_cuts_;
81
82
        std::string timestamp_from_;
        std::string track_model_;
83
84
85

        // Function to calculate the weighted average timestamp from the clusters of a track
        double calculate_average_timestamp(const Track* track);
Simon Spannagel's avatar
Simon Spannagel committed
86
    };
87
} // namespace corryvreckan
88
#endif // TRACKING4D_H