-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFillMaxTPCCharge.C
More file actions
58 lines (43 loc) · 1.15 KB
/
Copy pathFillMaxTPCCharge.C
File metadata and controls
58 lines (43 loc) · 1.15 KB
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
////////////////////////////////////
// Fillmaxcharge.C //
////////////////////////////////////
// This makes a histogram for each HBD channel showing:
// -Maximum TPCCharge.
// -Time slice with maximum TPCCharge.
// -Correlation between these two.
#include "FillMaxTPCCharge.h"
#include "TF1.h"
#include "TH1D.h"
#include "TH2D.h"
#include "AZig.h"
#include "cyclops.h"
#include <iostream>
#include <cmath>
TH1D *MaxMaxTPCCharge=0;
TH2D *MaxTPCChargeSet;
using namespace std;
void FillMaxTPCCharge()
{
int nTime = AZig::Cal[0].size();
double left = -0.5;
double right = (double)nTime - 0.5;
if (!MaxMaxTPCCharge)
{
MaxMaxTPCCharge = new TH1D("MaxMaxTPCCharge","MaxMaxTPCCharge",300,-300.5,3000.5);
MaxTPCChargeSet = new TH2D("MaxTPCChargeSet","MaxTPCChargeSet",480,-0.5,479.5,300,-300.5,3000.5);
}
cyclops *Scott = cyclops::instance();
double MAX=-999;
int MAXindex=-1;
for (int i=0; i<479; i++)
{
double TPCCharge = Scott->theZigs[i]->Q();
if (TPCCharge>MAX)
{
MAX=TPCCharge;
MAXindex=i;
}
MaxTPCChargeSet->Fill(i,TPCCharge);
}
MaxMaxTPCCharge->Fill(MAX);
}