-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutilities.h
69 lines (56 loc) · 2.56 KB
/
utilities.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
#ifndef UTILITIES_H
#define UTILITIES_H
#include "TTree.h"
#include "TBranch.h"
#include "TFile.h"
#include "TSystem.h"
#include "Riostream.h"
#include "TString.h"
#include "TCanvas.h"
#include "TGraph.h"
#include "TAxis.h"
#include "TGaxis.h"
#include "TMath.h"
#include "TH1F.h"
#include "TLine.h"
#include "TMultiGraph.h"
#include "TMarker.h"
#include "TPaveText.h"
#include <stdlib.h>
#include <fstream>
#include <numeric>
#include <vector>
#include <array>
#include <algorithm>
#include <string>
#include <tuple>
using namespace std;
struct chamber { //CMS digitizer - 5 Gs/s
std::string name = "ALICE-2-0";
int stripNum = 16, numSamp = 1024, resolution = 12, offsetBits = 16, stripArea = 150; //resolution and offsetBits are in bits
int offset = 0x7fff; //DC offeset in DAC (to be converted in mV)
int strips[8] = {1,2,3,4,5,6,7,8};
float sampFreq = 5, vpp = 1000.0; //Gs/s, mV
};
struct chamber1G { //CMS digitizer - 1 Gs/s
std::string name = "ALICE-2-0";
int stripNum = 16, numSamp = 1024, resolution = 12, offsetBits = 16, stripArea = 150; //resolution and offsetBits are in bits
int offset = 0x7fff; //DC offeset in DAC (to be converted in mV)
int strips[8] = {1,2,3,4,5,6,7,8};
float sampFreq = 1., vpp = 1000.0; //Gs/s, mV
};
struct chamberEPDT { //EPDT digitizer
std::string name = "ALICE-2-0";
int stripNum, numSamp;
int strips[7] = {1,2,3,4,5,6,7};
float sampFreq = 2.5; //Gs/s
};
void treeProducer(int numFiles, string folderPath, string trigFile, string waveFile, int hv, bool verbose);
int hvCounter(string folderPath, string ext, bool verbose);
//vector <double> hvReader(string scanPath, int scan, int numfiles, bool verbose);
tuple<vector <double>,vector <double>,vector <double>,vector <double>,vector <double>,vector <double>> hvReader(string scanPath, int scan, int numfiles, bool verbose);
//double analyzer(int numFiles, string folderPath, int hv, bool verbose, struct chamber1G, int muonMin, int muonMax, int noiseMin, int noiseMax); //1 Gs/s
//double analyzer(vector<float> times, int numFiles, string folderPath, int hv, bool verbose, struct chamber1G, int muonMin, int muonMax, int noiseMin, int noiseMax); //1 Gs/s
tuple<double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double> analyzer(vector<float> times, int numFiles, string folderPath, int hv, bool verbose, struct chamber1G, int muonMin, int muonMax, int noiseMin, int noiseMax); //1 Gs/s
//double analyzer(int numFiles, string folderPath, int hv, bool verbose, struct chamber, int muonMin, int muonMax, int noiseMin, int noiseMax); //5 Gs/s
#endif