Containers.h 4.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
/** @file Containers.h
 *  @brief Class to define containers: child classes with only public data memebers
 *
 *
 *  @author Riccardo Longo
 *  @bug No known bugs.
 */

#ifndef CONTAINERS_H
#define CONTAINERS_H

#include "Containers.h"
13
#include "TH1.h"
14

15
#include <iostream>
16
#include <vector>
17
#include <utility>
18
19
20
21
22
23
24
25
26
27
28
29
30
31

class Channel {

 public :
    /** Detector associated to this channel. RPD or ZDC
    *   Mapping (sitting on the impinging beam) [R,C] for ZDC:
    *   ZDC1 -> [0,1]    |
    *   ZDC2 -> [0,2]   \ /
    *   Mapping (sitting on the impinging beam) [R,C] for RPD:
    *   Jura [1,4] [1,3] [1,2] [1,1] Saleve
    *        [2,4] [2,3] [2,2] [2,1]
    *        [3,4] [3,3] [3,2] [3,1]
    *        [4,4] [4,3] [4,2] [4,1]
    */
clantz's avatar
clantz committed
32
	/** Type of detector - ZDC or RPD **/
33
34
35
36
37
38
39
40
41
42
43
44
45
    std::string detector;
    /** Channel name - CXX with XX in [1,20]  */
    std::string name;
    /** High voltage set for this channel - in V */
    double HV;
    /** Delay set for this channel - in ns */
    double delay;
    /** Offset set for this channel */
    double offset;
    /** Mapping in the horizontal direction [R] */
    int mapping_row;
    /** Mapping in the vertical direction [C] */
    int mapping_column;
clantz's avatar
clantz committed
46
47
    /** Was the channel functioning */
    bool is_on;
48
    /** Operating voltage of the channel*/
clantz's avatar
clantz committed
49
    int Vop;
50
51
    /** PMT reference code **/
    std::string PMTcode;
52
    /** Raw waveform for a particular event */
53
    std::vector < float > WF;
54
55
    /** Pointer to the WF vector */
    std::vector < float > *pWF = &WF;
56
57
    /** Pointer to the DRS4 time vector */
    std::vector < float > *pTimeVec = 0;
58
    /** Histrogram for visualization and analysis of the waveform */
59
    TH1D* WF_histo;
60
61
    /** Histogram of the processed waveform */
    TH1D* PWF_histo;
62
63
64
65
    /** Histogram with first derivative **/
    TH1D* FirstDerivative;
    /** RMS value of the first derrivative of the waveform **/
    double FirstDerivativeRMS;
66
67
    /** Bin number of the peak center*/
    int Peak_center;
clantz's avatar
clantz committed
68
69
    /** Bin number of the derivative peak */
    int Diff_Peak_center;
70
71
72
73
    /** Calibrated time of the peak center in ns*/
    double Peak_time;
    /** Calibrated time of max slope in ns*/
    double Diff_Peak_time;
74
75
76
77
78
79
80
81
    /** Height of the peak */
    double Peak_max;
    /** Max value of the derivative */
    double Diff_max;
    /** Bin number of 1/3 peak value on the rising edge*/
    int DiscriminatorTime;
    /** Start and end of the hit window*/
    std::pair< int, int > hit_window;
82
83
    /** Flag if the channel was hit */
    bool was_hit;
84
85
    /** Flag if the waveform saturated */
    bool saturated;
86
87
88
89
    /** Pedestal of raw waveform */
    double PedMean;
    /** Pedestal RMS of raw waveform */
    double PedRMS;
90
    /** Integral of PWF_histo in the hit window in pC */
91
    double Charge;
92
93
    /** Crossing zero points - dummy - to be checked by Sheng **/
    std::vector < int > CrossZeroPoints;
94
95
96

};

Riccardo Longo's avatar
Riccardo Longo committed
97
98
99
100
class Alignment {

 public:

101
102
    /** Run number being analyzed **/
    int runNumber;
Riccardo Longo's avatar
Riccardo Longo committed
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
    /** X position of the Desy Table **/
    double x_table;
    /** Y position of the Desy Table **/
    double y_table;
    /** First detector met by the beam **/
    std::string upstream_Det;
    /** Second detector met by the beam **/
    std::string mid_Det;
    /** Third detector met by the beam **/
    std::string downstream_Det;
    /** GOLIATH magnet status **/
    bool magnet_On;
    /** Target in **/
    bool target_In;
    /** Lead absorber in **/
    bool lead_In;

};

122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
class Alignment2021 {

 public:

    /** Run number being analyzed **/
    int runNumber;
    /** Beam type - can be p or e in H2 2021 **/
    std::string beam_type;
    /** Beam energy **/
    double beam_energy;
    /** X position of the NIKHEF Table **/
    double x_det_table;
    /** Y position of the NIKHEF Table **/
    double y_det_table;
    /** X position of the Trigger Table **/
    double x_trig_table;
    /** Y position of the Trigger Table **/
    double y_trig_table;
    /** First detector met by the beam **/
    std::string Det1;
    /** Second detector met by the beam **/
    std::string Det2;
    /** Third detector met by the beam **/
    std::string Det3;
    /** Fourth detector met by the beam **/
    std::string Det4;
    /** Fifth detector met by the beam **/
    std::string Det5;
    /** Sixth detector met by the beam **/
    std::string Det6;
    /** GOLIATH magnet status **/
};

155

156
#endif