- Timestamp:
- Dec 3, 2008, 2:47:52 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SmearUtil.cc
r69 r71 52 52 ELG_Ncen = 0.25 ; // N term for central ECAL 53 53 ELG_Ccen = 0.0055 ; // C term for central ECAL 54 ELG_ Sfwd = 1.5;// S term for forward ECAL55 ELG_ Nfwd = 0.0; // N term for centralECAL56 ELG_ Cfwd = 0.06; // C term for forwardECAL54 ELG_Cfwd = 0.107 ; // S term for forward ECAL 55 ELG_Sfwd = 2.084 ; // C term for forward ECAL 56 ELG_Nfwd = 0.0 ; // N term for central ECAL 57 57 58 58 HAD_Shcal = 1.5 ; // S term for central HCAL // hadronic calorimeter … … 104 104 M_MAXITERATIONS = 100; 105 105 106 // Define Calorimeter Towers 107 NTOWERS = 40; 108 109 const float tower_eta_edges[41] = { 110 0., 0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696, 0.783, 0.870, 0.957, 1.044, 1.131, 1.218, 1.305, 1.392, 1.479, 1.566, 111 1.653, 1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.868, 2.950, 3.125, 3.300, 3.475, 3.650, 3.825, 4.000, 4.175, 112 4.350, 4.525, 4.700, 5.000}; // temporary object 113 TOWER_ETA_EDGES = new float[NTOWERS+1]; 114 for(unsigned int i=0; i<NTOWERS+1; i++) TOWER_ETA_EDGES[i] = tower_eta_edges[i]; 115 116 const float tower_dphi[40] = { 117 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, 118 10,10,10,10,10, 10,10,10,10,10, 10,10,10,10,10, 10,10,10,20, 20 }; // temporary object 119 TOWER_DPHI = new float[NTOWERS]; 120 for(unsigned int i=0; i<NTOWERS; i++) TOWER_DPHI[i] = tower_dphi[i]; 121 106 122 } 107 123 … … 122 138 curstring.str(temp_string); 123 139 string varname; 124 float value; 140 float value; int ivalue; 125 141 126 142 if(strstr(temp_string.c_str(),"#")) { } … … 129 145 else if(strstr(temp_string.c_str(),"MAX_CALO_FWD")){curstring >> varname >> value; MAX_CALO_FWD = value;} 130 146 else if(strstr(temp_string.c_str(),"MAX_MU")){curstring >> varname >> value; MAX_MU = value;} 131 else if(strstr(temp_string.c_str(),"TRACKING_RADIUS")){curstring >> varname >> value; TRACKING_RADIUS = (int)value;}132 else if(strstr(temp_string.c_str(),"TRACKING_LENGTH")){curstring >> varname >> value; TRACKING_LENGTH = (int)value;}147 else if(strstr(temp_string.c_str(),"TRACKING_RADIUS")){curstring >> varname >> ivalue; TRACKING_RADIUS = ivalue;} 148 else if(strstr(temp_string.c_str(),"TRACKING_LENGTH")){curstring >> varname >> ivalue; TRACKING_LENGTH = ivalue;} 133 149 else if(strstr(temp_string.c_str(),"BFIELD_X")){curstring >> varname >> value; BFIELD_X = value;} 134 150 else if(strstr(temp_string.c_str(),"BFIELD_Y")){curstring >> varname >> value; BFIELD_Y = value;} … … 151 167 else if(strstr(temp_string.c_str(),"PT_TRACK_TAU")){curstring >> varname >> value; PT_TRACK_TAU = value;} 152 168 else if(strstr(temp_string.c_str(),"PT_TRACKS_MIN")){curstring >> varname >> value; PT_TRACKS_MIN = value;} 153 else if(strstr(temp_string.c_str(),"TAGGING_B")){curstring >> varname >> value; TAGGING_B = (int)value;}154 else if(strstr(temp_string.c_str(),"MISTAGGING_C")){curstring >> varname >> value; MISTAGGING_C = (int)value;}155 else if(strstr(temp_string.c_str(),"MISTAGGING_L")){curstring >> varname >> value; MISTAGGING_L = (int)value;}169 else if(strstr(temp_string.c_str(),"TAGGING_B")){curstring >> varname >> ivalue; TAGGING_B = ivalue;} 170 else if(strstr(temp_string.c_str(),"MISTAGGING_C")){curstring >> varname >> ivalue; MISTAGGING_C = ivalue;} 171 else if(strstr(temp_string.c_str(),"MISTAGGING_L")){curstring >> varname >> ivalue; MISTAGGING_L = ivalue;} 156 172 else if(strstr(temp_string.c_str(),"CONERADIUS")){curstring >> varname >> value; CONERADIUS = value;} 157 else if(strstr(temp_string.c_str(),"JETALGO")){curstring >> varname >> value; JETALGO = (int)value;}158 else if(strstr(temp_string.c_str(),"TRACKING_EFF")){curstring >> varname >> value; TRACKING_EFF = (int)value;}173 else if(strstr(temp_string.c_str(),"JETALGO")){curstring >> varname >> ivalue; JETALGO = ivalue;} 174 else if(strstr(temp_string.c_str(),"TRACKING_EFF")){curstring >> varname >> ivalue; TRACKING_EFF = ivalue;} 159 175 else if(strstr(temp_string.c_str(),"ELEC_pt")){curstring >> varname >> value; ELEC_pt = value;} 160 176 else if(strstr(temp_string.c_str(),"MUON_pt")){curstring >> varname >> value; MUON_pt = value;} 161 177 else if(strstr(temp_string.c_str(),"JET_pt")){curstring >> varname >> value; JET_pt = value;} 162 178 else if(strstr(temp_string.c_str(),"TAUJET_pt")){curstring >> varname >> value; TAUJET_pt = value;} 179 else if(strstr(temp_string.c_str(),"NTOWERS")){curstring >> varname >> ivalue; NTOWERS = ivalue;} 180 else if(strstr(temp_string.c_str(),"TOWER_ETA_EDGES")){ 181 curstring >> varname; for(unsigned int i=0; i<NTOWERS+1; i++) {curstring >> value; TOWER_ETA_EDGES[i] = value;} } 182 else if(strstr(temp_string.c_str(),"TOWER_DPHI")){ 183 curstring >> varname; for(unsigned int i=0; i<NTOWERS; i++) {curstring >> value; TOWER_DPHI[i] = value;} } 184 163 185 164 186 } … … 182 204 PROTOJET_PTMIN = 0.0; 183 205 184 DOTRIGGER=1;185 206 186 207 } 187 208 188 209 void RESOLution::Logfile(string LogName) { 210 //void RESOLution::Logfile(string outputfilename) { 189 211 190 212 ofstream f_out(LogName.c_str()); … … 266 288 << left << setw(5) <<BFIELD_Z <<""<< right << setw(10)<<"*"<<"\n"; 267 289 f_out<<"* *"<<"\n"; 290 291 292 f_out<<"* *"<<"\n"; 293 f_out<<"#******************** *"<<"\n"; 294 f_out<<"# Calorimetric Towers *"<<"\n"; 295 f_out<<"#******************** *"<<"\n"; 296 f_out << left << setw(55) <<"* Number of calorimetric towers in eta, for eta>0: "<<"" 297 << left << setw(5) << NTOWERS <<""<< right << setw(10)<<"*"<<"\n"; 298 f_out << left << setw(55) <<"* Tower edges in eta, for eta>0: "<<"" << right << setw(15)<<"*"<<"\n"; 299 f_out << "* "; 300 for (unsigned int i=0; i<NTOWERS+1; i++) { 301 f_out << left << setw(7) << TOWER_ETA_EDGES[i]; 302 if(!( (i+1) %9 )) f_out << right << setw(3) << "*" << "\n" << "* "; 303 } 304 for (unsigned int i=(NTOWERS+1)%9; i<9; i++) f_out << left << setw(7) << ""; 305 f_out << right << setw(3)<<"*"<<"\n"; 306 f_out << left << setw(55) <<"* Tower sizes in phi, for eta>0 [degree]:"<<"" << right << setw(15)<<"*"<<"\n"; 307 f_out << "* "; 308 for (unsigned int i=0; i<NTOWERS; i++) { 309 f_out << left << setw(7) << TOWER_DPHI[i]; 310 if(!( (i+1) %9 )) f_out << right << setw(3) << "*" << "\n" << "* "; 311 } 312 for (unsigned int i=(NTOWERS)%9; i<9; i++) f_out << left << setw(7) << ""; 313 f_out << right << setw(3)<<"*"<<"\n"; 314 f_out<<"* *"<<"\n"; 315 268 316 f_out<<"#************************************ *"<<"\n"; 269 317 f_out<<"# Electromagnetic smearing parameters *"<<"\n"; … … 446 494 float energy = electron.E(); // before smearing 447 495 float energyS = 0.0; // after smearing // \sigma/E = C + N/E + S/\sqrt{E} 448 float eta=fabs(electron.Eta()); 449 450 if(eta < MAX_TRACKER) { // if the electron is inside the tracker 496 497 if(fabs(electron.Eta()) < MAX_TRACKER) { // if the electron is inside the tracker 451 498 energyS = gRandom->Gaus(energy, sqrt( 452 499 pow(ELG_Ncen,2) + … … 454 501 pow(ELG_Scen*sqrt(energy),2) )); 455 502 } 456 if( eta > MAX_TRACKER && eta< MAX_CALO_FWD){503 if(fabs(electron.Eta()) > MAX_TRACKER && fabs(electron.Eta()) < MAX_CALO_FWD){ 457 504 energyS = gRandom->Gaus(energy, sqrt( 458 505 pow(ELG_Nfwd,2) + … … 609 656 610 657 658 //********** returns a segmented value for eta and phi, for calo towers ***** 659 void RESOLution::BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta){ 660 iEta = -100; 661 int index=-100; 662 for (unsigned int i=1; i< NTOWERS+1; i++) { 663 if(fabs(eta)>TOWER_ETA_EDGES[i-1] && fabs(eta)<TOWER_ETA_EDGES[i]) { 664 iEta = (eta>0) ? TOWER_ETA_EDGES[i-1] : -TOWER_ETA_EDGES[i]; 665 index = i-1; 666 //cout << setw(15) << left << eta << "\t" << iEta << endl; 667 break; 668 } 669 } 670 if(index==-100) return; 671 iPhi = -100; 672 float dphi = TOWER_DPHI[index]*PI/180.; 673 for (unsigned int i=1; i < 360/TOWER_DPHI[index]; i++ ) { 674 float low = -PI+(i-1)*dphi; 675 float high= low+dphi; 676 if(phi > low && phi < high ){ 677 iPhi = low; 678 break; 679 } 680 } 681 if (phi > PI-dphi) iPhi = PI-dphi; 682 } 683 684 611 685 //**************************** Returns the delta Phi **************************** 612 686 float DeltaPhi(const float phi1, const float phi2) {
Note:
See TracChangeset
for help on using the changeset viewer.