13 #include <g4hough/SvtxVertexMap.h>
14 #include <calobase/RawTowerContainer.h>
15 #include <calobase/RawTowerGeomContainer.h>
16 #include <calobase/RawTower.h>
17 #include <calobase/RawClusterContainer.h>
18 #include <calobase/RawCluster.h>
29 #include <TLorentzVector.h>
44 TFile *
f_TB=
new TFile(
"output_test.root",
"RECREATE");
48 SubsysReco(
"EMCalCalib_TestBeam"), _T_EMCalTrk(NULL), _filename(filename), _ievent(0)
56 test1=
new TTree(
"test1",
"trial file");
217 "PHCompositeNode",
"DST"));
223 std::cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
227 "Failed to find DST node in EmcRawTowerBuilder::CreateNodes");
243 cout <<
"EMCalCalib::End - write to " <<
_filename << endl;
257 TTree * T_Index =
new TTree(
"T_Index",
"T_Index");
349 cout <<
"EMCalCalib_TestBeam::get_HistoManager - Making PHTFileServer " <<
_filename
358 cout <<
"EMCalCalib_TestBeam::Init - Process tower occupancies" << endl;
381 cout <<
"EMCalCalib_TestBeam::process_event() entered" << endl;
414 <<
"EMCalCalib::get_HistoManager - Making Fun4AllHistoManager EMCalAna_HISTOS"
457 const string chrenkov1(
"C1");
458 const string chrenkov2(
"C2");
459 const string HODO_V(
"HODO_VERTICAL");
460 const string HODO_H(
"HODO_HORIZONTAL");
461 const string VETO(
"TRIGGER_VETO");
463 cout <<
"EMCalCalib::process_event_Tower() entered !!" << endl;
465 string towernodename =
"TOWER_CALIB_" +
detector;
466 string towernodename1=
"TOWER_CALIB_" + chrenkov1;
467 string towernodename2=
"TOWER_CALIB_" + chrenkov2;
469 string towernodename3=
"TOWER_CALIB_" + HODO_V;
470 string towernodename4=
"TOWER_CALIB_" + HODO_H;
472 string towernodename5=
"TOWER_CALIB_" + VETO;
474 string towernodename6=
"TOWER_RAW_"+ chrenkov2;
478 RawTowerContainer* towers = findNode::getClass<RawTowerContainer>(topNode, towernodename.c_str());
479 RawTowerContainer* towers_sub1 = findNode::getClass<RawTowerContainer>(topNode, towernodename1.c_str());
480 RawTowerContainer* towers_sub2 = findNode::getClass<RawTowerContainer>(topNode, towernodename2.c_str());
481 RawTowerContainer* towers_sub3= findNode::getClass<RawTowerContainer>(topNode,towernodename3.c_str());
482 RawTowerContainer* towers_sub4= findNode::getClass<RawTowerContainer>(topNode,towernodename4.c_str());
483 RawTowerContainer* towers_sub5= findNode::getClass<RawTowerContainer>(topNode,towernodename5.c_str());
489 Float_t energy_tower=0;
494 Float_t energy_chrenk1=0;
496 Float_t energy_chrenk2_C2inner=0;
497 Float_t energy_chrenk2_C2outer=0;
498 Float_t energy_chrenk2_C2inner_new=0;
499 Float_t energy_chrenk2_C2outer_new=0;
501 Float_t Horizontal_HODO_R0=abs(towers_sub4->getTower(0,0)->get_energy());
502 Float_t Horizontal_HODO_R1=abs(towers_sub4->getTower(0,1)->get_energy());
503 Float_t Horizontal_HODO_R2=abs(towers_sub4->getTower(0,2)->get_energy());
504 Float_t Horizontal_HODO_R3=abs(towers_sub4->getTower(0,3)->get_energy());
505 Float_t Horizontal_HODO_R4=abs(towers_sub4->getTower(0,4)->get_energy());
506 Float_t Horizontal_HODO_R5=abs(towers_sub4->getTower(0,5)->get_energy());
507 Float_t Horizontal_HODO_R6=abs(towers_sub4->getTower(0,6)->get_energy());
508 Float_t Horizontal_HODO_R7=abs(towers_sub4->getTower(0,7)->get_energy());
510 Float_t Vertical_HODO_R0=abs(towers_sub3->getTower(0,0)->get_energy());
511 Float_t Vertical_HODO_R1=abs(towers_sub3->getTower(0,1)->get_energy());
512 Float_t Vertical_HODO_R2=abs(towers_sub3->getTower(0,2)->get_energy());
513 Float_t Vertical_HODO_R3=abs(towers_sub3->getTower(0,3)->get_energy());
514 Float_t Vertical_HODO_R4=abs(towers_sub3->getTower(0,4)->get_energy());
515 Float_t Vertical_HODO_R5=abs(towers_sub3->getTower(0,5)->get_energy());
516 Float_t Vertical_HODO_R6=abs(towers_sub3->getTower(0,6)->get_energy());
517 Float_t Vertical_HODO_R7=abs(towers_sub3->getTower(0,7)->get_energy());
519 Float_t Veto_Trig0=abs(towers_sub5->getTower(0,0)->get_energy());
520 Float_t Veto_Trig1=abs(towers_sub5->getTower(0,1)->get_energy());
521 Float_t Veto_Trig2=abs(towers_sub5->getTower(0,2)->get_energy());
522 Float_t Veto_Trig3=abs(towers_sub5->getTower(0,3)->get_energy());
524 Float_t SaveHoriz_TowerID0=abs(towers_sub3->getTower(0,0)->get_id());
525 Float_t SaveHoriz_TowerID1=abs(towers_sub3->getTower(0,1)->get_id());
526 Float_t SaveHoriz_TowerID2=abs(towers_sub3->getTower(0,2)->get_id());
527 Float_t SaveHoriz_TowerID3=abs(towers_sub3->getTower(0,3)->get_id());
528 Float_t SaveHoriz_TowerID4=abs(towers_sub3->getTower(0,4)->get_id());
529 Float_t SaveHoriz_TowerID5=abs(towers_sub3->getTower(0,5)->get_id());
530 Float_t SaveHoriz_TowerID6=abs(towers_sub3->getTower(0,6)->get_id());
531 Float_t SaveHoriz_TowerID7=abs(towers_sub3->getTower(0,7)->get_id());
533 Float_t SaveVert_TowerID0=abs(towers_sub4->getTower(0,0)->get_id());
534 Float_t SaveVert_TowerID1=abs(towers_sub4->getTower(0,1)->get_id());
535 Float_t SaveVert_TowerID2=abs(towers_sub4->getTower(0,2)->get_id());
536 Float_t SaveVert_TowerID3=abs(towers_sub4->getTower(0,3)->get_id());
537 Float_t SaveVert_TowerID4=abs(towers_sub4->getTower(0,4)->get_id());
538 Float_t SaveVert_TowerID5=abs(towers_sub4->getTower(0,5)->get_id());
539 Float_t SaveVert_TowerID6=abs(towers_sub4->getTower(0,6)->get_id());
540 Float_t SaveVert_TowerID7=abs(towers_sub4->getTower(0,7)->get_id());
651 energy_chrenk1=towers_sub1->getTower(0,0)->get_energy();
653 energy_chrenk2_C2inner=towers_sub2->getTower(0)->get_energy();
654 energy_chrenk2_C2outer=towers_sub2->getTower(1)->get_energy();
717 Float_t getHorzTowerID=0;
718 Float_t getVertTowerID=0;
723 for (
int i=0;
i<8;
i++){
724 for (
int j=0;
j<8;
j++){
726 getHorzTowerID=towers_sub4->getTower(0,
j)->get_id();
727 getVertTowerID=towers_sub3->getTower(0,
j)->get_id();
730 if (energy_tower>Emax &&energy_tower>0 )
737 sumE=sumE+energy_tower;
738 saveHoriz=getHorzTowerID;
739 saveVert=getVertTowerID;
757 Float_t tower_x_1_y_1=0;
758 Float_t tower_x_1_y=0;
759 Float_t tower_x_1_yplus1=0;
761 Float_t tower_x_y_1=0;
762 Float_t tower_x_yplus1=0;
764 Float_t tower_xplus1_y_1=0;
765 Float_t tower_xplus1_y=0;
766 Float_t tower_xplus1_yplus1=0;
769 Float_t tower_x_2_y_2=0;
770 Float_t tower_x_2_y_1=0;
771 Float_t tower_x_2_y=0;
772 Float_t tower_x_2_yplus1=0;
773 Float_t tower_x_2_yplus2=0;
775 Float_t tower_x_1_y_2=0;
776 Float_t tower_x_1_yplus2=0;
778 Float_t tower_x_y_2=0;
779 Float_t tower_x_yplus2=0;
781 Float_t tower_xplus1_y_2=0;
782 Float_t tower_xplus1_yplus2=0;
784 Float_t tower_xplus2_y_2=0;
785 Float_t tower_xplus2_y_1=0;
786 Float_t tower_xplus2_y=0;
787 Float_t tower_xplus2_yplus1=0;
788 Float_t tower_xplus2_yplus2=0;
794 RawTowerContainer* towersmax = findNode::getClass<RawTowerContainer>(topNode, towernodename.c_str());
797 for (
int i=0;
i<8;
i++)
799 for (
int j=0;
j<8;
j++)
801 if (
i==eta_max&&
j==phi_max)
810 for (
int i=2;
i<6;
i++){
811 for (
int j=2;
j<6;
j++){
812 if (
i==eta_max&&
j==phi_max)
851 E_3by3=tower_x_1_y_1+tower_x_1_y+tower_x_1_yplus1+tower_x_y_1+
852 tower_x_yplus1+ tower_xplus1_y_1+ tower_xplus1_y+ tower_xplus1_yplus1+Emax;
854 E_5by5=tower_x_1_y_1+tower_x_1_y+tower_x_1_yplus1+tower_x_y_1+
855 tower_x_yplus1+tower_xplus1_y_1+ tower_xplus1_y+ tower_xplus1_yplus1+
856 tower_x_2_y_2+tower_x_2_y_1+tower_x_2_y+ tower_x_2_yplus1+
857 tower_x_2_yplus2+tower_x_1_y_2+tower_x_1_yplus2+ tower_x_y_2+
858 tower_x_yplus2+tower_xplus1_y_2+tower_xplus1_yplus2+tower_xplus2_y_2+
859 tower_xplus2_y_1+tower_xplus2_y+tower_xplus2_yplus1+tower_xplus2_yplus2+Emax;
894 cout<<
"HERE IS sum E :"<<sumE<<
"Here is the eta max : "
895 <<eta_max<<
" Here is phi max : "<<phi_max<<endl;
896 cout<<
"HERE IS tower E :"<<energy_tower<<
"E max :"<<Emax<<endl;