14 void Ana( TNtuple*, TNtuple*, TNtuple*,
char[2],
int,
double tot[24],
double dead[24],
int );
22 cout <<
"Input run number: ";
27 const char* run_str[24] = {
"00",
"01",
"02",
"03" ,
"04",
"05",
"06",
"07",
"08",
"09",
"10" ,
"11",
"12" ,
"13" ,
"14",
"15" ,
"16" ,
"17",
"18" ,
"19",
"20",
"21" ,
"22",
"23" };
29 double dead[24] = {0};
31 double tot_ult[24]={0};
32 double dead_ult[24]={0};
34 sprintf(name,
"pedestal-%d-outfile.root", run_num);
37 TFile h_outfile10305(name,
"RECREATE");
38 TNtuple *h_Alive=
new TNtuple(
"h_Alive",
"Location Tntuple Cuts",
"chan_id:fee_id:module_id:pedMean:pedStdi:sec_id");
39 TNtuple *h_AliveTot=
new TNtuple(
"h_AliveTot",
"Location Tntuple No Cuts",
"chan_id:fee_id:module_id:pedMean:pedStdi:sec_id");
40 TNtuple *h_AliveNoise=
new TNtuple(
"h_AliveNoise",
"Location Tntuple Cuts",
"chan_id:fee_id:module_id:pedMean:pedStdi:sec_id:noise");
42 for(
int i = 0;
i < 24;
i++ )
45 std::sprintf(run,run_str[
i]);
47 Ana( h_Alive, h_AliveTot,h_AliveNoise, run, run_num, tot, dead, i);
50 dead_ult[
i] += dead[
i];
56 h_outfile10305.Close();
62 void Ana(TNtuple *Alive, TNtuple *AliveTot, TNtuple *AliveNoise,
char run[2] =
"11",
int runNumber = 00000,
double tot[24]={0},
double dead[24]={0},
int j = 0)
66 const TString filename2( Form(
"/sphenix/u/llegnosky/Livechan_Pedestals_Noise/run_%d/outputfile_TPC_ebdc%s_pedestal-000%d.root", runNumber,
run,runNumber) );
68 TFile* infile2 = TFile::Open(filename2);
73 treesd = (TTree*) infile2->Get(
"outputTree");
75 Int_t isAlive, chan, fee, module, slot;
76 Float_t pedMean, pedStdi;
78 treesd->SetBranchAddress(
"isAlive",&isAlive);
79 treesd->SetBranchAddress(
"chan",&chan);
80 treesd->SetBranchAddress(
"fee",&fee);
81 treesd->SetBranchAddress(
"module",&module);
82 treesd->SetBranchAddress(
"slot", &slot);
83 treesd->SetBranchAddress(
"pedMean",&pedMean);
84 treesd->SetBranchAddress(
"pedStdi",&pedStdi);
86 std::cout <<
"sector = "<<
run <<std::endl;
88 UInt_t nEntries = treesd->GetEntries();
90 float sec = std::stof(
fs);
92 std::cout <<
"sector from char = " << sec << std::endl;
95 for (
int i=0;
i<nEntries;
i++){
99 double noise = pedStdi;
101 AliveTot->Fill(1.0*chan,1.0*fee,1.0*module,pedMean,pedStdi,1.0*sec);
104 Alive->Fill(1.0*chan,1.0*fee,1.0*module,pedMean, pedStdi, 1.0*sec);