Changeset 423 in svn
- Timestamp:
- Jun 3, 2009, 2:17:37 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG
r418 r423 3 3 - Nevents implemented in DetectorCards 4 4 - bug removed in bad inputfile type identification (".hep" vs ".lhe") 5 - BinEtaPhi : now use the middle of the tower and not its lower edge in eta and in phi 5 6 /-----------------------------------------\ 6 7 | 22 May 2009: release Version1.7 | -
trunk/src/SmearUtil.cc
r422 r423 1322 1322 1323 1323 //********** returns a segmented value for eta and phi, for calo towers ***** 1324 /* 1324 1325 void RESOLution::BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta){ 1325 1326 iEta = UNDEFINED; 1326 1327 int index= iUNDEFINED; 1327 1328 for (unsigned int i=1; i< TOWER_number+1; i++) { 1328 if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) { 1329 iEta = (eta>0) ? TOWER_eta_edges[i-1] : -TOWER_eta_edges[i]; 1329 if(fabs(eta)>=TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) { 1330 //if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) { 1331 float deta = TOWER_eta_edges[i] - TOWER_eta_edges[i-1]; 1332 // iEta = (eta>0) ? TOWER_eta_edges[i-1] : -TOWER_eta_edges[i]; 1333 iEta + deta/2.; // update Delphes > 1.7 1330 1334 index = i-1; 1331 1335 break; … … 1338 1342 float low = -pi+(i-1)*dphi; 1339 1343 float high= low+dphi; 1340 if(phi > low && phi < high ){ 1341 iPhi = low; 1344 if(phi >= low && phi < high ){ 1345 //if(phi > low && phi < high ){ 1346 //iPhi = low; 1347 iPhi = low+dphi/2.; // update Delphes > 1.7 1342 1348 break; 1343 1349 } … … 1345 1351 if (phi > pi-dphi) iPhi = pi-dphi; 1346 1352 } 1347 1348 1353 */ 1354 void RESOLution::BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta){ 1355 iEta = UNDEFINED; 1356 int index= iUNDEFINED; 1357 for (unsigned int i=1; i< TOWER_number+1; i++) { 1358 if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<=TOWER_eta_edges[i]) { 1359 iEta = (eta>0) ? ((TOWER_eta_edges[i-1]+TOWER_eta_edges[i])/2.0) : -((TOWER_eta_edges[i-1]+TOWER_eta_edges[i])/2.0); 1360 index = i-1; 1361 break; 1362 } 1363 } 1364 if(index==UNDEFINED) return; 1365 iPhi = UNDEFINED; 1366 float dphi = TOWER_dphi[index]*pi/180.; 1367 for (unsigned int i=1; i < 360/TOWER_dphi[index]; i++ ) { 1368 float low = -pi+(i-1)*dphi; 1369 float high= low+dphi; 1370 if(phi > low && phi <= high ){ 1371 iPhi = (low+high)/2.0; 1372 break; 1373 } 1374 } 1375 if (phi > pi-dphi) iPhi = pi-dphi; 1376 } 1349 1377 1350 1378 //**************************** Returns the delta Phi ****************************
Note:
See TracChangeset
for help on using the changeset viewer.