Adapted to root6
This commit is contained in:
@ -5,12 +5,16 @@
|
||||
|
||||
#include <string>
|
||||
#define NSIZE 100000
|
||||
void td_mcp2_tof(char* fname)
|
||||
void td_mcp2_tof(const char* fname)
|
||||
{
|
||||
Double_t *ptofTD, *ptofMCP2, *pEventIDTD, *pEventIDMCP2;
|
||||
Double_t tofTD[NSIZE], tofMCP2[NSIZE], EventIDTD[NSIZE], EventIDMCP2[NSIZE];
|
||||
Long64_t i, j, k, nEventsTD, nEventsMCP2;
|
||||
TTree *t1;
|
||||
TH1D *htof, *tof_mcp2, *tof_td;
|
||||
|
||||
TFile* f1 = new TFile(fname);
|
||||
t1 = (TTree*) gDirectory->FindObjectAny("t1");
|
||||
|
||||
// muon time-of-flight to TD
|
||||
t1->Draw("eventID:1000*save_time","save_detID==890&&save_particleID==-13"); //0, 2
|
||||
@ -35,7 +39,7 @@ void td_mcp2_tof(char* fname)
|
||||
}
|
||||
|
||||
// TOF TD-MCP2
|
||||
TH1D *htof = new TH1D("Time-of-flight TD-MCP2", "Time-of-flight TD-MCP2", 1000, 0.25, 500.25);
|
||||
htof = new TH1D("Time-of-flight TD-MCP2", "Time-of-flight TD-MCP2", 1000, 0.25, 500.25);
|
||||
k = 0;
|
||||
for (i = 0; i<nEventsMCP2; i++){
|
||||
for (j = k; j<nEventsTD; j++){
|
||||
@ -59,6 +63,7 @@ void td_mcp2_tof(char* fname)
|
||||
// muon time-of-flight to TD
|
||||
c1->cd(1);
|
||||
t1->Draw("1000*save_time >> tof_td(2000, 0.25, 1000.25)","save_detID==890&&save_particleID==-13"); //0, 2
|
||||
tof_td = (TH1D*) gDirectory->Get("tof_td");
|
||||
tof_td->SetTitle("Time-of-flight to TD");
|
||||
tof_td->GetXaxis()->SetTitle("TD time of flight (ns)");
|
||||
// tof_td->GetXaxis()->SetNdivisions(405);
|
||||
@ -74,6 +79,7 @@ void td_mcp2_tof(char* fname)
|
||||
// muon time-of-flight to MCP2
|
||||
c1->cd(2);
|
||||
t1->Draw("1000*save_time >> tof_mcp2(2000, 0.25, 1000.25)","save_detID==902&&((save_particleID==-13)||(save_particleID==-1313))"); //0, 2
|
||||
tof_mcp2 = (TH1D*) gDirectory->Get("tof_mcp2");
|
||||
tof_mcp2->SetTitle("Time-of-flight to MCP2");
|
||||
tof_mcp2->GetXaxis()->SetTitle("MCP2 time of flight (ns)");
|
||||
// tof_mcp2->GetXaxis()->SetNdivisions(405);
|
||||
|
Reference in New Issue
Block a user