39 template <
class T>
class LHblock {
44 LHblock<T>() : idnow(0) {} ;
47 bool exists() {
return int(entry.size()) == 0 ?
false :
true ; };
49 void clear() { entry.clear(); };
56 int set(
int iIn,T valIn) {
57 int alreadyexisting=exists(iIn)?1:0;
59 return alreadyexisting;
62 int set(istringstream& linestream,
bool indexed=
true) {
64 if (indexed) linestream >> i >> val;
65 else linestream >> val;
66 return linestream ? set(i,val) : -1;
69 int set(
int iIn,istringstream& linestream) {
71 return linestream ? set(iIn,val) : -1;
74 void set(T valIn) { entry[0]=valIn; };
77 bool exists(
int iIn) {
return entry.find(iIn) != entry.end()
82 if (exists(0)) {
return entry[0];}
else {T dummy(0);
return dummy;};
84 T operator()(
int iIn) {
85 if (exists(iIn)) {
return entry[iIn];}
else {T dummy(0);
return dummy;};
89 int size() {
return int(entry.size());};
92 int first() { idnow = entry.begin()->first;
return idnow; };
94 typename map<int,T>::iterator itnow;
95 itnow = ++entry.find(idnow);
96 if ( itnow == entry.end() ) itnow=entry.begin();
97 return idnow = itnow->first;
106 cout <<
" "<< i <<
" " << entry[i] <<endl;
108 if (i == ibegin) finished=
true;
113 void setq(
double qIn) { qDRbar=qIn; }
114 double q() {
return qDRbar; }
128 class LHgenericBlock :
public LHblock<string> {
133 LHgenericBlock() { } ;
136 int set(
string lineIn) {
137 entry[entry.size()] = lineIn;
145 template <
int size>
class LHmatrixBlock {
148 LHmatrixBlock<size>() {
150 for (i=1;i<=size;i++) {
151 for (j=1;j<=size;j++) {
158 LHmatrixBlock& operator=(
const LHmatrixBlock& m) {
160 for (i=0;i<size;i++)
for (j=0;j<=size;j++) entry[i][j] = m(i,j);
162 initialized = m.initialized;
167 bool exists() {
return initialized; };
169 void clear() { initialized=
false; };
172 int set(
int iIn,
int jIn,
double valIn) {
173 if (iIn>0 && jIn>0 && iIn<=size && jIn<=size) {
174 entry[iIn][jIn]=valIn;
183 int set(istringstream& linestream) {
184 linestream >> i >> j >> val;
185 return linestream ? set(i,j,val) : -1;
189 double operator()(
int iIn,
int jIn)
const {
190 return (iIn <= size && jIn <= size && iIn > 0 && jIn > 0) ?
191 entry[iIn][jIn] : 0.0;
195 void setq(
double qIn) { qDRbar=qIn; }
196 double q() {
return qDRbar; }
200 for (i=1;i<=size;i++) {
201 cout <<
" "<<i <<
" " ;
202 for (j=1;j<=size;j++) cout << entry[i][j] <<
" ";
209 double entry[size+1][size+1];
218 template <
int size>
class LHtensor3Block {
221 LHtensor3Block<size>() {
223 for (i=1;i<=size;i++) {
224 for (j=1;j<=size;j++) {
225 for (k=1;k<=size;k++) {
233 LHtensor3Block& operator=(
const LHtensor3Block& m) {
235 for (i=0;i<size;i++)
for (j=0;j<=size;j++)
for (k=0;k<=size;k++)
236 entry[i][j][k] = m(i,j,k);
238 initialized = m.initialized;
243 bool exists() {
return initialized; };
245 void clear() { initialized=
false; };
248 int set(
int iIn,
int jIn,
int kIn,
double valIn) {
249 if (iIn>0 && jIn>0 && kIn>0 && iIn<=size && jIn<=size && kIn<=size) {
250 entry[iIn][jIn][kIn]=valIn;
259 int set(istringstream& linestream) {
260 linestream >> i >> j >> k >> val;
261 return linestream ? set(i,j,k,val) : -1;
265 double operator()(
int iIn,
int jIn,
int kIn)
const {
266 return (iIn <= size && jIn <= size && kIn <= size && iIn > 0
267 && jIn > 0 && kIn > 0) ? entry[iIn][jIn][kIn] : 0.0;
271 void setq(
double qIn) { qDRbar=qIn; }
272 double q() {
return qDRbar; }
276 for (i=1;i<=size;i++) {
277 for (j=1;j<=size;j++) {
278 cout <<
" "<<i <<
" "<<j <<
" " ;
279 for (k=1;k<=size;k++) {
280 cout << entry[i][j][k] <<
" ";
289 double entry[size+1][size+1][size+1];
298 class LHdecayChannel {
301 LHdecayChannel() : brat(0.0) {};
302 LHdecayChannel(
double bratIn,
int nDaIn, vector<int> idDaIn,
303 string cIn=
"") { setChannel(bratIn,nDaIn,idDaIn,cIn);
307 void setChannel(
double bratIn,
int nDaIn, vector<int> idDaIn,
310 for (
int i=0; i<=nDaIn; i++) {
311 if (i <
int(idDaIn.size())) idDa.push_back(idDaIn[i]);
315 void setBrat(
double bratIn) {brat=bratIn;}
316 void setIdDa(vector<int> idDaIn) {idDa = idDaIn;}
319 double getBrat() {
return brat;}
320 int getNDa() {
return int(idDa.size());}
321 vector<int> getIdDa() {
return idDa;}
322 string getComment() {
return comment;}
334 LHdecayTable() : id(0), width(0.0) {};
335 LHdecayTable(
int idIn) : id(idIn), width(0.0) {};
336 LHdecayTable(
int idIn,
double widthIn) : id(idIn), width(widthIn) {};
339 int getId() {
return id;}
340 double getWidth() {
return width;}
343 void setId(
int idIn) {
id = idIn;}
344 void setWidth(
double widthIn) {width=widthIn;}
347 void reset(
double widthIn=0.0) {table.resize(0); width=widthIn;}
350 void addChannel(LHdecayChannel channelIn) {table.push_back(channelIn);}
351 void addChannel(
double bratIn,
int nDaIn, vector<int> idDaIn,
353 LHdecayChannel newChannel(bratIn, nDaIn, idDaIn, cIn);
354 table.push_back(newChannel);
358 int size() {
return int(table.size());}
361 double getBrat(
int iChannel) {
362 if (iChannel >= 0 && iChannel <
int(table.size())) {
363 return table[iChannel].getBrat();
369 vector<int> getIdDa(
int iChannel) {
370 if (iChannel >= 0 && iChannel <
int(table.size())) {
371 return table[iChannel].getIdDa();
378 LHdecayChannel getChannel(
int iChannel) {
379 if (iChannel >= 0 && iChannel <
int(table.size())) {
380 return table[iChannel];
390 vector<LHdecayChannel> table;
396 class SusyLesHouches {
401 SusyLesHouches(
int verboseIn=1) : verboseSav(verboseIn),
402 headerPrinted(false), footerPrinted(false), filePrinted(false),
403 slhaRead(false), lhefRead(false), lhefSlha(false), useDecay(true) {};
404 SusyLesHouches(
string filename,
int verboseIn=1) : verboseSav(verboseIn),
405 headerPrinted(false), footerPrinted(false), filePrinted(false),
406 slhaRead(true), lhefRead(false), lhefSlha(false), useDecay(true)
407 {readFile(filename);};
411 int readFile(
string slhaFileIn=
"slha.spc",
int verboseIn=1,
412 bool useDecayIn=
true);
418 void printSpectrum(
int ifail=0);
432 Entry() : isIntP(false), isDoubleP(false),
433 isStringP(false), n(0), d(0.0), s(
""), commentP(
"") {}
436 bool isInt(){
return isIntP;}
437 bool isDouble(){
return isDoubleP;}
438 bool isString(){
return isStringP;}
441 Entry& operator=(
double& val) {
442 d=val;isIntP=
false;isDoubleP=
true;isStringP=
false;
445 Entry& operator=(
int& val) {
446 n=val;isIntP=
true;isDoubleP=
false;isStringP=
false;
449 Entry& operator=(
string& val) {
450 s=val;isIntP=
false;isDoubleP=
false;isStringP=
true;
455 void setComment(
string comment) {commentP=comment;}
456 void getComment(
string comment) {comment=commentP;}
459 bool get(
int& val) {val=n;
return isIntP;}
460 bool get(
double& val) {val=d;
return isDoubleP;}
461 bool get(
string& val) {val=s;
return isStringP;}
464 bool isIntP, isDoubleP, isStringP;
475 LHblock<int> modsel21;
476 LHblock<double> modsel12;
477 LHblock<double> minpar;
478 LHblock<double> extpar;
479 LHblock<double> sminputs;
481 LHblock<string> spinfo;
482 LHblock<string> spinfo3;
483 LHblock<string> spinfo4;
485 LHblock<string> dcinfo;
486 LHblock<string> dcinfo3;
487 LHblock<string> dcinfo4;
489 LHblock<double> mass;
490 LHmatrixBlock<4> nmix;
491 LHmatrixBlock<2> umix;
492 LHmatrixBlock<2> vmix;
493 LHmatrixBlock<2> stopmix;
494 LHmatrixBlock<2> sbotmix;
495 LHmatrixBlock<2> staumix;
496 LHblock<double> alpha;
497 LHblock<double> hmix;
498 LHblock<double> gauge;
499 LHblock<double> msoft;
508 vector<LHdecayTable> decays;
509 map<int,int> decayIndices;
512 vector< LHblock<int> > qnumbers;
513 vector< string > qnumbersName;
514 vector< string > qnumbersAntiName;
518 LHblock<double> qextpar;
521 LHblock<double> vckmin;
522 LHblock<double> upmnsin;
523 LHmatrixBlock<3> msq2in;
524 LHmatrixBlock<3> msu2in;
525 LHmatrixBlock<3> msd2in;
526 LHmatrixBlock<3> msl2in;
527 LHmatrixBlock<3> mse2in;
528 LHmatrixBlock<3> tuin;
529 LHmatrixBlock<3> tdin;
530 LHmatrixBlock<3> tein;
532 LHmatrixBlock<3> vckm;
533 LHmatrixBlock<3> upmns;
534 LHmatrixBlock<3> msq2;
535 LHmatrixBlock<3> msu2;
536 LHmatrixBlock<3> msd2;
537 LHmatrixBlock<3> msl2;
538 LHmatrixBlock<3> mse2;
542 LHmatrixBlock<6> usqmix;
543 LHmatrixBlock<6> dsqmix;
544 LHmatrixBlock<6> selmix;
545 LHmatrixBlock<3> snumix;
546 LHmatrixBlock<3> snsmix;
547 LHmatrixBlock<3> snamix;
550 LHtensor3Block<3> rvlamllein;
551 LHtensor3Block<3> rvlamlqdin;
552 LHtensor3Block<3> rvlamuddin;
553 LHtensor3Block<3> rvtllein;
554 LHtensor3Block<3> rvtlqdin;
555 LHtensor3Block<3> rvtuddin;
556 LHblock<double> rvkappain;
557 LHblock<double> rvdin;
558 LHblock<double> rvm2lh1in;
559 LHblock<double> rvsnvevin;
561 LHtensor3Block<3> rvlamlle;
562 LHtensor3Block<3> rvlamlqd;
563 LHtensor3Block<3> rvlamudd;
564 LHtensor3Block<3> rvtlle;
565 LHtensor3Block<3> rvtlqd;
566 LHtensor3Block<3> rvtudd;
567 LHblock<double> rvkappa;
569 LHblock<double> rvm2lh1;
570 LHblock<double> rvsnvev;
571 LHmatrixBlock<7> rvnmix;
572 LHmatrixBlock<5> rvumix;
573 LHmatrixBlock<5> rvvmix;
574 LHmatrixBlock<5> rvhmix;
575 LHmatrixBlock<5> rvamix;
576 LHmatrixBlock<8> rvlmix;
579 LHblock<double> imminpar;
580 LHblock<double> imextpar;
582 LHmatrixBlock<4> cvhmix;
583 LHmatrixBlock<4> imcvhmix;
584 LHmatrixBlock<3> imau,imad,imae;
585 LHblock<double> imhmix;
586 LHblock<double> immsoft;
589 LHmatrixBlock<3> immsq2in;
590 LHmatrixBlock<3> immsu2in;
591 LHmatrixBlock<3> immsd2in;
592 LHmatrixBlock<3> immsl2in;
593 LHmatrixBlock<3> immse2in;
594 LHmatrixBlock<3> imtuin,imtdin,imtein;
596 LHmatrixBlock<3> imvckm;
597 LHmatrixBlock<3> imupmns;
598 LHmatrixBlock<3> immsq2;
599 LHmatrixBlock<3> immsu2;
600 LHmatrixBlock<3> immsd2;
601 LHmatrixBlock<3> immsl2;
602 LHmatrixBlock<3> immse2;
603 LHmatrixBlock<3> imtu,imtd,imte;
604 LHmatrixBlock<6> imusqmix;
605 LHmatrixBlock<6> imdsqmix;
606 LHmatrixBlock<6> imselmix;
607 LHmatrixBlock<3> imsnumix;
608 LHmatrixBlock<4> imnmix;
609 LHmatrixBlock<4> imumix;
610 LHmatrixBlock<4> imvmix;
615 LHblock<double> nmssmrun;
616 LHmatrixBlock<3> nmhmix;
617 LHmatrixBlock<3> nmamix;
618 LHmatrixBlock<5> nmnmix;
619 LHmatrixBlock<5> imnmnmix;
622 template <
class T>
int set(
string,T);
623 template <
class T>
int set(
string,
int,T);
624 template <
class T>
int set(
string,
int,
int,T);
625 template <
class T>
int set(
string,
int,
int,
int,T);
632 map<string, LHgenericBlock> genericBlocks;
633 template <
class T>
bool getEntry(
string, T&);
634 template <
class T>
bool getEntry(
string,
int, T&);
635 template <
class T>
bool getEntry(
string,
int,
int, T&);
636 template <
class T>
bool getEntry(
string,
int,
int,
int, T&);
637 template <
class T>
bool getEntry(
string, vector<int>, T&);
640 int verbose() {
return verboseSav;}
641 void verbose(
double verboseIn) {verboseSav = verboseIn;}
644 void message(
int,
string,
string ,
int line=0);
650 bool headerPrinted, footerPrinted, filePrinted;
651 bool slhaRead, lhefRead, lhefSlha, useDecay;
659 template <
class T>
int SusyLesHouches::set(
string blockName, T val) {
662 for (
int iC=0; iC<int(blockName.size()); ++iC)
663 blockName[iC] = tolower(blockName[iC]);
666 if (genericBlocks.find(blockName) == genericBlocks.end()) {
667 LHgenericBlock gBlock;
668 genericBlocks[blockName]=gBlock;
672 ostringstream lineStream;
674 return genericBlocks[blockName].set(lineStream.str());
678 template <
class T>
int SusyLesHouches::set(
string blockName,
int indx, T val) {
681 for (
int iC=0; iC<int(blockName.size()); ++iC)
682 blockName[iC] = tolower(blockName[iC]);
685 if (genericBlocks.find(blockName) == genericBlocks.end()) {
686 LHgenericBlock gBlock;
687 genericBlocks[blockName]=gBlock;
691 ostringstream lineStream;
692 lineStream << indx<<
" "<<val;
693 return genericBlocks[blockName].set(lineStream.str());
697 template <
class T>
int SusyLesHouches::set(
string blockName,
int indx,
701 for (
int iC=0; iC<int(blockName.size()); ++iC)
702 blockName[iC] = tolower(blockName[iC]);
705 if (genericBlocks.find(blockName) == genericBlocks.end()) {
706 LHgenericBlock gBlock;
707 genericBlocks[blockName]=gBlock;
711 ostringstream lineStream;
712 lineStream << indx<<
" "<<jndx<<
" "<<val;
713 return genericBlocks[blockName].set(lineStream.str());
717 template <
class T>
int SusyLesHouches::set(
string blockName,
int indx,
718 int jndx,
int kndx, T val) {
721 for (
int iC=0; iC<int(blockName.size()); ++iC)
722 blockName[iC] = tolower(blockName[iC]);
725 if (genericBlocks.find(blockName) == genericBlocks.end()) {
726 LHgenericBlock gBlock;
727 genericBlocks[blockName]=gBlock;
731 ostringstream lineStream;
732 lineStream << indx<<
" "<<jndx<<
" "<<kndx<<
" "<<val;
733 return genericBlocks[blockName].set(lineStream.str());
739 template <
class T>
bool SusyLesHouches::getEntry(
string blockName, T& val) {
742 for (
int iC=0; iC<int(blockName.size()); ++iC)
743 blockName[iC] = tolower(blockName[iC]);
746 if (genericBlocks.find(blockName) == genericBlocks.end()) {
747 message(1,
"getEntry",
"attempting to extract entry from non-existent block "
751 if (genericBlocks[blockName].size() == 0) {
752 message(1,
"getEntry",
"attempting to extract entry from zero-size block "
756 if (genericBlocks[blockName].size() >= 2) {
757 message(1,
"getEntry",
"attempting to extract un-indexed entry "
758 "from multi-entry block "+blockName);
762 LHgenericBlock block = genericBlocks[blockName];
763 istringstream linestream(block(0));
766 message(1,
"getEntry",
"problem extracting un-indexed entry "
767 "from block "+blockName);
775 template <
class T>
bool SusyLesHouches::getEntry(
string blockName,
int indx,
779 for (
int iC=0; iC<int(blockName.size()); ++iC)
780 blockName[iC] = tolower(blockName[iC]);
783 if (genericBlocks.find(blockName) == genericBlocks.end()) {
784 message(1,
"getEntry",
"attempting to extract entry from non-existent block "
788 if (genericBlocks[blockName].size() == 0) {
789 message(1,
"getEntry",
"attempting to extract entry from zero-size block "
794 LHgenericBlock block = genericBlocks[blockName];
796 for (
int jEntry = 0; jEntry < block.size(); jEntry++) {
797 istringstream linestream(block(jEntry));
801 linestream >> indxNow >> valNow;
803 if (linestream && indxNow == indx) {
809 message(1,
"getEntry",
"problem extracting indexed entry from block "
814 template <
class T>
bool SusyLesHouches::getEntry(
string blockName,
int indx,
818 for (
int iC=0; iC<int(blockName.size()); ++iC)
819 blockName[iC] = tolower(blockName[iC]);
822 if (genericBlocks.find(blockName) == genericBlocks.end()) {
823 message(1,
"getEntry",
"attempting to extract entry from non-existent block "
827 if (genericBlocks[blockName].size() == 0) {
828 message(1,
"getEntry",
"attempting to extract entry from zero-size block "
833 LHgenericBlock block = genericBlocks[blockName];
835 for (
int jEntry = 0; jEntry < block.size(); jEntry++) {
836 istringstream linestream(block(jEntry));
838 int indxNow, jndxNow;
840 linestream >> indxNow >> jndxNow >> valNow;
842 if (linestream && indxNow == indx && jndxNow == jndx) {
848 message(1,
"getEntry",
"problem extracting matrix-indexed entry from block "
853 template <
class T>
bool SusyLesHouches::getEntry(
string blockName,
int indx,
854 int jndx,
int kndx, T& val) {
857 for (
int iC=0; iC<int(blockName.size()); ++iC)
858 blockName[iC] = tolower(blockName[iC]);
861 if (genericBlocks.find(blockName) == genericBlocks.end()) {
862 message(1,
"getEntry",
"attempting to extract entry from non-existent block "
866 if (genericBlocks[blockName].size() == 0) {
867 message(1,
"getEntry",
"attempting to extract entry from zero-size block "
872 LHgenericBlock block = genericBlocks[blockName];
874 for (
int jEntry = 0; jEntry < block.size(); jEntry++) {
875 istringstream linestream(block(jEntry));
877 int indxNow, jndxNow, kndxNow;
879 linestream >> indxNow >> jndxNow >> kndxNow >> valNow;
881 if (linestream && indxNow == indx && jndxNow == jndx && kndxNow == kndx) {
887 message(1,
"getEntry",
"problem extracting tensor-indexed entry from block "
void ae(int tracks=-1, int hits=-1)
This function is to search for the next non-empty event and draw it by looping over StBFChain (readin...