Warning, /PhysicsTools/PythonAnalysis/scripts/edmMakePhDThesis is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env python3
0002 import sys, time, random
0003
0004 ### a list of various titels. the actual one is picked randomly
0005 titles = ("SuSy exclusion limits with pp collisions at 14 TeV",
0006 "First Observation of an Unparticle at 666 GeV",
0007 "FCNC with CMS at LHC via ABRV XTC",
0008 "Rediscovery of the Top Quark with CMS at 210 GeV",
0009 "From Aleph to CMS - Discovery of SM Higgs at 116.4 GeV",
0010 "Dead read-out channel studies with heavy-ion collisions at the LHC",
0011 )
0012
0013
0014 ### To be displayed messages at the beginning of the job
0015 initialMessages = """Preparing table of contents...
0016 Preparing introduction...
0017 Preparing theory chapter...
0018 Preparing detector chapter...
0019 """
0020
0021 ### definition of a stack trace
0022 # better ideas are welcome
0023 # took root stack trace because that one is easy to get
0024 stackTrace = """*** Break *** segmentation violation
0025 (no debugging symbols found)
0026 Using host libthread_db library "/lib/tls/libthread_db.so.1".
0027 Attaching to program: /proc/6594/exe, process 6594
0028 (no debugging symbols found)...done.
0029 (no debugging symbols found)...done.
0030 [Thread debugging using libthread_db enabled]
0031 [New Thread -1208949056 (LWP 6594)]
0032 0x006ba7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
0033 #1 0x0177e473 in __waitpid_nocancel () from /lib/tls/libc.so.6
0034 #2 0x01728359 in do_system () from /lib/tls/libc.so.6
0035 #3 0x016ed78d in system () from /lib/tls/libpthread.so.0
0036 #4 0x00992df5 in TUnixSystem::Exec ()
0037 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0038 #5 0x009932b9 in TUnixSystem::StackTrace ()
0039 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0040 #6 0x00991064 in TUnixSystem::DispatchSignals ()
0041 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0042 #7 0x0098ee64 in SigHandler ()
0043 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0044 #8 0x00995c6c in sighandler ()
0045 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0046 #9 <signal handler called>
0047 #10 0x0175d2cb in strlen () from /lib/tls/libc.so.6
0048 #11 0x01731235 in vfprintf () from /lib/tls/libc.so.6
0049 #12 0x0174942b in vsprintf () from /lib/tls/libc.so.6
0050 #13 0x0173666b in sprintf () from /lib/tls/libc.so.6
0051 #14 0x0029dde5 in G__type2string ()
0052 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0053 #15 0x001d03c1 in Cint::G__TypeInfo::Name ()
0054 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0055 #16 0x008e5996 in TCint::UpdateListOfTypes ()
0056 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0057 #17 0x0087bebd in TROOT::GetListOfTypes ()
0058 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0059 #18 0x0087b0df in TROOT::GetType ()
0060 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0061 #19 0x0087a4ed in TROOT::GetClass ()
0062 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0063 #20 0x0087c01a in TROOT::IgnoreInclude ()
0064 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0065 #21 0x008e3a92 in IgnoreInclude ()
0066 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0067 #22 0x00232137 in G__loadfile ()
0068 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0069 #23 0x00284595 in G__loadsystemfile ()
0070 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0071 #24 0x008e4bd5 in TCint::Load ()
0072 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0073 #25 0x008960b1 in TSystem::Load ()
0074 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0075 #26 0x00993f99 in TUnixSystem::Load ()
0076 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0077 #27 0x0087cc70 in TROOT::LoadClass ()
0078 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0079 #28 0x008e8b27 in TCint::AutoLoadCallback ()
0080 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0081 #29 0x008e3b4c in TCint_AutoLoadCallback ()
0082 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0083 #30 0x03e8a313 in edm::ALL_AutoLoadCallback ()
0084
0085 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/cms/cmssw/CMSSW_1_6_8/lib/slc4_ia32_gcc345/libFWCoreRootAutoLibraryLoader.so
0086 #31 0x0028bff0 in G__class_autoloading ()
0087 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0088 #32 0x0028c538 in G__defined_tagname ()
0089 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0090 #33 0x0021aad5 in G__make_ifunctable ()
0091 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0092 #34 0x0026141d in G__exec_statement ()
0093 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0094 #35 0x0028eab1 in G__define_struct ()
0095 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0096 #36 0x0025f883 in G__exec_statement ()
0097 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0098 #37 0x002963b4 in G__replacetemplate ()
0099 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0100 #38 0x00295205 in G__instantiate_templateclass ()
0101 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0102 #39 0x0028c77b in G__defined_tagname ()
0103 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0104 #40 0x0029401b in G__templatemaptypename ()
0105 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0106 #41 0x002944ca in G__gettemplatearglist ()
0107 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0108 #42 0x00294ea2 in G__instantiate_templateclass ()
0109 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0110 #43 0x0028c77b in G__defined_tagname ()
0111 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0112 #44 0x0029bdbd in G__defined_type ()
0113 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0114 #45 0x00260b0e in G__exec_statement ()
0115 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0116 #46 0x0025c4f5 in G__exec_loop ()
0117 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0118 #47 0x0025ceee in G__exec_for ()
0119 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0120 #48 0x00261c0c in G__exec_statement ()
0121 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0122 #49 0x001d51f1 in G__exec_tempfile_core ()
0123 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0124 #50 0x001d54fb in G__exec_tempfile ()
0125 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0126 #51 0x0026baaa in G__process_cmd ()
0127 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCint.so
0128 #52 0x008e4de3 in TCint::ProcessLine ()
0129 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0130 #53 0x008e4f7d in TCint::ProcessLineSynch ()
0131 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0132 #54 0x00806fc0 in TApplication::ProcessFile ()
0133 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0134 #55 0x00806824 in TApplication::ProcessLine ()
0135 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0136 #56 0x053a8054 in TRint::HandleTermInput ()
0137 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libRint.so
0138 #57 0x053a65bb in TTermInputHandler::Notify ()
0139 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libRint.so
0140 #58 0x053a850e in TTermInputHandler::ReadNotify ()
0141 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libRint.so
0142 #59 0x009914f5 in TUnixSystem::CheckDescriptors ()
0143 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0144 #60 0x0099022e in TUnixSystem::DispatchOneEvent ()
0145 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0146 #61 0x00892c9c in TSystem::InnerLoop ()
0147 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0148 #62 0x00892c35 in TSystem::Run ()
0149 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0150 #63 0x00807119 in TApplication::Run ()
0151 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libCore.so
0152 #64 0x053a79c0 in TRint::Run ()
0153 from /afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.14.00f-CMS3q//lib/libRint.so
0154 #65 0x08048d81 in main ()
0155 """
0156
0157 ### show rotating symbol, since non working software should at least look fancy
0158 def printRotor(number, end=" \n"):
0159 rotor = "-\|/"
0160 sys.stdout.write(" ")
0161 for i in range(number):
0162 for symbol in rotor:
0163 sys.stdout.write(symbol)
0164 sys.stdout.flush()
0165 time.sleep(0.1)
0166 sys.stdout.write("\b")
0167 sys.stdout.write(end)
0168 sys.stdout.flush()
0169
0170
0171 # got it? we are writing crap ;-)
0172 def printSingleLine(line,number, end = " "):
0173 print line.ljust(40),
0174 printRotor(number,end = end)
0175
0176
0177 ###########################
0178 # Main part of the crap #
0179 ###########################
0180 if __name__ == "__main__":
0181
0182 title = titles[int(random.random()*len(titles))]
0183
0184 print "Searching for topic... ",
0185 printRotor(6)
0186 print "\nProposing: ",title,"\n"
0187
0188 time.sleep(2)
0189 for line in initialMessages.splitlines():
0190 printSingleLine(line, 2, end="DONE\n")
0191
0192 printSingleLine("Preparing analysis chapter...", 2, end= " \n")
0193
0194 # and now let the poor user read tons of stupid output
0195 try:
0196 for i in xrange(10):
0197 for line in stackTrace.splitlines():
0198 print line
0199 time.sleep(0.01)
0200 except KeyboardInterrupt:
0201 print "\nAh! Smart enough to find the way out of the procedure. ;-)"
0202 print "That was saving you from another",int((10-i)*131*0.01),"seconds of silly output."
0203