| 87 |
AC = true; |
AC = true; |
| 88 |
ORB = true; |
ORB = true; |
| 89 |
|
|
| 90 |
|
RUN = true; |
| 91 |
|
|
| 92 |
}; |
}; |
| 93 |
/** |
/** |
| 508 |
* @param detlist String to select trees to be included |
* @param detlist String to select trees to be included |
| 509 |
* @return Pointer to a TTree |
* @return Pointer to a TTree |
| 510 |
*/ |
*/ |
| 511 |
TTree *PamLevel2::GetPamTree(TFile *f, TString detlist="+ALL"){ |
TTree *PamLevel2::GetPamTree(TFile *f, TString detlist ){ |
|
|
|
|
// cout << "WARNING!!! -- obsolete method -- \n"; |
|
|
// cout << "better use TChain *PamLevel2::GetPamTree(TList*, TString) \n"; |
|
| 512 |
|
|
| 513 |
|
// if( !detlist.IsNull() ) SetWhichTrees(detlist); |
| 514 |
|
// else GetWhichTrees(f); |
| 515 |
SetWhichTrees(detlist); |
SetWhichTrees(detlist); |
|
TTree *Trout =0; |
|
| 516 |
|
|
| 517 |
|
TTree *Trout =0; |
| 518 |
|
|
| 519 |
TString fname = f->GetName(); |
TString fname = f->GetName(); |
| 520 |
if(!CheckLevel2File(fname))return NULL; |
if(!CheckLevel2File(fname))return NULL; |
| 521 |
|
|
| 522 |
|
UInt_t *found=0; |
| 523 |
|
|
| 524 |
|
cout<< "GetPamTree(TFile*,TString): detector list --> "; |
| 525 |
|
if(TRK1)cout<<"TRK1 "; |
| 526 |
|
if(TRK2)cout<<"TRK2 "; |
| 527 |
|
if(TRKh)cout<<"TRKH "; |
| 528 |
|
if(CAL1)cout<<"CAL1 "; |
| 529 |
|
if(CAL2)cout<<"CAL2 "; |
| 530 |
|
if(TOF)cout<<"TOF "; |
| 531 |
|
if(TRG)cout<<"TRG "; |
| 532 |
|
if(AC)cout<<"AC "; |
| 533 |
|
if(ND)cout<<"ND "; |
| 534 |
|
if(S4)cout<<"S4 "; |
| 535 |
|
if(ORB)cout<<"ORB "; |
| 536 |
|
cout << endl; |
| 537 |
|
|
| 538 |
|
f->cd(); |
| 539 |
|
|
| 540 |
// Tracker |
// Tracker |
| 541 |
TTree *T = (TTree*)f->Get("Tracker"); |
TTree *T = (TTree*)f->Get("Tracker"); |
| 542 |
if(T && (TRK2||TRK1||TRKh)) { |
if(T && (TRK2||TRK1||TRKh)) { |
| 543 |
if(TRK2)T->SetBranchAddress("TrkLevel2", GetPointerTo("TrkLevel2")); |
if(TRK2)T->SetBranchAddress("TrkLevel2", GetPointerTo("TrkLevel2")); |
| 544 |
|
else T->SetBranchStatus("TrkLevel2",0,found); |
| 545 |
if(TRK2)cout << "Tracker : set branch address TrkLevel2"<<endl; |
if(TRK2)cout << "Tracker : set branch address TrkLevel2"<<endl; |
| 546 |
if(TRK1)T->SetBranchAddress("TrkLevel1", GetPointerTo("TrkLevel1")); |
if(TRK1)T->SetBranchAddress("TrkLevel1", GetPointerTo("TrkLevel1")); |
| 547 |
|
else T->SetBranchStatus("TrkLevel1",0,found); |
| 548 |
if(TRK1)cout << "Tracker : set branch address TrkLevel1"<<endl; |
if(TRK1)cout << "Tracker : set branch address TrkLevel1"<<endl; |
| 549 |
if(TRKh)T->SetBranchAddress("TrkHough", GetPointerTo("TrkHough")); |
if(TRKh)T->SetBranchAddress("TrkHough", GetPointerTo("TrkHough")); |
| 550 |
|
else T->SetBranchStatus("TrkHough",0,found); |
| 551 |
if(TRKh)cout << "Tracker : set branch address TrkHough"<<endl; |
if(TRKh)cout << "Tracker : set branch address TrkHough"<<endl; |
| 552 |
if(!Trout)Trout=T; |
if(!Trout)Trout=T; |
| 553 |
else Trout->AddFriend(T); |
else Trout->AddFriend(T); |
| 558 |
TTree *C = (TTree*)f->Get("Calorimeter"); |
TTree *C = (TTree*)f->Get("Calorimeter"); |
| 559 |
if(C && (CAL2||CAL1)) { |
if(C && (CAL2||CAL1)) { |
| 560 |
if(CAL2)C->SetBranchAddress("CaloLevel2", GetPointerTo("CaloLevel2")); |
if(CAL2)C->SetBranchAddress("CaloLevel2", GetPointerTo("CaloLevel2")); |
| 561 |
|
else C->SetBranchStatus("CaloLevel2",0,found); |
| 562 |
if(CAL2)cout << "Calorimeter : set branch address CaloLevel2"<<endl; |
if(CAL2)cout << "Calorimeter : set branch address CaloLevel2"<<endl; |
| 563 |
if(CAL1)C->SetBranchAddress("CaloLevel1", GetPointerTo("CaloLevel1")); |
if(CAL1)C->SetBranchAddress("CaloLevel1", GetPointerTo("CaloLevel1")); |
| 564 |
|
else C->SetBranchStatus("CaloLevel1",0,found); |
| 565 |
if(CAL1)cout << "Calorimeter : set branch address CaloLevel1"<<endl; |
if(CAL1)cout << "Calorimeter : set branch address CaloLevel1"<<endl; |
| 566 |
if(!Trout)Trout=C; |
if(!Trout)Trout=C; |
| 567 |
else Trout->AddFriend(C); |
else Trout->AddFriend(C); |
| 568 |
}else{ |
}else{ |
| 569 |
cout << "Calorimeter : missing tree"<<endl; |
cout << "Calorimeter : missing tree"<<endl; |
| 570 |
}; |
}; |
| 571 |
|
|
| 572 |
// ToF |
// ToF |
| 573 |
TTree *O = (TTree*)f->Get("ToF"); |
TTree *O = (TTree*)f->Get("ToF"); |
| 574 |
if(O && TOF) { |
if(O && TOF) { |
| 620 |
cout << "Anticounter : missing tree"<<endl; |
cout << "Anticounter : missing tree"<<endl; |
| 621 |
}; |
}; |
| 622 |
// Orbital Info |
// Orbital Info |
| 623 |
TTree *B = (TTree*)f->Get("OrbitalInfo"); |
TTree *B = (TTree*)f->Get("OrbitalInfo"); |
| 624 |
if(B && ORB) { |
if(B && ORB) { |
| 625 |
B->SetBranchAddress("OrbitalInfo", GetPointerTo("OrbitalInfo")); |
B->SetBranchAddress("OrbitalInfo", GetPointerTo("OrbitalInfo")); |
| 626 |
cout << "OrbitalInfo : set branch address OrbitalInfo"<<endl; |
cout << "OrbitalInfo : set branch address OrbitalInfo"<<endl; |
| 627 |
if(!Trout)Trout=O; |
if(!Trout)Trout=O; |
| 628 |
else Trout->AddFriend(B); |
else Trout->AddFriend(B); |
| 629 |
}else{ |
}else{ |
| 630 |
cout << "OrbitalInfo : missing tree"<<endl; |
cout << "OrbitalInfo : missing tree"<<endl; |
| 631 |
}; |
}; |
| 632 |
|
|
| 633 |
cout<<endl<<" Number of entries: "<<Trout->GetEntries()<<endl<<endl; |
cout<<endl<<" Number of entries: "<<Trout->GetEntries()<<endl<<endl; |
| 634 |
|
|
| 635 |
return Trout; |
return Trout; |
| 636 |
|
|
| 637 |
} |
} |
| 638 |
//-------------------------------------- |
//-------------------------------------- |
| 662 |
// if no input file list is given: |
// if no input file list is given: |
| 663 |
if ( flisttxt != "" ){ |
if ( flisttxt != "" ){ |
| 664 |
|
|
| 665 |
if( !gSystem->IsFileInIncludePath(flisttxt,&fullpath) )return 0; |
if( !gSystem->IsFileInIncludePath(flisttxt,&fullpath) ){ |
| 666 |
|
cout <<"File "<<flisttxt<<" not found"<<endl; |
| 667 |
|
return 0; |
| 668 |
|
} |
| 669 |
// flisttxt = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
// flisttxt = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
| 670 |
flisttxt = fullpath; |
flisttxt = fullpath; |
| 671 |
|
|
| 672 |
if( !gSystem->ChangeDirectory(ddir) )return 0; |
if( !gSystem->ChangeDirectory(ddir) ){ |
| 673 |
|
cout << "Cannot change directory : "<<ddir<<endl; |
| 674 |
|
return 0; |
| 675 |
|
} |
| 676 |
|
|
| 677 |
cout <<"Input file list : " << flisttxt <<endl; |
cout <<"Input file list : " << flisttxt <<endl; |
| 678 |
ifstream in; |
ifstream in; |
| 684 |
if (!in.good()) break; |
if (!in.good()) break; |
| 685 |
line++; |
line++; |
| 686 |
// cout <<"(1) " << file << endl; |
// cout <<"(1) " << file << endl; |
|
if(file.Contains("#"))file = file(0,file.First("#")); |
|
|
// cout <<"(2) " << file << endl; |
|
| 687 |
if(file.IsNull()){ |
if(file.IsNull()){ |
| 688 |
cout << "-- list interrupted at line "<<line <<endl; |
cout << "-- list interrupted at line "<<line <<endl; |
| 689 |
break; |
break; |
| 690 |
} |
} |
| 691 |
|
if(file.Contains("#"))file = file(0,file.First("#")); |
| 692 |
|
// cout <<"(2) " << file << endl; |
| 693 |
if( gSystem->IsFileInIncludePath(file,&fullpath) ){ |
if( gSystem->IsFileInIncludePath(file,&fullpath) ){ |
| 694 |
|
|
| 695 |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
| 696 |
|
|
| 697 |
}else{ |
}else{ |
| 698 |
if(file.Data()!="")cout << "File: "<<file<<" ---> missing "<< endl; |
// if(file.Data()!="")cout << "File: "<<file<<" ---> missing "<< endl; |
| 699 |
}; |
}; |
| 700 |
}; |
}; |
| 701 |
in.close(); |
in.close(); |
| 745 |
* @param detlist String to select trees to be included |
* @param detlist String to select trees to be included |
| 746 |
* @return Pointer to a TChain |
* @return Pointer to a TChain |
| 747 |
*/ |
*/ |
| 748 |
TChain *PamLevel2::GetPamTree(TList *fl, TString detlist="+ALL"){ |
TChain *PamLevel2::GetPamTree(TList *fl, TString detlist ){ |
|
|
|
|
// TChain *Tout=0; |
|
|
// if(Tout)Tout->Delete(); |
|
|
// Tout = NULL; |
|
| 749 |
|
|
| 750 |
TChain *Tout =0; |
TChain *Trout =0; |
| 751 |
|
|
| 752 |
|
// if( !detlist.IsNull() )SetWhichTrees(detlist); |
| 753 |
SetWhichTrees(detlist); |
SetWhichTrees(detlist); |
| 754 |
|
|
| 755 |
|
cout<< "GetPamTree(TList*,TString): detector list --> "; |
| 756 |
|
if(TRK1)cout<<"TRK1 "; |
| 757 |
|
if(TRK2)cout<<"TRK2 "; |
| 758 |
|
if(TRKh)cout<<"TRKH "; |
| 759 |
|
if(CAL1)cout<<"CAL1 "; |
| 760 |
|
if(CAL2)cout<<"CAL2 "; |
| 761 |
|
if(TOF)cout<<"TOF "; |
| 762 |
|
if(TRG)cout<<"TRG "; |
| 763 |
|
if(AC)cout<<"AC "; |
| 764 |
|
if(ND)cout<<"ND "; |
| 765 |
|
if(S4)cout<<"S4 "; |
| 766 |
|
if(ORB)cout<<"ORB "; |
| 767 |
|
cout << endl; |
| 768 |
|
|
| 769 |
|
|
| 770 |
|
|
| 771 |
TChain *T = 0; |
TChain *T = 0; |
| 772 |
TChain *C = 0; |
TChain *C = 0; |
| 773 |
TChain *O = 0; |
TChain *O = 0; |
| 778 |
TChain *B = 0; |
TChain *B = 0; |
| 779 |
|
|
| 780 |
if(TRK2||TRK1||TRKh) T = new TChain("Tracker"); |
if(TRK2||TRK1||TRKh) T = new TChain("Tracker"); |
| 781 |
if(CAL2||CAL1) C = new TChain("Calorimeter"); |
if(CAL2||CAL1) C = new TChain("Calorimeter"); |
| 782 |
if(TOF) O = new TChain("ToF"); |
if(TOF) O = new TChain("ToF"); |
| 783 |
if(TRG) R = new TChain("Trigger"); |
if(TRG) R = new TChain("Trigger"); |
| 784 |
if(S4) S = new TChain("S4"); |
if(S4) S = new TChain("S4"); |
| 785 |
if(ND) N = new TChain("NeutronD"); |
if(ND) N = new TChain("NeutronD"); |
| 786 |
if(AC) A = new TChain("Anticounter"); |
if(AC) A = new TChain("Anticounter"); |
| 787 |
if(ORB) B = new TChain("OrbitalInfo"); |
if(ORB) B = new TChain("OrbitalInfo"); |
| 788 |
|
|
| 789 |
// loop over files and create chains |
// loop over files and create chains |
| 790 |
TIter next(fl); |
TIter next(fl); |
| 791 |
TSystemFile *questo = 0; |
TSystemFile *questo = 0; |
| 792 |
while ( (questo = (TSystemFile*) next()) ) { |
while ( (questo = (TSystemFile*) next()) ) { |
| 793 |
TString name = questo->GetName(); |
TString name = questo->GetName(); |
| 794 |
// cout << "File: "<< name << endl; |
// cout << "File: "<< name << endl; |
| 795 |
if( CheckLevel2File(name) ){ |
if( CheckLevel2File(name) ){ |
| 796 |
if(TRK2||TRK1||TRKh) T->Add(name); |
if(TRK2||TRK1||TRKh) T->Add(name); |
| 797 |
if(CAL1||CAL2) C->Add(name); |
if(CAL1||CAL2) C->Add(name); |
| 798 |
if(TOF) O->Add(name); |
if(TOF) O->Add(name); |
| 799 |
if(TRG) R->Add(name); |
if(TRG) R->Add(name); |
| 800 |
if(S4) S->Add(name); |
if(S4) S->Add(name); |
| 801 |
if(ND) N->Add(name); |
if(ND) N->Add(name); |
| 802 |
if(AC) A->Add(name); |
if(AC) A->Add(name); |
| 803 |
if(ORB) B->Add(name); |
if(ORB) B->Add(name); |
| 804 |
}; |
}; |
| 805 |
} |
} |
| 806 |
|
|
| 807 |
cout << "done chain \n"; |
cout << "done chain \n"; |
| 808 |
|
|
| 809 |
|
UInt_t *found=0; |
| 810 |
|
// Tracker |
| 811 |
|
if(T && (TRK2||TRK1||TRKh)) { |
| 812 |
|
if(TRK2)T->SetBranchAddress("TrkLevel2", GetPointerTo("TrkLevel2")); |
| 813 |
|
else T->SetBranchStatus("TrkLevel2",0,found); |
| 814 |
|
if(TRK2)cout << "Tracker : set branch address TrkLevel2"<<endl; |
| 815 |
|
if(TRK1)T->SetBranchAddress("TrkLevel1", GetPointerTo("TrkLevel1")); |
| 816 |
|
else T->SetBranchStatus("TrkLevel1",0,found); |
| 817 |
|
if(TRK1)cout << "Tracker : set branch address TrkLevel1"<<endl; |
| 818 |
|
if(TRKh)T->SetBranchAddress("TrkHough", GetPointerTo("TrkHough")); |
| 819 |
|
else T->SetBranchStatus("TrkHough",0,found); |
| 820 |
|
if(TRKh)cout << "Tracker : set branch address TrkHough"<<endl; |
| 821 |
|
if(!Trout)Trout=T; |
| 822 |
|
else Trout->AddFriend("Tracker"); |
| 823 |
|
}else{ |
| 824 |
|
cout << "Tracker : missing tree"<<endl; |
| 825 |
|
}; |
| 826 |
// Calorimeter |
// Calorimeter |
| 827 |
if(CAL2||CAL1) { |
if(C && (CAL2||CAL1)) { |
| 828 |
if(!Tout)Tout=C; |
if(CAL2)C->SetBranchAddress("CaloLevel2", GetPointerTo("CaloLevel2")); |
| 829 |
else Tout->AddFriend("Calorimeter"); |
else C->SetBranchStatus("CaloLevel2",0,found); |
| 830 |
|
if(CAL2)cout << "Calorimeter : set branch address CaloLevel2"<<endl; |
| 831 |
|
if(CAL1)C->SetBranchAddress("CaloLevel1", GetPointerTo("CaloLevel1")); |
| 832 |
|
else C->SetBranchStatus("CaloLevel1",0,found); |
| 833 |
|
if(CAL1)cout << "Calorimeter : set branch address CaloLevel1"<<endl; |
| 834 |
|
if(!Trout)Trout=C; |
| 835 |
|
else Trout->AddFriend("Calorimeter"); |
| 836 |
|
}else{ |
| 837 |
|
cout << "Calorimeter : missing tree"<<endl; |
| 838 |
}; |
}; |
| 839 |
// ToF |
// ToF |
| 840 |
if(TOF) { |
if(O && TOF) { |
| 841 |
if(!Tout)Tout=O; |
O->SetBranchAddress("ToFLevel2", GetPointerTo("ToFLevel2")); |
| 842 |
else Tout->AddFriend("ToF"); |
cout << "ToF : set branch address ToFLevel2"<<endl; |
| 843 |
|
if(!Trout)Trout=O; |
| 844 |
|
else Trout->AddFriend("ToF"); |
| 845 |
|
}else{ |
| 846 |
|
cout << "ToF : missing tree"<<endl; |
| 847 |
}; |
}; |
|
// Tracker |
|
|
if(TRK2||TRK1||TRKh){ |
|
|
if(!Tout)Tout=T; |
|
|
else Tout->AddFriend("Tracker"); |
|
|
} |
|
| 848 |
// Trigger |
// Trigger |
| 849 |
if(TRG) { |
if(R && TRG) { |
| 850 |
if(!Tout)Tout=R; |
R->SetBranchAddress("TrigLevel2", GetPointerTo("TrigLevel2")); |
| 851 |
else Tout->AddFriend("Trigger"); |
cout << "Trigger : set branch address TrigLevel2"<<endl; |
| 852 |
|
if(!Trout)Trout=O; |
| 853 |
|
else Trout->AddFriend("Trigger"); |
| 854 |
|
}else{ |
| 855 |
|
cout << "Trigger : missing tree"<<endl; |
| 856 |
}; |
}; |
| 857 |
// S4 |
// S4 |
| 858 |
if(S4) { |
if(S && S4) { |
| 859 |
if(!Tout)Tout=S; |
S->SetBranchAddress("S4Level2", GetPointerTo("S4Level2")); |
| 860 |
else Tout->AddFriend("S4"); |
cout << "S4 : set branch address S4Level2"<<endl; |
| 861 |
|
if(!Trout)Trout=O; |
| 862 |
|
else Trout->AddFriend("S4"); |
| 863 |
|
}else{ |
| 864 |
|
cout << "S4 : missing tree"<<endl; |
| 865 |
}; |
}; |
| 866 |
// Neutron Detector |
// Neutron Detector |
| 867 |
if(ND) { |
if(N && ND) { |
| 868 |
if(!Tout)Tout=N; |
N->SetBranchAddress("NDLevel2", GetPointerTo("NDLevel2")); |
| 869 |
else Tout->AddFriend("NeutronD"); |
cout << "NeutronD : set branch address NDLevel2"<<endl; |
| 870 |
|
if(!Trout)Trout=O; |
| 871 |
|
else Trout->AddFriend("NeutronD"); |
| 872 |
|
}else{ |
| 873 |
|
cout << "NeutronD : missing tree"<<endl; |
| 874 |
}; |
}; |
| 875 |
// Anticounters |
// Anticounters |
| 876 |
if(AC) { |
if(A && AC) { |
| 877 |
if(!Tout)Tout=A; |
A->SetBranchAddress("AcLevel2", GetPointerTo("AcLevel2")); |
| 878 |
else Tout->AddFriend("Anticounter"); |
cout << "Anticounter : set branch address AcLevel2"<<endl; |
| 879 |
|
if(!Trout)Trout=O; |
| 880 |
|
else Trout->AddFriend("Anticounter"); |
| 881 |
|
}else{ |
| 882 |
|
cout << "Anticounter : missing tree"<<endl; |
| 883 |
}; |
}; |
| 884 |
// OrbitalInfo |
// Orbital Info |
| 885 |
if(ORB) { |
if(B && ORB) { |
| 886 |
if(!Tout)Tout=B; |
B->SetBranchAddress("OrbitalInfo", GetPointerTo("OrbitalInfo")); |
| 887 |
else Tout->AddFriend("OrbitalInfo"); |
cout << "OrbitalInfo : set branch address OrbitalInfo"<<endl; |
| 888 |
|
if(!Trout)Trout=O; |
| 889 |
|
else Trout->AddFriend("OrbitalInfo"); |
| 890 |
|
}else{ |
| 891 |
|
cout << "OrbitalInfo : missing tree"<<endl; |
| 892 |
}; |
}; |
| 893 |
|
|
| 894 |
|
// cout<<endl<<" Number of entries: "<<Trout->GetEntries()<<endl<<endl; |
| 895 |
|
|
| 896 |
|
|
| 897 |
|
// // Tracker |
| 898 |
|
// if(TRK2||TRK1||TRKh){ |
| 899 |
|
// if(!Tout)Tout=T; |
| 900 |
|
// else Tout->AddFriend("Tracker"); |
| 901 |
|
// } |
| 902 |
|
// // Calorimeter |
| 903 |
|
// if(CAL2||CAL1) { |
| 904 |
|
// if(!Tout)Tout=C; |
| 905 |
|
// else Tout->AddFriend("Calorimeter"); |
| 906 |
|
// }; |
| 907 |
|
// // ToF |
| 908 |
|
// if(TOF) { |
| 909 |
|
// if(!Tout)Tout=O; |
| 910 |
|
// else Tout->AddFriend("ToF"); |
| 911 |
|
// }; |
| 912 |
|
// // Trigger |
| 913 |
|
// if(TRG) { |
| 914 |
|
// if(!Tout)Tout=R; |
| 915 |
|
// else Tout->AddFriend("Trigger"); |
| 916 |
|
// }; |
| 917 |
|
// // S4 |
| 918 |
|
// if(S4) { |
| 919 |
|
// if(!Tout)Tout=S; |
| 920 |
|
// else Tout->AddFriend("S4"); |
| 921 |
|
// }; |
| 922 |
|
// // Neutron Detector |
| 923 |
|
// if(ND) { |
| 924 |
|
// if(!Tout)Tout=N; |
| 925 |
|
// else Tout->AddFriend("NeutronD"); |
| 926 |
|
// }; |
| 927 |
|
// // Anticounters |
| 928 |
|
// if(AC) { |
| 929 |
|
// if(!Tout)Tout=A; |
| 930 |
|
// else Tout->AddFriend("Anticounter"); |
| 931 |
|
// }; |
| 932 |
|
// // OrbitalInfo |
| 933 |
|
// if(ORB) { |
| 934 |
|
// if(!Tout)Tout=B; |
| 935 |
|
// else Tout->AddFriend("OrbitalInfo"); |
| 936 |
|
// }; |
| 937 |
|
|
| 938 |
// cout<<endl<<" Number of entries: "<<Tout->GetEntries()<<endl<<endl; |
// cout<<endl<<" Number of entries: "<<Tout->GetEntries()<<endl<<endl; |
| 939 |
|
|
| 940 |
// if( Tout->GetEntries() )PamLevel2::SetBranchAddress(); |
// if( Tout->GetEntries() )PamLevel2::SetBranchAddress( Tout ); |
|
if( Tout->GetEntries() )PamLevel2::SetBranchAddress( Tout ); |
|
| 941 |
|
|
| 942 |
return Tout; |
return Trout; |
| 943 |
} |
} |
| 944 |
|
|
| 945 |
|
|
| 1041 |
|
|
| 1042 |
// Tracker |
// Tracker |
| 1043 |
if(TRK2) { |
if(TRK2) { |
| 1044 |
t->SetBranchAddress("TrkLevel2", this->GetPointerTo("TrkLevel2")); |
t->SetBranchAddress("TrkLevel2", GetPointerTo("TrkLevel2")); |
| 1045 |
cout << "Tracker : set branch address TrkLevel2"<<endl; |
cout << "Tracker : set branch address TrkLevel2"<<endl; |
| 1046 |
}; |
}; |
| 1047 |
if(TRK1) { |
if(TRK1) { |
| 1096 |
|
|
| 1097 |
} |
} |
| 1098 |
|
|
|
// void* PamLevel2::GetPointerToTrk() {return &trk2_obj;}; |
|
|
// void* PamLevel2::GetPointerToTrk(int s){ |
|
|
// switch (s) { |
|
|
// case 1: return &trk1_obj; |
|
|
// case 2: return &trk2_obj; |
|
|
// case 3: return &trkh_obj; |
|
|
// default: return 0; |
|
|
// }; |
|
|
// }; |
|
|
// void* PamLevel2::GetPointerToCalo() {return &calo2_obj; }; |
|
|
// void* GetPointerToCalo(int s){ |
|
|
// switch (s) { |
|
|
// case 1: return &calo1_obj; |
|
|
// case 2: return &calo2_obj; |
|
|
// default: return 0; |
|
|
// }; |
|
|
// }; |
|
|
// void* GetPointerToToF() {return &tof_obj; }; |
|
|
// void* GetPointerTo("TrigLevel2") {return &trig_obj; }; |
|
|
// void* GetPointerTo("S4Level2") {return &s4_obj; }; |
|
|
// void* GetPointerTo("NDLevel2") {return &nd_obj; }; |
|
|
// void* GetPointerTo("AcLevel2") {return &ac_obj; }; |
|
|
// void* GetPointerTo("OrbitalInfo") {return &orb_obj; }; |
|
|
// void* GetPointerTo("RunInfo") {return &run_obj; }; |
|
| 1099 |
|
|
| 1100 |
//-------------------------------------- |
//-------------------------------------- |
| 1101 |
// |
// |
| 1157 |
*/ |
*/ |
| 1158 |
void PamLevel2::SetWhichTrees(TString detlist){ |
void PamLevel2::SetWhichTrees(TString detlist){ |
| 1159 |
|
|
| 1160 |
if(detlist.Contains("+ALL", TString::kIgnoreCase)){ |
if(detlist.IsNull() || detlist.Contains("+ALL", TString::kIgnoreCase)){ |
| 1161 |
CAL1 = true; |
CAL1 = true; |
| 1162 |
CAL2 = true; |
CAL2 = true; |
| 1163 |
TRK2 = true; |
TRK2 = true; |
| 1222 |
TRKh=false; |
TRKh=false; |
| 1223 |
} |
} |
| 1224 |
// ------------------------------------------------------------------------- |
// ------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
// if( detlist.Contains("-TRK", TString::kIgnoreCase) )TRK2 = false; |
|
|
// else if( detlist.Contains("+TRK", TString::kIgnoreCase) )TRK2 = true; |
|
|
|
|
|
// if( detlist.Contains("-TRK1", TString::kIgnoreCase) )TRK1 = false; |
|
|
// else if( detlist.Contains("+TRK1", TString::kIgnoreCase) )TRK1 = true; |
|
|
|
|
|
// if( detlist.Contains("-TRKh", TString::kIgnoreCase) )TRKh = false; |
|
|
// else if( detlist.Contains("+TRKh", TString::kIgnoreCase) )TRKh = true; |
|
| 1225 |
|
|
| 1226 |
if( detlist.Contains("-TRG", TString::kIgnoreCase) )TRG = false; |
if( detlist.Contains("-TRG", TString::kIgnoreCase) )TRG = false; |
| 1227 |
else if( detlist.Contains("+TRG", TString::kIgnoreCase) )TRG = true; |
else if( detlist.Contains("+TRG", TString::kIgnoreCase) )TRG = true; |
| 1240 |
|
|
| 1241 |
if( detlist.Contains("-ORB", TString::kIgnoreCase) )ORB = false; |
if( detlist.Contains("-ORB", TString::kIgnoreCase) )ORB = false; |
| 1242 |
else if( detlist.Contains("+ORB", TString::kIgnoreCase) )ORB = true; |
else if( detlist.Contains("+ORB", TString::kIgnoreCase) )ORB = true; |
| 1243 |
|
|
| 1244 |
|
// cout<< "Set detector list --> "; |
| 1245 |
|
// if(TRK1)cout<<"TRK1 "; |
| 1246 |
|
// if(TRK2)cout<<"TRK2 "; |
| 1247 |
|
// if(TRKh)cout<<"TRKH "; |
| 1248 |
|
// if(CAL1)cout<<"CAL1 "; |
| 1249 |
|
// if(CAL2)cout<<"CAL2 "; |
| 1250 |
|
// if(TOF)cout<<"TOF "; |
| 1251 |
|
// if(TRG)cout<<"TRG "; |
| 1252 |
|
// if(AC)cout<<"AC "; |
| 1253 |
|
// if(ND)cout<<"ND "; |
| 1254 |
|
// if(S4)cout<<"S4 "; |
| 1255 |
|
// if(ORB)cout<<"ORB "; |
| 1256 |
|
// cout << endl; |
| 1257 |
|
|
| 1258 |
|
}; |
| 1259 |
|
|
| 1260 |
|
|
| 1261 |
|
/** |
| 1262 |
|
* Set tree/branch detector flags from the content of a tree |
| 1263 |
|
*/ |
| 1264 |
|
void PamLevel2::GetWhichTrees(TFile* f){ |
| 1265 |
|
|
| 1266 |
|
|
| 1267 |
|
// ----------- |
| 1268 |
|
// reset flags |
| 1269 |
|
// ----------- |
| 1270 |
|
CAL1 = false; |
| 1271 |
|
CAL2 = false; |
| 1272 |
|
TRK2 = false; |
| 1273 |
|
TRK1 = false; |
| 1274 |
|
TRKh = false; |
| 1275 |
|
TRG = false; |
| 1276 |
|
TOF = false; |
| 1277 |
|
S4 = false; |
| 1278 |
|
ND = false; |
| 1279 |
|
AC = false; |
| 1280 |
|
ORB = false; |
| 1281 |
|
|
| 1282 |
|
RUN = false; |
| 1283 |
|
|
| 1284 |
|
cout << "Checking file: "<<f->GetName()<<endl; |
| 1285 |
|
if( !f || f->IsZombie() ){ |
| 1286 |
|
cout << "File: "<< f->GetName() <<" Non valid root file"<< endl; |
| 1287 |
|
return; |
| 1288 |
|
} |
| 1289 |
|
|
| 1290 |
|
TList *lk = f->GetListOfKeys(); |
| 1291 |
|
TIter next(lk); |
| 1292 |
|
TKey *key =0; |
| 1293 |
|
|
| 1294 |
|
Int_t nev = 0; |
| 1295 |
|
|
| 1296 |
|
while( (key = (TKey*)next()) ){ |
| 1297 |
|
|
| 1298 |
|
if( !strcmp(key->GetName(),"Run" ) )RUN = true; |
| 1299 |
|
|
| 1300 |
|
//========================================================= |
| 1301 |
|
if( !strcmp(key->GetName(),"Trigger" ) ){ |
| 1302 |
|
TRG = true; |
| 1303 |
|
Int_t nevt = ((TTree*)f->Get("Trigger"))->GetEntries(); |
| 1304 |
|
if( nev && nevt!=nev){ |
| 1305 |
|
cout << "File: "<< f->GetName() <<" Trigger tree has "<<nevt<<" events instead of "<<nev<< endl; |
| 1306 |
|
TRG = false; |
| 1307 |
|
}else nev=nevt; |
| 1308 |
|
} |
| 1309 |
|
//========================================================= |
| 1310 |
|
if( !strcmp(key->GetName(),"ToF" ) ){ |
| 1311 |
|
TOF = true; |
| 1312 |
|
Int_t nevt = ((TTree*)f->Get("ToF"))->GetEntries(); |
| 1313 |
|
if( nev && nevt!=nev){ |
| 1314 |
|
cout << "File: "<< f->GetName() <<" ToF tree has "<<nevt<<" events instead of "<<nev<< endl; |
| 1315 |
|
TOF = false; |
| 1316 |
|
}else nev=nevt; |
| 1317 |
|
} |
| 1318 |
|
//========================================================= |
| 1319 |
|
if( !strcmp(key->GetName(),"S4" ) ){ |
| 1320 |
|
S4 = true; |
| 1321 |
|
Int_t nevt = ((TTree*)f->Get("S4"))->GetEntries(); |
| 1322 |
|
if( nev && nevt!=nev){ |
| 1323 |
|
cout << "File: "<< f->GetName() <<" S4 tree has "<<nevt<<" events instead of "<<nev<< endl; |
| 1324 |
|
S4 = false; |
| 1325 |
|
}else nev=nevt; |
| 1326 |
|
} |
| 1327 |
|
//========================================================= |
| 1328 |
|
|
| 1329 |
|
if( !strcmp(key->GetName(),"NeutronD" ) ){ |
| 1330 |
|
ND = true; |
| 1331 |
|
Int_t nevt = ((TTree*)f->Get("NeutronD"))->GetEntries(); |
| 1332 |
|
if( nev && nevt!=nev){ |
| 1333 |
|
cout << "File: "<< f->GetName() <<"NeutronD tree has "<<nevt<<" events instead of "<<nev<< endl; |
| 1334 |
|
ND =false; |
| 1335 |
|
}else nev=nevt; |
| 1336 |
|
} |
| 1337 |
|
//========================================================= |
| 1338 |
|
if( !strcmp(key->GetName(),"Anticounter") ){ |
| 1339 |
|
AC = true; |
| 1340 |
|
Int_t nevt = ((TTree*)f->Get("Anticounter"))->GetEntries(); |
| 1341 |
|
if( nev && nevt!=nev){ |
| 1342 |
|
cout << "File: "<< f->GetName() <<" Anticounter tree has "<<nevt<<" events instead of "<<nev<< endl; |
| 1343 |
|
AC =false; |
| 1344 |
|
}else nev=nevt; |
| 1345 |
|
} |
| 1346 |
|
//========================================================= |
| 1347 |
|
if( !strcmp(key->GetName(),"OrbitalInfo") ){ |
| 1348 |
|
ORB = true; |
| 1349 |
|
Int_t nevt = ((TTree*)f->Get("OrbitalInfo"))->GetEntries(); |
| 1350 |
|
if( nev && nevt!=nev){ |
| 1351 |
|
cout << "File: "<< f->GetName() <<" OrbitalInfo tree has "<<nevt<<" events instead of "<<nev<< endl; |
| 1352 |
|
ORB = false; |
| 1353 |
|
}else nev=nevt; |
| 1354 |
|
} |
| 1355 |
|
//========================================================= |
| 1356 |
|
if( !strcmp(key->GetName(),"Tracker" ) ){ |
| 1357 |
|
TTree *T = (TTree*)f->Get("Tracker"); |
| 1358 |
|
for(Int_t i=0; i<T->GetListOfBranches()->GetEntries(); i++){ |
| 1359 |
|
TString name = T->GetListOfBranches()->At(i)->GetName(); |
| 1360 |
|
if( !name.CompareTo("TrkLevel1") )TRK1=true; |
| 1361 |
|
if( !name.CompareTo("TrkLevel2") )TRK2=true; |
| 1362 |
|
if( !name.CompareTo("TrkHough") )TRKh=true; |
| 1363 |
|
}; |
| 1364 |
|
Int_t nevt = T->GetEntries(); |
| 1365 |
|
if( nev && nevt!=nev){ |
| 1366 |
|
cout << "File: "<< f->GetName() <<" Tracker tree has "<<nevt<<" events instead of "<<nev<< endl; |
| 1367 |
|
TRK1 = false; |
| 1368 |
|
TRK2 = false; |
| 1369 |
|
TRKh = false; |
| 1370 |
|
}else nev=nevt; |
| 1371 |
|
T->Delete(); |
| 1372 |
|
}; |
| 1373 |
|
//========================================================= |
| 1374 |
|
if( !strcmp(key->GetName(),"Calorimeter" ) ){ |
| 1375 |
|
TTree *T = (TTree*)f->Get("Calorimeter"); |
| 1376 |
|
for(Int_t i=0; i<T->GetListOfBranches()->GetEntries(); i++){ |
| 1377 |
|
TString name = T->GetListOfBranches()->At(i)->GetName(); |
| 1378 |
|
if( !name.CompareTo("CaloLevel1") )CAL1=true; |
| 1379 |
|
if( !name.CompareTo("CaloLevel2") )CAL2=true; |
| 1380 |
|
}; |
| 1381 |
|
Int_t nevt = T->GetEntries(); |
| 1382 |
|
if( nev && nevt!=nev){ |
| 1383 |
|
cout << "File: "<< f->GetName() <<" Calorimeter tree has "<<nevt<<" events instead of "<<nev<< endl; |
| 1384 |
|
CAL1 = false; |
| 1385 |
|
CAL2 = false; |
| 1386 |
|
}else nev=nevt; |
| 1387 |
|
T->Delete(); |
| 1388 |
|
}; |
| 1389 |
|
|
| 1390 |
|
}; |
| 1391 |
|
|
| 1392 |
|
lk->Delete(); |
| 1393 |
|
|
| 1394 |
|
// cout<< "Get detector list from input file --> "; |
| 1395 |
|
// if(TRK1)cout<<"TRK1 "; |
| 1396 |
|
// if(TRK2)cout<<"TRK2 "; |
| 1397 |
|
// if(TRKh)cout<<"TRKH "; |
| 1398 |
|
// if(CAL1)cout<<"CAL1 "; |
| 1399 |
|
// if(CAL2)cout<<"CAL2 "; |
| 1400 |
|
// if(TOF)cout<<"TOF "; |
| 1401 |
|
// if(TRG)cout<<"TRG "; |
| 1402 |
|
// if(AC)cout<<"AC "; |
| 1403 |
|
// if(ND)cout<<"ND "; |
| 1404 |
|
// if(S4)cout<<"S4 "; |
| 1405 |
|
// if(ORB)cout<<"ORB "; |
| 1406 |
|
// cout << endl; |
| 1407 |
|
|
| 1408 |
|
return ; |
| 1409 |
|
|
| 1410 |
}; |
}; |
| 1411 |
|
|
| 1412 |
|
|
| 1413 |
//-------------------------------------- |
//-------------------------------------- |
| 1414 |
// |
// |
| 1415 |
// |
// |
| 1452 |
|
|
| 1453 |
while( (key = (TKey*)next()) ){ |
while( (key = (TKey*)next()) ){ |
| 1454 |
|
|
| 1455 |
// cout << key->GetName() << endl; |
// cout << key->GetName() << ""<<key->GetClassName()<<endl; |
| 1456 |
// cout << " Get tree: " << f->Get(key->GetName())<<endl; |
// cout << " Get tree: " << f->Get(key->GetName())<<endl; |
| 1457 |
// nev_previous = nev; |
// nev_previous = nev; |
| 1458 |
// cout << " n.entries "<< nev <<endl; |
// cout << " n.entries "<< nev <<endl; |
| 1459 |
// if( key->GetClassName()=="TTree" && nev_previous && nev != nev_previous ){ |
// if( key->GetClassName()=="TTree" && nev_previous && nev != nev_previous ){ |
| 1577 |
|
|
| 1578 |
}; |
}; |
| 1579 |
|
|
| 1580 |
|
// cout<< "CheckLevel2File(TString): detector list --> "; |
| 1581 |
|
// if(TRK1__ok)cout<<"TRK1 "; |
| 1582 |
|
// if(TRK2__ok)cout<<"TRK2 "; |
| 1583 |
|
// if(TRKh__ok)cout<<"TRKH "; |
| 1584 |
|
// if(CAL1__ok)cout<<"CAL1 "; |
| 1585 |
|
// if(CAL2__ok)cout<<"CAL2 "; |
| 1586 |
|
// if(TOF__ok)cout<<"TOF "; |
| 1587 |
|
// if(TRG__ok)cout<<"TRG "; |
| 1588 |
|
// if(AC__ok)cout<<"AC "; |
| 1589 |
|
// if(ND__ok)cout<<"ND "; |
| 1590 |
|
// if(S4__ok)cout<<"S4 "; |
| 1591 |
|
// if(ORB__ok)cout<<"ORB "; |
| 1592 |
|
// cout << endl; |
| 1593 |
|
|
| 1594 |
|
|
| 1595 |
if(!RUN__ok) { |
if(!RUN__ok) { |
| 1634 |
return false; |
return false; |
| 1635 |
}; |
}; |
| 1636 |
|
|
| 1637 |
if(ND && !ND__ok){ |
if(ND && !ND__ok){ |
| 1638 |
cout << "File: "<< f->GetName() <<" discarded ---- Missing ND tree"<< endl; |
cout << "File: "<< f->GetName() <<" discarded ---- Missing ND tree"<< endl; |
| 1639 |
return false; |
return false; |
| 1640 |
}; |
}; |
| 1641 |
if(TRG && !TRG__ok){ |
if(TRG && !TRG__ok){ |
| 1642 |
cout << "File: "<< f->GetName() <<" discarded ---- Missing Trigger tree"<< endl; |
cout << "File: "<< f->GetName() <<" discarded ---- Missing Trigger tree"<< endl; |
| 1643 |
return false; |
return false; |
| 1644 |
}; |
}; |
| 1645 |
|
|
|
|
|
|
|
|
|
|
|
| 1646 |
|
|
| 1647 |
lk->Delete(); |
lk->Delete(); |
| 1648 |
f->Close(); |
f->Close(); |
| 1649 |
|
|
| 1650 |
|
// cout<< "CheckLevel2File(TString): detector list --> "; |
| 1651 |
|
// if(TRK1)cout<<"TRK1 "; |
| 1652 |
|
// if(TRK2)cout<<"TRK2 "; |
| 1653 |
|
// if(TRKh)cout<<"TRKH "; |
| 1654 |
|
// if(CAL1)cout<<"CAL1 "; |
| 1655 |
|
// if(CAL2)cout<<"CAL2 "; |
| 1656 |
|
// if(TOF)cout<<"TOF "; |
| 1657 |
|
// if(TRG)cout<<"TRG "; |
| 1658 |
|
// if(AC)cout<<"AC "; |
| 1659 |
|
// if(ND)cout<<"ND "; |
| 1660 |
|
// if(S4)cout<<"S4 "; |
| 1661 |
|
// if(ORB)cout<<"ORB "; |
| 1662 |
|
// cout << endl; |
| 1663 |
|
|
| 1664 |
return true; |
return true; |
| 1665 |
|
|
| 1669 |
/** |
/** |
| 1670 |
* Create clone-trees |
* Create clone-trees |
| 1671 |
*/ |
*/ |
| 1672 |
void PamLevel2::CreateCloneTrees( TChain *fChain ){ |
void PamLevel2::CreateCloneTrees0( TChain *fChain, TFile *ofile ){ |
| 1673 |
|
|
| 1674 |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
| 1675 |
cout << "Create clones of PAMELA trees "<<endl; |
cout << "Create clones of PAMELA trees "<<endl; |
| 1685 |
TList *li = fChain->GetListOfFriends(); |
TList *li = fChain->GetListOfFriends(); |
| 1686 |
TIter next(li); |
TIter next(li); |
| 1687 |
TFriendElement* T_friend=0; |
TFriendElement* T_friend=0; |
| 1688 |
|
ofile->cd(); |
| 1689 |
while( (T_friend = (TFriendElement*)next()) ){ |
while( (T_friend = (TFriendElement*)next()) ){ |
| 1690 |
// cout<<T_friend->IsA()->GetName()<<" "<<T_friend->GetName()<<hex << T_friend->GetTree() << dec<<endl; |
// cout<<T_friend->IsA()->GetName()<<" "<<T_friend->GetName()<<hex << T_friend->GetTree() << dec<<endl; |
| 1691 |
// cout<<T_friend->GetTree()->GetName()<< endl; |
// cout<<T_friend->GetTree()->GetName()<< endl; |
| 1692 |
tree_clone[i] = T_friend->GetTree()->CloneTree(0); |
tree_clone[i] = T_friend->GetTree()->CloneTree(0); |
| 1693 |
|
tree_clone[i]->SetAutoSave(1000000); |
| 1694 |
name = tree_clone[i]->GetName(); |
name = tree_clone[i]->GetName(); |
| 1695 |
name.Append("_clone"); |
name.Append("_clone"); |
| 1696 |
// tree_clone[i]->SetName(name.Data()); |
// tree_clone[i]->SetName(name.Data()); |
| 1702 |
|
|
| 1703 |
} |
} |
| 1704 |
|
|
| 1705 |
// /** |
/** |
| 1706 |
// * Create clone-trees |
* Create clone-trees |
| 1707 |
// */ |
*/ |
| 1708 |
// void PamLevel2::CreateCloneTrees(){ |
void PamLevel2::CreateCloneTrees(TFile *ofile){ |
| 1709 |
|
|
| 1710 |
// cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
ofile->cd(); |
| 1711 |
// cout << "Create new PAMELA trees "<<endl; |
|
| 1712 |
|
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
| 1713 |
|
cout << "Create new PAMELA trees "<<endl; |
| 1714 |
|
|
| 1715 |
// if(TRK1||TRK2||TRKh){ |
Int_t i=0; |
|
// T_clone = new TTree("Tracker_clone","PAMELA tracker level2 data "); |
|
|
// if(TRK1) { |
|
|
// trk1_clone = new TrkLevel1(); |
|
|
// T_clone->Branch("TrkLevel1","TrkLevel1", GetPointerTo("TrkLevel1")); |
|
|
// T_clone->BranchRef(); |
|
|
// cout << "Tracker : branch TrkLevel1"<<endl; |
|
|
// }; |
|
|
// if(TRK2) { |
|
|
// trk2_clone = new TrkLevel2(); |
|
|
// T_clone->Branch("TrkLevel2", "TrkLevel2",GetPointerTo("TrkLevel2")); |
|
|
// cout << "Tracker : branch TrkLevel2"<<endl; |
|
|
// }; |
|
|
// if(TRKh) { |
|
|
// trkh_clone = new TrkHough(); |
|
|
// T_clone->Branch("TrkHough","TrkHough", GetPointerTo("TrkHough")); |
|
|
// cout << "Tracker : branch TrkHough"<<endl; |
|
|
// }; |
|
|
// cout << hex << T_clone << dec << endl; |
|
|
// } |
|
| 1716 |
|
|
| 1717 |
// // Calorimeter |
if(TRK1||TRK2||TRKh){ |
| 1718 |
// if(CAL1||CAL2){ |
tree_clone[i] = new TTree("Tracker","PAMELA tracker level2 data "); |
| 1719 |
// C_clone = new TTree("Calorimeter_clone","PAMELA calorimeter level2 data "); |
if(TRK1) { |
| 1720 |
// if(CAL1) { |
tree_clone[i]->Branch("TrkLevel1","TrkLevel1", GetPointerTo("TrkLevel1")); |
| 1721 |
// calo1_clone = new CaloLevel1(); |
tree_clone[i]->BranchRef(); |
| 1722 |
// C_clone->Branch("CaloLevel1", "CaloLevel1", GetPointerTo("CaloLevel1")); |
cout << "Tracker : branch TrkLevel1"<<endl; |
| 1723 |
// cout << "Calorimeter : branch CaloLevel1"<<endl; |
}; |
| 1724 |
// }; |
if(TRK2) { |
| 1725 |
// if(CAL2) { |
tree_clone[i]->Branch("TrkLevel2", "TrkLevel2",GetPointerTo("TrkLevel2")); |
| 1726 |
// calo2_clone = new CaloLevel2(); |
cout << "Tracker : branch TrkLevel2"<<endl; |
| 1727 |
// C_clone->Branch("CaloLevel2","CaloLevel2", GetPointerTo("CaloLevel2")); |
}; |
| 1728 |
// cout << "Calorimeter : branch CaloLevel2"<<endl; |
if(TRKh) { |
| 1729 |
// }; |
tree_clone[i]->Branch("TrkHough","TrkHough", GetPointerTo("TrkHough")); |
| 1730 |
// } |
cout << "Tracker : branch TrkHough"<<endl; |
| 1731 |
|
}; |
| 1732 |
|
i++; |
| 1733 |
|
} |
| 1734 |
|
|
| 1735 |
// // ToF |
// Calorimeter |
| 1736 |
// if(TOF) { |
if(CAL1||CAL2){ |
| 1737 |
// O_clone = new TTree("ToF_clone","PAMELA ToF level2 data "); |
tree_clone[i] = new TTree("Calorimeter","PAMELA calorimeter level2 data "); |
| 1738 |
// tof_clone = new ToFLevel2(); |
if(CAL1) { |
| 1739 |
// O_clone->Branch("ToFLevel2","ToFLevel2", GetPointerTo("ToFLevel2")); |
tree_clone[i]->Branch("CaloLevel1", "CaloLevel1", GetPointerTo("CaloLevel1")); |
| 1740 |
// cout << "ToF : branch ToFLevel2"<<endl; |
cout << "Calorimeter : branch CaloLevel1"<<endl; |
| 1741 |
// }; |
}; |
| 1742 |
// // Trigger |
if(CAL2) { |
| 1743 |
// if(TRG) { |
tree_clone[i]->Branch("CaloLevel2","CaloLevel2", GetPointerTo("CaloLevel2")); |
| 1744 |
// R_clone = new TTree("Trigger_clone","PAMELA trigger level2 data "); |
cout << "Calorimeter : branch CaloLevel2"<<endl; |
| 1745 |
// trig_clone = new TrigLevel2(); |
}; |
| 1746 |
// R_clone->Branch("TrigLevel2","TrigLevel2", GetPointerTo("TrigLevel2")); |
i++; |
| 1747 |
// cout << "Trigger : branch TrigLevel2"<<endl; |
} |
|
// }; |
|
|
// // S4 |
|
|
// if(S4) { |
|
|
// S_clone = new TTree("S4_clone","PAMELA S4 level2 data "); |
|
|
// s4_clone = new S4Level2(); |
|
|
// S_clone->Branch("S4Level2","S4Level2", GetPointerTo("S4Level2")); |
|
|
// cout << "S4 : branch S4Level2"<<endl; |
|
|
// }; |
|
|
// // Neutron Detector |
|
|
// if(ND) { |
|
|
// N_clone = new TTree("NeutronD_clone","PAMELA neutron detector level2 data "); |
|
|
// nd_clone = new NDLevel2(); |
|
|
// N_clone->Branch("NDLevel2","NDLevel2", GetPointerTo("NDLevel2")); |
|
|
// cout << "NeutronD : branch NDLevel2"<<endl; |
|
|
// }; |
|
|
// // Anticounters |
|
|
// if(AC) { |
|
|
// A_clone = new TTree("Anticounter_clone","PAMELA anticounter detector level2 data "); |
|
|
// ac_clone = new AcLevel2(); |
|
|
// A_clone->Branch("AcLevel2","AcLevel2", GetPointerTo("AcLevel2")); |
|
|
// cout << "Anticounter : branch AcLevel2"<<endl; |
|
|
// }; |
|
|
// // OrbitalInfo |
|
|
// if(ORB) { |
|
|
// B_clone = new TTree("OrbitalInfo_clone","PAMELA oribital info "); |
|
|
// orb_clone = new OrbitalInfo(); |
|
|
// B_clone->Branch("OrbitalInfo","OrbitalInfo", GetPointerTo("OrbitalInfo")); |
|
|
// cout << "OrbitalInfo : branch OrbitalInfo"<<endl; |
|
|
// }; |
|
|
// cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
|
| 1748 |
|
|
| 1749 |
// } |
// ToF |
| 1750 |
|
if(TOF) { |
| 1751 |
|
tree_clone[i] = new TTree("ToF","PAMELA ToF level2 data "); |
| 1752 |
|
tree_clone[i]->Branch("ToFLevel2","ToFLevel2", GetPointerTo("ToFLevel2")); |
| 1753 |
|
cout << "ToF : branch ToFLevel2"<<endl; |
| 1754 |
|
i++; |
| 1755 |
|
}; |
| 1756 |
|
// Trigger |
| 1757 |
|
if(TRG) { |
| 1758 |
|
tree_clone[i] = new TTree("Trigger","PAMELA trigger level2 data "); |
| 1759 |
|
tree_clone[i]->Branch("TrigLevel2","TrigLevel2", GetPointerTo("TrigLevel2")); |
| 1760 |
|
cout << "Trigger : branch TrigLevel2"<<endl; |
| 1761 |
|
i++; |
| 1762 |
|
}; |
| 1763 |
|
// S4 |
| 1764 |
|
if(S4) { |
| 1765 |
|
tree_clone[i] = new TTree("S4","PAMELA S4 level2 data "); |
| 1766 |
|
tree_clone[i]->Branch("S4Level2","S4Level2", GetPointerTo("S4Level2")); |
| 1767 |
|
cout << "S4 : branch S4Level2"<<endl; |
| 1768 |
|
i++; |
| 1769 |
|
}; |
| 1770 |
|
// Neutron Detector |
| 1771 |
|
if(ND) { |
| 1772 |
|
tree_clone[i] = new TTree("NeutronD","PAMELA neutron detector level2 data "); |
| 1773 |
|
tree_clone[i]->Branch("NDLevel2","NDLevel2", GetPointerTo("NDLevel2")); |
| 1774 |
|
cout << "NeutronD : branch NDLevel2"<<endl; |
| 1775 |
|
i++; |
| 1776 |
|
}; |
| 1777 |
|
// Anticounters |
| 1778 |
|
if(AC) { |
| 1779 |
|
tree_clone[i] = new TTree("Anticounter","PAMELA anticounter detector level2 data "); |
| 1780 |
|
tree_clone[i]->Branch("AcLevel2","AcLevel2", GetPointerTo("AcLevel2")); |
| 1781 |
|
cout << "Anticounter : branch AcLevel2"<<endl; |
| 1782 |
|
i++; |
| 1783 |
|
}; |
| 1784 |
|
// OrbitalInfo |
| 1785 |
|
if(ORB) { |
| 1786 |
|
tree_clone[i] = new TTree("OrbitalInfo","PAMELA oribital info "); |
| 1787 |
|
tree_clone[i]->Branch("OrbitalInfo","OrbitalInfo", GetPointerTo("OrbitalInfo")); |
| 1788 |
|
cout << "OrbitalInfo : branch OrbitalInfo"<<endl; |
| 1789 |
|
i++; |
| 1790 |
|
}; |
| 1791 |
|
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
| 1792 |
|
|
| 1793 |
|
} |
| 1794 |
|
|
| 1795 |
// /** |
// /** |
| 1796 |
// * Create clone-trees |
// * Create clone-trees |