3 #include <calobase/RawTowerContainer.h>
5 #include <pdbcalbase/PdbParameterMap.h>
6 #include <phparameter/PHParameters.h>
7 #include <prototype4/RawTower_Prototype4.h>
8 #include <prototype4/RawTower_Temperature.h>
10 #include <Event/EventTypes.h>
28 #include <TLorentzVector.h>
80 <<
"Proto4ShowerCalib::get_HistoManager - Making Fun4AllHistoManager Proto4ShowerCalib_HISTOS"
94 cout <<
"Proto4ShowerCalib::InitRun" << endl;
100 "PHCompositeNode",
"DST"));
103 std::cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
105 "Failed to find DST node in EmcRawTowerBuilder::CreateNodes");
113 cout <<
"Proto4ShowerCalib::End - write to " <<
_filename << endl;
118 for (
unsigned int i = 0;
i < hm->
nHistos();
i++)
131 cout <<
"Proto4ShowerCalib::get_HistoManager - Making PHTFileServer "
139 TH2F *hCheck_Cherenkov =
new TH2F(
"hCheck_Cherenkov",
"hCheck_Cherenkov",
140 110, -200, 20000, 5, .5, 5.5);
141 hCheck_Cherenkov->GetYaxis()->SetBinLabel(1,
"C1");
142 hCheck_Cherenkov->GetYaxis()->SetBinLabel(2,
"C2 in");
143 hCheck_Cherenkov->GetYaxis()->SetBinLabel(3,
"C2 out");
144 hCheck_Cherenkov->GetYaxis()->SetBinLabel(4,
"C2 sum");
145 hCheck_Cherenkov->GetXaxis()->SetTitle(
"Amplitude");
146 hCheck_Cherenkov->GetYaxis()->SetTitle(
"Cherenkov Channel");
150 TH1F *
hNormalization =
new TH1F(
"hNormalization",
"hNormalization", 10, .5,
152 hNormalization->GetXaxis()->SetBinLabel(1,
"ALL");
153 hNormalization->GetXaxis()->SetBinLabel(2,
"C2-e");
154 hNormalization->GetXaxis()->SetBinLabel(3,
"trigger_veto_pass");
155 hNormalization->GetXaxis()->SetBinLabel(4,
"valid_hodo_h");
156 hNormalization->GetXaxis()->SetBinLabel(5,
"valid_hodo_v");
157 hNormalization->GetXaxis()->SetBinLabel(6,
"good_e");
158 hNormalization->GetXaxis()->SetBinLabel(7,
"good_anti_e");
159 hNormalization->GetXaxis()->SetTitle(
"Cuts");
160 hNormalization->GetYaxis()->SetTitle(
"Event count");
163 hm->
registerHisto(
new TH1F(
"hCheck_Veto",
"hCheck_Veto", 1000, -500, 1500));
165 new TH1F(
"hCheck_Hodo_H",
"hCheck_Hodo_H", 1000, -500, 1500));
167 new TH1F(
"hCheck_Hodo_V",
"hCheck_Hodo_V", 1000, -500, 1500));
169 hm->
registerHisto(
new TH1F(
"hBeam_Mom",
"hBeam_Mom", 1200, -120, 120));
178 TH1F *h_hcalin_tower_sim[16];
179 TH1F *h_hcalout_tower_sim[16];
180 for(
int i_tower = 0; i_tower < 16; ++i_tower)
183 HistName_sim = Form(
"h_hcalin_tower_%d_sim",i_tower);
185 h_hcalin_tower_sim[i_tower] =
new TH1F(HistName_sim.c_str(),HistName_sim.c_str(),100,-0.5,histo_range);
188 HistName_sim = Form(
"h_hcalout_tower_%d_sim",i_tower);
190 h_hcalout_tower_sim[i_tower] =
new TH1F(HistName_sim.c_str(),HistName_sim.c_str(),100,-0.5,histo_range);
194 TH2F *h_tower_energy_sim =
new TH2F(
"h_tower_energy_sim",
"h_tower_energy_sim",100,-1.0,1.0,100,-0.5,histo_range);
199 TH1F *h_hcalin_lg_tower_raw[16];
200 TH1F *h_hcalin_lg_tower_calib[16];
201 for(
int i_tower = 0; i_tower < 16; ++i_tower)
203 string HistName_raw = Form(
"h_hcalin_lg_tower_%d_raw",i_tower);
204 h_hcalin_lg_tower_raw[i_tower] =
new TH1F(HistName_raw.c_str(),HistName_raw.c_str(),100,-0.5,histo_range*20.0);
207 string HistName_calib = Form(
"h_hcalin_lg_tower_%d_calib",i_tower);
208 h_hcalin_lg_tower_calib[i_tower] =
new TH1F(HistName_calib.c_str(),HistName_calib.c_str(),100,-0.5,histo_range);
213 TH1F *h_hcalout_lg_tower_raw[16];
214 TH1F *h_hcalout_lg_tower_calib[16];
215 for(
int i_tower = 0; i_tower < 16; ++i_tower)
217 string HistName_raw = Form(
"h_hcalout_lg_tower_%d_raw",i_tower);
218 h_hcalout_lg_tower_raw[i_tower] =
new TH1F(HistName_raw.c_str(),HistName_raw.c_str(),100,-0.5,histo_range*20.0);
221 string HistName_calib = Form(
"h_hcalout_lg_tower_%d_calib",i_tower);
222 h_hcalout_lg_tower_calib[i_tower] =
new TH1F(HistName_calib.c_str(),HistName_calib.c_str(),100,-0.5,histo_range);
226 TH2F *h_tower_energy_raw =
new TH2F(
"h_tower_energy_raw",
"h_tower_energy_raw",110,-1.1,1.1,100,-0.5,histo_range*640.0);
229 TH2F *h_tower_energy_calib =
new TH2F(
"h_tower_energy_calib",
"h_tower_energy_calib",110,-1.1,1.1,100,-0.5,histo_range);
233 TH1F *h_hcalout_hg_tower_raw[16];
234 TH1F *h_hcalout_hg_tower_calib[16];
235 for(
int i_tower = 0; i_tower < 16; ++i_tower)
237 string HistName_raw = Form(
"h_hcalout_hg_tower_%d_raw",i_tower);
238 h_hcalout_hg_tower_raw[i_tower] =
new TH1F(HistName_raw.c_str(),HistName_raw.c_str(),100,-0.5,histo_range*20.0);
241 string HistName_calib = Form(
"h_hcalout_hg_tower_%d_calib",i_tower);
242 h_hcalout_hg_tower_calib[i_tower] =
new TH1F(HistName_calib.c_str(),HistName_calib.c_str(),100,-0.5,histo_range);
248 TTree *
T =
new TTree(
"HCAL_Info",
"HCAL_Info");
253 T->Branch(
"tower", &
_tower);
261 cout <<
"Proto4ShowerCalib::process_event() entered" << endl;
278 run_info_copy.FillFrom(info);
282 TH1F *hBeam_Mom =
dynamic_cast<TH1F *
>(hm->
getHisto(
"hBeam_Mom"));
293 EventHeader *eventheader = findNode::getClass<EventHeader>(topNode,
298 cout << __PRETTY_FUNCTION__
299 <<
" disgard this event: " << endl;
338 TH1F *hNormalization =
dynamic_cast<TH1F *
>(hm->
getHisto(
"hNormalization"));
341 hNormalization->Fill(
"ALL", 1);
357 assert(TOWER_SIM_HCALOUT);
363 assert(TOWER_RAW_LG_HCALIN);
367 assert(TOWER_RAW_LG_HCALOUT);
371 assert(TOWER_RAW_HG_HCALOUT);
375 assert(TOWER_CALIB_LG_HCALIN);
379 assert(TOWER_CALIB_LG_HCALOUT);
383 assert(TOWER_CALIB_HG_HCALOUT);
390 assert(TOWER_CALIB_TRIGGER_VETO);
397 assert(TOWER_CALIB_HODO_HORIZONTAL);
403 assert(TOWER_CALIB_HODO_VERTICAL);
407 topNode,
"TOWER_CALIB_C1");
413 topNode,
"TOWER_CALIB_C2");
420 bool cherekov_e =
false;
421 bool cherekov_anti_e =
false;
427 t_c2_in = TOWER_CALIB_C2->
getTower(0);
428 t_c2_out = TOWER_CALIB_C2->
getTower(1);
442 hNormalization->Fill(
"C2-e", cherekov_e);
444 TH2F *hCheck_Cherenkov =
dynamic_cast<TH2F *
>(hm->
getHisto(
445 "hCheck_Cherenkov"));
447 hCheck_Cherenkov->Fill(c1,
"C1", 1);
448 hCheck_Cherenkov->Fill(c2_in,
"C2 in", 1);
449 hCheck_Cherenkov->Fill(c2_out,
"C2 out", 1);
450 hCheck_Cherenkov->Fill(c2_in + c2_out,
"C2 sum", 1);
454 TH1F *hCheck_Veto =
dynamic_cast<TH1F *
>(hm->
getHisto(
"hCheck_Veto"));
456 bool trigger_veto_pass =
true;
459 auto range = TOWER_CALIB_TRIGGER_VETO->
getTowers();
460 for (
auto it = range.first;
it != range.second; ++
it)
468 trigger_veto_pass =
false;
471 hNormalization->Fill(
"trigger_veto_pass", trigger_veto_pass);
475 TH1F *hCheck_Hodo_H =
dynamic_cast<TH1F *
>(hm->
getHisto(
"hCheck_Hodo_H"));
477 int hodo_h_count = 0;
480 auto range = TOWER_CALIB_HODO_HORIZONTAL->
getTowers();
481 for (
auto it = range.first;
it != range.second; ++
it)
495 const bool valid_hodo_h = hodo_h_count == 1;
496 hNormalization->Fill(
"valid_hodo_h", valid_hodo_h);
499 TH1F *hCheck_Hodo_V =
dynamic_cast<TH1F *
>(hm->
getHisto(
"hCheck_Hodo_V"));
501 int hodo_v_count = 0;
504 auto range = TOWER_CALIB_HODO_VERTICAL->
getTowers();
505 for (
auto it = range.first;
it != range.second; ++
it)
519 const bool valid_hodo_v = hodo_v_count == 1;
521 hNormalization->Fill(
"valid_hodo_v", valid_hodo_v);
523 const bool good_e = (valid_hodo_v and valid_hodo_h and cherekov_e and trigger_veto_pass) and (not _is_sim);
524 const bool good_anti_e = (valid_hodo_v and valid_hodo_h and cherekov_anti_e and trigger_veto_pass) and (not _is_sim);
525 hNormalization->Fill(
"good_e", good_e);
526 hNormalization->Fill(
"good_anti_e", good_anti_e);
534 double hcalin_sum_e_sim = 0;
535 double hcalout_sum_e_sim = 0;
537 auto range_hcalin_sim = TOWER_SIM_HCALIN->
getTowers();
538 for (
auto it = range_hcalin_sim.first;
it != range_hcalin_sim.second; ++
it)
549 if (col < 0 or col >= 4)
551 if (row < 0 or row >= 4)
555 hcalin_sum_e_sim += energy_sim;
558 string HistName_sim = Form(
"h_hcalin_tower_%d_sim",chanNum);
559 TH1F *h_hcalin_sim =
dynamic_cast<TH1F *
>(hm->
getHisto(HistName_sim.c_str()));
565 auto range_hcalout_sim = TOWER_SIM_HCALOUT->
getTowers();
566 for (
auto it = range_hcalout_sim.first;
it != range_hcalout_sim.second; ++
it)
577 if (col < 0 or col >= 4)
579 if (row < 0 or row >= 4)
583 hcalout_sum_e_sim += energy_sim;
586 string HistName_sim = Form(
"h_hcalout_tower_%d_sim",chanNum);
587 TH1F *h_hcalout_sim =
dynamic_cast<TH1F *
>(hm->
getHisto(HistName_sim.c_str()));
594 _tower.
hcal_asym_sim = (hcalin_sum_e_sim - hcalout_sum_e_sim)/(hcalin_sum_e_sim + hcalout_sum_e_sim);
596 TH2F *h_tower_energy_sim =
dynamic_cast<TH2F *
>(hm->
getHisto(
"h_tower_energy_sim"));
597 assert(h_tower_energy_sim);
602 double hcalin_sum_lg_e_raw = 0;
603 double hcalin_sum_lg_e_calib = 0;
605 auto range_hcalin_lg_raw = TOWER_RAW_LG_HCALIN->
getTowers();
606 for (
auto it = range_hcalin_lg_raw.first;
it != range_hcalin_lg_raw.second; ++
it)
617 if (col < 0 or col >= 4)
619 if (row < 0 or row >= 4)
623 const double energy_raw = tower->
get_energy();
624 hcalin_sum_lg_e_raw += energy_raw;
627 string HistName_raw = Form(
"h_hcalin_lg_tower_%d_raw",chanNum);
628 TH1F *h_hcalin_lg_raw =
dynamic_cast<TH1F *
>(hm->
getHisto(HistName_raw.c_str()));
634 auto range_hcalin_lg_calib = TOWER_CALIB_LG_HCALIN->
getTowers();
635 for (
auto it = range_hcalin_lg_calib.first;
it != range_hcalin_lg_calib.second; ++
it)
644 if (col < 0 or col >= 4)
646 if (row < 0 or row >= 4)
649 const double energy_calib = tower->
get_energy();
650 hcalin_sum_lg_e_calib += energy_calib;
653 string HistName_calib = Form(
"h_hcalin_lg_tower_%d_calib",chanNum);
654 TH1F *h_hcalin_lg_calib =
dynamic_cast<TH1F *
>(hm->
getHisto(HistName_calib.c_str()));
655 assert(h_hcalin_lg_calib);
662 double hcalout_sum_lg_e_raw = 0;
663 double hcalout_sum_lg_e_calib = 0;
665 auto range_hcalout_lg_raw = TOWER_RAW_LG_HCALOUT->
getTowers();
666 for (
auto it = range_hcalout_lg_raw.first;
it != range_hcalout_lg_raw.second; ++
it)
677 if (col < 0 or col >= 4)
679 if (row < 0 or row >= 4)
683 const double energy_raw = tower->
get_energy();
684 hcalout_sum_lg_e_raw += energy_raw;
687 string HistName_raw = Form(
"h_hcalout_lg_tower_%d_raw",chanNum);
688 TH1F *h_hcalout_lg_raw =
dynamic_cast<TH1F *
>(hm->
getHisto(HistName_raw.c_str()));
694 auto range_hcalout_lg_calib = TOWER_CALIB_LG_HCALOUT->
getTowers();
695 for (
auto it = range_hcalout_lg_calib.first;
it != range_hcalout_lg_calib.second; ++
it)
704 if (col < 0 or col >= 4)
706 if (row < 0 or row >= 4)
709 const double energy_calib = tower->
get_energy();
710 hcalout_sum_lg_e_calib += energy_calib;
713 string HistName_calib = Form(
"h_hcalout_lg_tower_%d_calib",chanNum);
714 TH1F *h_hcalout_lg_calib =
dynamic_cast<TH1F *
>(hm->
getHisto(HistName_calib.c_str()));
715 assert(h_hcalout_lg_calib);
722 _tower.
hcal_asym_raw = (hcalin_sum_lg_e_raw - hcalout_sum_lg_e_raw)/(hcalin_sum_lg_e_raw + hcalout_sum_lg_e_raw);
723 TH2F *h_tower_energy_raw =
dynamic_cast<TH2F *
>(hm->
getHisto(
"h_tower_energy_raw"));
724 assert(h_tower_energy_raw);
728 _tower.
hcal_asym_calib = (hcalin_sum_lg_e_calib - hcalout_sum_lg_e_calib)/(hcalin_sum_lg_e_calib + hcalout_sum_lg_e_calib);
729 TH2F *h_tower_energy_calib =
dynamic_cast<TH2F *
>(hm->
getHisto(
"h_tower_energy_calib"));
730 assert(h_tower_energy_calib);
735 double hcalout_sum_hg_e_raw = 0;
736 double hcalout_sum_hg_e_calib = 0;
737 auto range_hcalout_hg_raw = TOWER_RAW_HG_HCALOUT->
getTowers();
738 for (
auto it = range_hcalout_hg_raw.first;
it != range_hcalout_hg_raw.second; ++
it)
747 if (col < 0 or col >= 4)
749 if (row < 0 or row >= 4)
753 const double energy_raw = tower->
get_energy();
754 hcalout_sum_hg_e_raw += energy_raw;
757 string HistName_raw = Form(
"h_hcalout_hg_tower_%d_raw",chanNum);
758 TH1F *h_hcalout_hg_raw =
dynamic_cast<TH1F *
>(hm->
getHisto(HistName_raw.c_str()));
764 auto range_hcalout_hg_calib = TOWER_CALIB_HG_HCALOUT->
getTowers();
765 for (
auto it = range_hcalout_hg_calib.first;
it != range_hcalout_hg_calib.second; ++
it)
774 if (col < 0 or col >= 4)
776 if (row < 0 or row >= 4)
779 const double energy_calib = tower->
get_energy();
780 hcalout_sum_hg_e_calib += energy_calib;
783 string HistName_calib = Form(
"h_hcalout_hg_tower_%d_calib",chanNum);
784 TH1F *h_hcalout_hg_calib =
dynamic_cast<TH1F *
>(hm->
getHisto(HistName_calib.c_str()));
785 assert(h_hcalout_hg_calib);
797 TTree *T =
dynamic_cast<TTree *
>(hm->
getHisto(
"HCAL_Info"));
807 const int clus_edge_size = (cluster_size - 1) / 2;
808 assert(clus_edge_size >= 0);
810 pair<int, int> max(-1000, -1000);
814 for (
int row = 0; row <
n_size; ++row)
818 for (
int dcol = col - clus_edge_size; dcol <= col + clus_edge_size;
820 for (
int drow = row - clus_edge_size; drow <= row + clus_edge_size;
823 if (dcol < 0 or drow < 0)
833 max = make_pair(col, row);
843 if(_is_sim)
_mList =
"SIM";
844 if(!_is_sim)
_mList =
"RAW";
845 string inputdir =
"/sphenix/user/xusun/TestBeam/ShowerCalib/";
846 string InPutList = Form(
"/direct/phenix+u/xusun/WorkSpace/sPHENIX/analysis/Prototype4/HCal/macros/list/ShowerCalib/Proto4TowerInfo%s_%s.list",
_mList.c_str(),
_mRunID.c_str());
850 if (!InPutList.empty())
852 cout <<
"Open input database file list: " << InPutList.c_str() << endl;
853 ifstream
in(InPutList.c_str());
856 cout <<
"input database file list is ok" << endl;
858 Long64_t entries_save = 0;
866 addfile = inputdir+addfile;
867 mChainInPut->AddFile(addfile.c_str(),-1,
"HCAL_Info");
868 long file_entries = mChainInPut->GetEntries();
869 cout <<
"File added to data chain: " << addfile.c_str() <<
" with " << (file_entries-entries_save) <<
" entries" << endl;
870 entries_save = file_entries;
876 cout <<
"WARNING: input database file input is problemtic" << endl;
882 if (
_mInPut_flag == 1 && !mChainInPut->GetBranch(
"info" ))
884 cerr <<
"ERROR: Could not find branch 'info' in tree!" << endl;
891 mChainInPut->SetBranchAddress(
"info", &
_mInfo);
892 mChainInPut->SetBranchAddress(
"tower", &
_mTower);
894 long NumOfEvents = (long)mChainInPut->GetEntries();
895 cout <<
"total number of events: " << NumOfEvents << endl;
910 h_mAsymmEnergy_pion_sim =
new TH2F(
"h_mAsymmEnergy_pion_sim",
"h_mAsymmEnergy_pion_sim",100,-1.0,1.0,100,-0.5,histo_range);
914 h_mAsymmAdc_mixed =
new TH2F(
"h_mAsymmAdc_mixed",
"h_mAsymmAdc_mixed",110,-1.1,1.1,100,-0.5,histo_range*640.0);
915 h_mAsymmAdc_electron =
new TH2F(
"h_mAsymmAdc_electron",
"h_mAsymmAdc_electron",110,-1.1,1.1,100,-0.5,histo_range*640.0);
916 h_mAsymmAdc_pion =
new TH2F(
"h_mAsymmAdc_pion",
"h_mAsymmAdc_pion",110,-1.1,1.1,100,-0.5,histo_range*640.0);
918 h_mAsymmEnergy_mixed_wo_cut =
new TH2F(
"h_mAsymmEnergy_mixed_wo_cut",
"h_mAsymmEnergy_mixed_wo_cut",110,-1.1,1.1,100,-0.5,0.5*histo_range);
919 h_mAsymmEnergy_electron_wo_cut =
new TH2F(
"h_mAsymmEnergy_electron_wo_cut",
"h_mAsymmEnergy_electron_wo_cut",110,-1.1,1.1,100,-0.5,0.5*histo_range);
920 h_mAsymmEnergy_pion_wo_cut =
new TH2F(
"h_mAsymmEnergy_pion_wo_cut",
"h_mAsymmEnergy_pion_wo_cut",110,-1.1,1.1,100,-0.5,0.5*histo_range);
922 h_mAsymmEnergy_mixed =
new TH2F(
"h_mAsymmEnergy_mixed",
"h_mAsymmEnergy_mixed",110,-1.1,1.1,100,-0.5,0.5*histo_range);
923 h_mAsymmEnergy_electron =
new TH2F(
"h_mAsymmEnergy_electron",
"h_mAsymmEnergy_electron",110,-1.1,1.1,100,-0.5,0.5*histo_range);
924 h_mAsymmEnergy_pion =
new TH2F(
"h_mAsymmEnergy_pion",
"h_mAsymmEnergy_pion",110,-1.1,1.1,100,-0.5,0.5*histo_range);
926 h_mAsymmEnergy_mixed_balancing =
new TH2F(
"h_mAsymmEnergy_mixed_balancing",
"h_mAsymmEnergy_mixed_balancing",110,-1.1,1.1,100,-0.5,0.5*histo_range);
928 h_mAsymmEnergy_pion_balancing =
new TH2F(
"h_mAsymmEnergy_pion_balancing",
"h_mAsymmEnergy_pion_balancing",110,-1.1,1.1,100,-0.5,0.5*histo_range);
930 h_mAsymmEnergy_mixed_leveling =
new TH2F(
"h_mAsymmEnergy_mixed_leveling",
"h_mAsymmEnergy_mixed_leveling",110,-1.1,1.1,100,-0.5,0.5*histo_range);
932 h_mAsymmEnergy_pion_leveling =
new TH2F(
"h_mAsymmEnergy_pion_leveling",
"h_mAsymmEnergy_pion_leveling",110,-1.1,1.1,100,-0.5,0.5*histo_range);
936 h_mAsymmEnergy_pion_ShowerCalib =
new TH2F(
"h_mAsymmEnergy_pion_ShowerCalib",
"h_mAsymmEnergy_pion_ShowerCalib",110,-1.1,1.1,100,-0.5,histo_range+15.0);
939 h_mAsymmEnergy_mixed_MIP =
new TH2F(
"h_mAsymmEnergy_mixed_MIP",
"h_mAsymmEnergy_mixed_MIP",110,-1.1,1.1,100,-0.5,0.5*histo_range);
940 h_mEnergyOut_electron =
new TH1F(
"h_mEnergyOut_electron",
"h_mEnergyOut_electron",100,-0.5,0.5*histo_range);
941 h_mEnergyOut_pion =
new TH1F(
"h_mEnergyOut_pion",
"h_mEnergyOut_pion",100,-0.5,0.5*histo_range);
952 cout <<
"Make()" << endl;
955 const float c_in[5] = {0.905856, 0.943406, 0.964591, 1.0, 0.962649};
956 const float c_out[5] = {1.115980, 1.063820, 1.038110, 1.0, 1.040370};
960 const float c_in_leveling = c_in[mEnergyBin];
961 const float c_out_leveling = c_out[mEnergyBin];
971 for(
unsigned long i_event = start_event_use; i_event < stop_event_use; ++i_event)
977 if (i_event != 0 && i_event % 1000 == 0)
978 cout <<
"." <<
flush;
979 if (i_event != 0 && i_event % 10000 == 0)
981 if((stop_event_use-start_event_use) > 0)
983 double event_percent = 100.0*((
double)(i_event-start_event_use))/((
double)(stop_event_use-start_event_use));
984 cout <<
" " << i_event-start_event_use <<
" (" << event_percent <<
"%) " <<
"\n" <<
"==> Processing data (ShowerCalib) " <<
flush;
997 if(energy_hcalin_sim > 0.2 && energy_hcalout_sim > 0/2)
1024 if(energy_hcalin_calib > 0.001 && energy_hcalout_calib > 0.001)
1032 if(energy_hcalin_calib <= MIP_cut && energy_hcalout_calib > 0.001 && energy_calib > MIP_cut)
1043 if(energy_hcalin_calib > 0.001 && energy_hcalout_calib > 0.001 && energy_calib > MIP_energy_cut)
1050 const float energy_leveling = c_in_leveling*energy_hcalin_calib + c_out_leveling*energy_hcalout_calib;
1051 const float asymm_leveling = (c_in_leveling*energy_hcalin_calib - c_out_leveling*energy_hcalout_calib)/energy_leveling;
1057 const float energy_showercalib =
showercalib*c_in_leveling*energy_hcalin_calib +
showercalib*c_out_leveling*energy_hcalout_calib;
1058 const float asymm_showercalib = (
showercalib*c_in_leveling*energy_hcalin_calib -
showercalib*c_out_leveling*energy_hcalout_calib)/energy_showercalib;
1068 cout <<
"." <<
flush;
1069 cout <<
" " << stop_event_use-start_event_use <<
"(" << 100 <<
"%)";
1077 cout <<
"Finish()" << endl;
1129 int hbdchanIHC[4][4] = {{4, 8, 12, 16},
1134 return hbdchanIHC[row][column] - 1;
1139 int hbdchanIHC[4][4] = {{13, 9, 5, 1},
1144 return hbdchanIHC[row][column] - 1;
1152 const double energy_in[16] = {0.00763174, 0.00692298, 0.00637355, 0.0059323, 0.00762296, 0.00691832, 0.00636611, 0.0059203, 0.00762873, 0.00693594, 0.00637791, 0.00592433, 0.00762898, 0.00691679, 0.00636373, 0.00592433};
1153 const double adc_in[16] = {2972.61, 2856.43, 2658.19, 2376.10, 3283.39, 2632.81, 2775.77, 2491.68, 2994.11, 3385.70, 3258.01, 2638.31, 3479.97, 3081.41, 2768.36, 2626.77};
1154 const double gain_factor_in = 32.0;
1156 const double energy_out[16] = {0.00668176, 0.00678014, 0.00687082, 0.00706854, 0.00668973, 0.00678279, 0.00684794, 0.00705448, 0.00668976, 0.0068013, 0.00685931, 0.00704985, 0.0066926, 0.00678282, 0.00684403, 0.00704143};
1158 const double adc_out[16] = {276.9, 290.0, 280.7, 272.1, 309.5, 304.8, 318.5, 289.6, 289.9, 324.2, 297.9, 294.6, 292.7, 310.5, 302.3, 298.5};
1159 const double adc_amp[16] = {2.505, 5.330, 5.330, 6.965, 2.505, 5.330, 5.330, 6.965, 2.505, 5.330, 5.330, 6.965, 2.505, 5.330, 5.330, 6.965};
1160 const double gain_factor_out = 16.0;
1165 for(
int i_tower = 0; i_tower < 16; ++i_tower)
1190 std::string hcal_8GeV[3] = {
"0421",
"0422",
"1245"};
1191 std::string hcal_5GeV[3] = {
"1087",
"1089",
"1091"};
1195 for(
int i_run = 0; i_run < 2; ++i_run)
1197 if(
_mRunID.compare(hcal_120GeV[i_run]) == 0)
1203 for(
int i_run = 0; i_run < 2; ++i_run)
1205 if(
_mRunID.compare(hcal_60GeV[i_run]) == 0)
1211 for(
int i_run = 0; i_run < 2; ++i_run)
1213 if(
_mRunID.compare(hcal_12GeV[i_run]) == 0)
1219 for(
int i_run = 0; i_run < 3; ++i_run)
1221 if(
_mRunID.compare(hcal_8GeV[i_run]) == 0)
1227 for(
int i_run = 0; i_run < 3; ++i_run)
1229 if(
_mRunID.compare(hcal_5GeV[i_run]) == 0)
1246 std::string hcal_8GeV[3] = {
"0421",
"0422",
"1245"};
1247 std::string hcal_5GeV[3] = {
"1087",
"1089",
"1091"};
1251 for(
int i_run = 0; i_run < 2; ++i_run)
1253 if(
_mRunID.compare(hcal_120GeV[i_run]) == 0)
1259 for(
int i_run = 0; i_run < 2; ++i_run)
1261 if(
_mRunID.compare(hcal_60GeV[i_run]) == 0)
1267 for(
int i_run = 0; i_run < 2; ++i_run)
1269 if(
_mRunID.compare(hcal_12GeV[i_run]) == 0)
1275 for(
int i_run = 0; i_run < 3; ++i_run)
1277 if(
_mRunID.compare(hcal_8GeV[i_run]) == 0)
1283 for(
int i_run = 0; i_run < 3; ++i_run)
1285 if(
_mRunID.compare(hcal_5GeV[i_run]) == 0)