Changeset 264 in svn for trunk/src/SmearUtil.cc
- Timestamp:
- Feb 11, 2009, 10:22:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SmearUtil.cc
r261 r264 30 30 ***********************************************************************/ 31 31 32 32 33 /// \file SmearUtil.cc 33 34 /// \brief RESOLution class, and some generic definitions … … 42 43 #include <iomanip> 43 44 using namespace std; 44 45 46 ParticleUtil::ParticleUtil(const TLorentzVector &genMomentum, int pid) {47 _pid=pid;48 _e = genMomentum.E();49 _px = genMomentum.Px();50 _py = genMomentum.Py();51 _pz = genMomentum.Pz();52 _pt = genMomentum.Pt();53 54 //_e, _px, _py, _pz, _pt;55 //float _eta, _etaCalo, _phi, _phiCalo;56 //int _pid;57 }58 45 59 46 //------------------------------------------------------------------------------ … … 78 65 // Energy resolution for hadrons in ecal/hcal/hf 79 66 // \sigma/E = C + N/E + S/\sqrt{E} 80 HAD_Shcal = 1.5; // S term for central HCAL 67 HAD_Shcal = 1.5; // S term for central HCAL 81 68 HAD_Nhcal = 0.; // N term for central HCAL 82 69 HAD_Chcal = 0.05; // C term for central HCAL 83 HAD_Shf = 2.7; // S term for FCAL 70 HAD_Shf = 2.7; // S term for FCAL 84 71 HAD_Nhf = 0.; // N term for FCAL 85 72 HAD_Chf = 0.13; // C term for FCAL … … 128 115 FLAG_bfield = 1; //1 to run the bfield propagation else 0 129 116 FLAG_vfd = 1; //1 to run the very forward detectors else 0 117 FLAG_zdc = 1; //1 to run the zero degree calorimeter else 0 130 118 FLAG_trigger = 1; //1 to run the trigger selection else 0 131 119 FLAG_frog = 1; //1 to run the FROG event display … … 186 174 RP_cross_y = 0.0; 187 175 RP_cross_ang = 142.5; 188 189 190 176 191 177 } … … 250 236 FLAG_bfield = DET.FLAG_bfield; 251 237 FLAG_vfd = DET.FLAG_vfd; 238 FLAG_zdc = DET.FLAG_zdc; 252 239 FLAG_trigger = DET.FLAG_trigger; 253 240 FLAG_frog = DET.FLAG_frog; … … 279 266 RP_IP_name = DET.RP_IP_name; 280 267 281 282 268 // In case FROG event display allowed 283 269 NEvents_Frog = DET.NEvents_Frog; … … 364 350 FLAG_bfield = DET.FLAG_bfield; 365 351 FLAG_vfd = DET.FLAG_vfd; 352 FLAG_zdc = DET.FLAG_zdc; 366 353 FLAG_trigger = DET.FLAG_trigger; 367 354 FLAG_frog = DET.FLAG_frog; … … 504 491 505 492 else if(strstr(temp_string.c_str(),"FLAG_vfd")) {curstring >> varname >> ivalue; FLAG_vfd = ivalue;} 493 else if(strstr(temp_string.c_str(),"FLAG_zdc")) {curstring >> varname >> ivalue; FLAG_zdc = ivalue;} 506 494 else if(strstr(temp_string.c_str(),"FLAG_trigger")) {curstring >> varname >> ivalue; FLAG_trigger = ivalue;} 507 495 else if(strstr(temp_string.c_str(),"FLAG_frog")) {curstring >> varname >> ivalue; FLAG_frog = ivalue;} … … 604 592 if(FLAG_vfd==1){ 605 593 f_out<<"#********************************** *"<<"\n"; 606 f_out<<"# Very forward detector switche son *"<<"\n";594 f_out<<"# Very forward detector switched on *"<<"\n"; 607 595 f_out<<"#********************************** *"<<"\n"; 608 596 f_out<<"* *"<<"\n"; … … 639 627 f_out << left << setw(44) <<"* Angle of beam crossing:"<<"" 640 628 << left << setw(6) <<RP_cross_ang <<""<< right << setw(20)<<"! not in datacard *"<<"\n"; 641 642 629 f_out<<"* *"<<"\n"; 643 630 } 644 631 else { 645 632 f_out<<"#*********************************** *"<<"\n"; 646 f_out<<"# Very forward detector switche soff *"<<"\n";633 f_out<<"# Very forward detector switched off *"<<"\n"; 647 634 f_out<<"#*********************************** *"<<"\n"; 648 635 f_out<<"* *"<<"\n"; … … 692 679 if(FLAG_bfield==1){ 693 680 f_out<<"#*************************** *"<<"\n"; 694 f_out<<"# Magnetic field switche son *"<<"\n";681 f_out<<"# Magnetic field switched on *"<<"\n"; 695 682 f_out<<"#*************************** *"<<"\n"; 696 683 f_out<<"* *"<<"\n"; … … 713 700 else { 714 701 f_out<<"#**************************** *"<<"\n"; 715 f_out<<"# Magnetic field switche soff *"<<"\n";702 f_out<<"# Magnetic field switched off *"<<"\n"; 716 703 f_out<<"#**************************** *"<<"\n"; 717 704 f_out << left << setw(55) <<"* Minimal pT needed to reach the calorimeter [GeV]: "<<"" … … 953 940 //****************************************************************************************** 954 941 955 void RESOLution::SortedVector(vector<ParticleUtil> &vect) 942 //void RESOLution::SortedVector(vector<ParticleUtil> &vect) 943 void RESOLution::SortedVector(vector<D_Particle> &vect) 956 944 { 957 945 int i,j = 0; … … 966 954 if ( vect[j].Pt() > vect[j-1].Pt() ) 967 955 { 968 ParticleUtil tmp = vect[j-1]; 956 //ParticleUtil tmp = vect[j-1]; 957 D_Particle tmp = vect[j-1]; 969 958 vect[j-1] = vect[j]; 970 959 vect[j] = tmp; … … 1062 1051 //********** returns a segmented value for eta and phi, for calo towers ***** 1063 1052 void RESOLution::BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta){ 1064 iEta = -100;1065 int index= -100;1053 iEta = UNDEFINED; 1054 int index= iUNDEFINED; 1066 1055 for (unsigned int i=1; i< TOWER_number+1; i++) { 1067 1056 if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) { … … 1072 1061 } 1073 1062 } 1074 if(index== -100) return;1075 iPhi = -100;1063 if(index==UNDEFINED) return; 1064 iPhi = UNDEFINED; 1076 1065 float dphi = TOWER_dphi[index]*pi/180.; 1077 1066 for (unsigned int i=1; i < 360/TOWER_dphi[index]; i++ ) { … … 1085 1074 if (phi > pi-dphi) iPhi = pi-dphi; 1086 1075 } 1076 1077 1087 1078 1088 1079 //**************************** Returns the delta Phi ****************************
Note:
See TracChangeset
for help on using the changeset viewer.