33 if (
output ==
"stubpairout") {
39 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find output : " <<
output;
47 if (
input ==
"innervmstubin") {
54 if (
input ==
"outervmstubin") {
61 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" Could not find input : " <<
input;
68 unsigned int countall = 0;
69 unsigned int countpass = 0;
78 unsigned int nbits = 7;
82 int rzbinfirst = lookupbits.
bits(0, 3);
91 for (
int ibin =
start; ibin <=
last; ibin++) {
106 int ir = ((ibin & 3) << 1) + (rzbin >> 2);
112 if ((rzbin < rzbinfirst) || (rzbin - rzbinfirst > rzdiffmax)) {
124 edm::LogVerbatim(
"Tracklet") <<
"Stub pair rejected because of stub pt cut bends : "
157 int outerrbins = (1 << outerrbits);
161 double innerphimin, innerphimax;
164 double outerphimin, outerphimax;
171 unsigned int nbendbitsinner = 3;
172 unsigned int nbendbitsouter = 3;
181 std::vector<bool> vmbendinner((1 << nbendbitsinner),
false);
182 std::vector<bool> vmbendouter((1 << nbendbitsouter),
false);
184 for (
int iphiinnerbin = 0; iphiinnerbin < innerphibins; iphiinnerbin++) {
185 phiinner[0] = innerphimin + iphiinnerbin * (innerphimax - innerphimin) / innerphibins;
186 phiinner[1] = innerphimin + (iphiinnerbin + 1) * (innerphimax - innerphimin) / innerphibins;
187 for (
int iphiouterbin = 0; iphiouterbin < outerphibins; iphiouterbin++) {
188 phiouter[0] = outerphimin + iphiouterbin * (outerphimax - outerphimin) / outerphibins;
189 phiouter[1] = outerphimin + (iphiouterbin + 1) * (outerphimax - outerphimin) / outerphibins;
190 for (
int irouterbin = 0; irouterbin < outerrbins; irouterbin++) {
201 double bendinnermin = 20.0;
202 double bendinnermax = -20.0;
203 double bendoutermin = 20.0;
204 double bendoutermax = -20.0;
205 double rinvmin = 1.0;
206 for (
int i1 = 0;
i1 < 2;
i1++) {
207 for (
int i2 = 0;
i2 < 2;
i2++) {
208 for (
int i3 = 0;
i3 < 2;
i3++) {
215 double rinv1 =
rinv(phiinner[
i1], phiouter[
i2], rinner, router[
i3]);
220 double abendinner = -
bend(rinner, rinv1, pitchinner);
221 double abendouter = -
bend(router[
i3], rinv1, pitchouter);
222 if (abendinner < bendinnermin)
223 bendinnermin = abendinner;
224 if (abendinner > bendinnermax)
225 bendinnermax = abendinner;
226 if (abendouter < bendoutermin)
227 bendoutermin = abendouter;
228 if (abendouter > bendoutermax)
229 bendoutermax = abendouter;
239 for (
int ibend = 0; ibend < (1 << nbendbitsinner); ibend++) {
245 vmbendinner[ibend] =
true;
249 for (
int ibend = 0; ibend < (1 << nbendbitsouter); ibend++) {
255 vmbendouter[ibend] =
true;
273 throw cms::Exception(
"BadDir") << __FILE__ <<
" " << __LINE__ <<
" could not create directory "
278 ofstream outstubptinnercut(fnameI);
279 if (outstubptinnercut.fail())
280 throw cms::Exception(
"BadFile") << __FILE__ <<
" " << __LINE__ <<
" could not create file " << fnameI;
282 outstubptinnercut <<
"{" << endl;
285 outstubptinnercut <<
"," << endl;
288 outstubptinnercut << endl <<
"};" << endl;
289 outstubptinnercut.close();
292 ofstream outstubptoutercut(fnameO);
293 if (outstubptoutercut.fail())
294 throw cms::Exception(
"BadFile") << __FILE__ <<
" " << __LINE__ <<
" could not create file " << fnameI;
296 outstubptoutercut <<
"{" << endl;
299 outstubptoutercut <<
"," << endl;
302 outstubptoutercut << endl <<
"};" << endl;
303 outstubptoutercut.close();