-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathno_spikes_diagnostic.cxx
More file actions
52 lines (37 loc) · 1022 Bytes
/
no_spikes_diagnostic.cxx
File metadata and controls
52 lines (37 loc) · 1022 Bytes
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
/*
2012-12-04 Shane Caldwell
Trying to find the problem with the no_spikes code.
*/
#include <unistd.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <fstream>
//#include "stat.h"
#include "stdio.h"
#include "TH1.h"
#include "TH2.h"
#include "TFile.h"
#include "TTree.h"
#include "TLeaf.h"
#include "TMath.h"
#include "TPaveLabel.h"
#include "TCanvas.h"
#include "TLegend.h"
void no_spikes_diagnostic (const char*);
int main (int argc, char *argv[]) {
while (*++argv) no_spikes_diagnostic(argv[0]);
return 0;
}
void no_spikes_diagnostic (const char *filename) {
FILE *outfile;
outfile = fopen("sb135_no_spike_diagnostic.txt","a");
TFile *f = new TFile(filename);
TH1I *h = (TH1I*)gDirectory->Get("h_tof");;
Int_t integral = h->Integral();
f->cd("no_spikes");
TH1I *h_no_spikes = (TH1I*)gDirectory->Get("h_tof_no_spikes");
Int_t integral_no_spikes = h_no_spikes->Integral();
fprintf(outfile, "%s\t%8d\n", filename, integral - integral_no_spikes);
fclose(outfile);
}