-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
109 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,30 +6,18 @@ | |
|
||
#include<iostream> | ||
|
||
//#define DebugLog | ||
//#define mkodebug | ||
|
||
int HFFibreFiducial::PMTNumber(const G4ThreeVector& pe_effect) | ||
{ | ||
#ifdef mkodebug | ||
static double mX=0.; | ||
static double mY=0.; | ||
static double mZ=0.; | ||
#endif | ||
double xv = pe_effect.x(); // X in global system | ||
double yv = pe_effect.y(); // Y in global system | ||
#ifdef DebugLog | ||
double zv = pe_effect.z(); // Z in global system | ||
#endif | ||
double phi = atan2(yv, xv); // In global system | ||
if (phi < 0.) phi+=CLHEP::pi; // Just for security | ||
double dph = CLHEP::pi/18; // 10 deg = a half sector width | ||
double sph = dph+dph; // 20 deg = a sector width | ||
int nphi = phi/dph; // 10 deg sector # | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") <<"HFFibreFiducial:***> P = " << pe_effect | ||
<< ", phi = " << phi/CLHEP::deg; | ||
#endif | ||
if (nphi > 35) nphi=35; // Just for security | ||
double xl=0.; // local sector coordinates (left/right) | ||
double yl=0.; // local sector coordinates (down/up) | ||
|
@@ -58,16 +46,12 @@ int HFFibreFiducial::PMTNumber(const G4ThreeVector& pe_effect) | |
double sinr= sin(phir); | ||
yl= xv*cosr+yv*sinr; | ||
xl= yv*cosr-xv*sinr; | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") << "HFFibreFiducial: nr " << nr << " phi " << phir/CLHEP::deg; | ||
#endif | ||
} | ||
if (yl < 0) yl =-yl; | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") << "HFFibreFiducial: Global Point " << pe_effect | ||
<< " nphi " << nphi << " Local Sector Coordinates (" | ||
<< xl << ", " << yl << "), widget # " << nwid; | ||
#endif | ||
// Provides a PMT # for the (x,y) hit in the widget # nwid (M. Kosov, 11.2010) | ||
// Send comments/questions to [email protected] | ||
// nwid = 1-18 for Forward HF, 19-36 for Backward HF (all equal now) | ||
|
@@ -76,24 +60,20 @@ int HFFibreFiducial::PMTNumber(const G4ThreeVector& pe_effect) | |
static const int nWidM=36; | ||
if (nwid > nWidM || nwid <= 0) | ||
{ | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") << "-Warning-HFFibreFiducial::PMTNumber: " | ||
<< nwid << " == wrong widget number"; | ||
#endif | ||
return 0; | ||
} | ||
static const double yMin= 13.1*CLHEP::cm; // start of the active area (Conv to mm?) | ||
static const double yMax=129.6*CLHEP::cm; // finish of the active area (Conv to mm?) | ||
if( yl < yMin || yl >= yMax ) | ||
{ | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") << "-Warning-HFFibreFiducial::PMTNumber: Point " | ||
<< "with y = " << yl << " outside acceptance [" | ||
<< yMin << ":" << yMax << "], X = " << xv | ||
<< ", Y = " << yv << ", x = " << xl << ", nW = " | ||
<< nwid << ", phi = " << phi/CLHEP::deg | ||
<< ", phir = " << phir/CLHEP::deg; | ||
#endif | ||
return 0; // ===> out of the acceptance | ||
} | ||
bool left=true; // flag of the left part of the widget | ||
|
@@ -106,11 +86,9 @@ int HFFibreFiducial::PMTNumber(const G4ThreeVector& pe_effect) | |
static const double tg10=.17632698070847; // phi-angular acceptance of the widget | ||
if (r > tg10) | ||
{ | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") << "-Warning-HFFibreFiducial::PMTNumber: (x = " | ||
<< xl << ", y = " << yl << ", tg = " << r | ||
<< ") out of the widget acceptance tg(10) " << tg10; | ||
#endif | ||
return 0; | ||
} | ||
|
||
|
@@ -1534,27 +1512,11 @@ int HFFibreFiducial::PMTNumber(const G4ThreeVector& pe_effect) | |
int ny=static_cast<int>((yl-yMin)/cellSize); // Layer number (starting from 0) | ||
if (ny < 0 || ny >= nLay) // Sould never happen as was checked beforehand | ||
{ | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") << "-Warning-HFFibreFiducial::PMTNumber: " | ||
<< "check limits y = " << yl << ", nL=" << nLay; | ||
#endif | ||
return 0; | ||
} | ||
int nx=static_cast<int>(fx); // Cell number (starting from 0) | ||
#ifdef mkodebug | ||
double phist=atan2(xl, yl)/CLHEP::deg; | ||
if(sqr(mX-xv)+sqr(mY-yv)+sqr(mZ-zv) > 9.) | ||
{ | ||
std::cout<<"HFFibreFiducial::PMTNumber:X="<<xv<<",Y="<<yv<<",Z="<<zv<<",fX="<<fx | ||
<<"->nX="<<nx<<",nY="<<ny<<",mX="<<nSL[ny]<<",x="<<xl<<",y="<<yl<<",s=" | ||
<<cellSize<<",nW="<<nwid<<",phi="<<phi/CLHEP::deg<<",phist="<<phist | ||
<<",phir="<<phir/CLHEP::deg<<std::endl; | ||
mX=xv; | ||
mY=yv; | ||
mZ=zv; | ||
} | ||
#endif | ||
#ifdef DebugLog | ||
double phis=atan2(xl, yl)/CLHEP::deg; | ||
edm::LogInfo("HFShower") << "HFFibreFiducial::PMTNumber:X = " << xv | ||
<< ", Y = " << yv << ", Z = " << zv << ", fX = " | ||
|
@@ -1564,13 +1526,10 @@ int HFFibreFiducial::PMTNumber(const G4ThreeVector& pe_effect) | |
<< nwid << ", phi = " << phi/CLHEP::deg | ||
<< ", phis = " << phis << ", phir = " | ||
<< phir/CLHEP::deg; | ||
#endif | ||
if (nx >= nSL[ny]) | ||
{ | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") << "-Warning-HFFibreFiducial::nx/ny (" << nx | ||
<< "," << ny <<") " << " above limit " << nSL[ny]; | ||
#endif | ||
return 0; // ===> out of the acceptance | ||
} | ||
int code=0; // a prototype | ||
|
@@ -1579,21 +1538,16 @@ int HFFibreFiducial::PMTNumber(const G4ThreeVector& pe_effect) | |
int flag= code%10; | ||
int npmt= code/10; | ||
bool src= false; // by default: not a source-tube | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") << "HFFibreFiducial::nx/ny (" << nx << "," | ||
<< ny << ") code/flag/npmt " << code << "/" << flag | ||
<< "/" << npmt; | ||
#endif | ||
if (!flag) return 0; // ===> no fiber in the cell | ||
else if (flag==1) npmt += 24; | ||
else if (flag==3 || flag==4) { | ||
flag-=2; | ||
src=true; | ||
} | ||
#ifdef DebugLog | ||
edm::LogInfo("HFShower") << "HFFibreFiducial::PMTNumber: src = " << src | ||
<< ", npmt =" << npmt; | ||
#endif | ||
if (src) return -npmt; // return the negative number for the source | ||
if (src) return -npmt; // return the negative number for the source | ||
return npmt; | ||
} // End of PMTNumber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.