ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/doc/make_doc.C
Revision: 1.6
Committed: Mon Jul 20 04:57:02 2009 UTC (15 years, 9 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.5: +18 -7 lines
Log Message:
Fix to get link to 522

File Contents

# User Rev Content
1 loizides 1.6 // $Id: make_doc.C,v 1.5 2009/07/17 10:47:04 loizides Exp $
2 loizides 1.1
3     #if !defined(__CINT__) || defined(__MAKECINT__)
4     #include <iostream>
5     #include <fstream>
6     #include <TError.h>
7     #include <THashList.h>
8     #include <THtml.h>
9     #include <TList.h>
10     #include <TNamed.h>
11     #include <TRegexp.h>
12     #include <TROOT.h>
13     #include <TSystem.h>
14     #include <TDirectory.h>
15     #include <TString.h>
16     #include <TPRegexp.h>
17     #include <TObjArray.h>
18     #include <TObjString.h>
19     #include <TEnv.h>
20     #include <THtml.h>
21 loizides 1.6 #include <TDocInfo.h>
22 loizides 1.1 #endif
23    
24     class MyHtml : public THtml
25     {
26     public:
27 loizides 1.5 class MyModDef: public TModuleDefinition {
28     public:
29     bool GetModule(TClass* cl, TString& out_modulename) const {
30     TString cn(cl->GetName());
31 loizides 1.6 if (!cn.BeginsWith("mithep") && !cn.BeginsWith("TAM")) {
32 loizides 1.5 return TModuleDefinition::GetModule(cl, out_modulename);
33 loizides 1.6 }
34 loizides 1.5 TString tmp(cl->GetDeclFileName());
35     Ssiz_t fst = tmp.Index("/Mit")+1;
36     Ssiz_t snd = tmp.Index("/",tmp.Index("/",fst)+1);
37     out_modulename = tmp(fst,snd-fst);
38     return 1;
39     }
40 loizides 1.6
41     ClassDef(MyModDef, 0) // MyModDef class for BAMBU module definition
42     };
43 loizides 1.5
44     MyHtml()
45     {
46     MyModDef m;
47     SetModuleDefinition(m);
48     }
49 loizides 1.1 void SetIncludePath(const char *p) { fPathInfo.fIncludePath=p; }
50 loizides 1.5 void GetModuleNameForClass(TString& module, TClass* cl) const
51     {
52     TString cn(cl->GetName());
53     if (!cn.BeginsWith("mithep") && !cn.BeginsWith("TAM"))
54     return THtml::GetModuleNameForClass(module, cl);
55     TString tmp(cl->GetDeclFileName());
56     Ssiz_t fst = tmp.Index("/Mit")+1;
57     Ssiz_t snd = tmp.Index("/",tmp.Index("/",fst)+1);
58     module = tmp(fst,snd-fst);
59     }
60 loizides 1.6 void Print()
61     {
62     GetListOfModules()->Print();
63     //hack for MitCommon
64     // TModuleDocInfo* module =
65     // dynamic_cast<TModuleDocInfo*>(GetOwner()->GetListOfModules()->FindObject("MitCommon"));
66     // if (module)
67     // module->SetSelected();
68     }
69 loizides 1.1
70 loizides 1.6 ClassDef(MyHtml, 0) // MyHtml class for BAMBU docu;
71 loizides 1.1 };
72    
73     void load_libs(const char *ln)
74     {
75     TDirectory::TContext context(0); // automatically restore gDirectory
76     TRegexp re(Form("lib%s*.so", ln), true);
77     TString lpath(gSystem->ExpandPathName("$CMSSW_BASE/lib/$SCRAM_ARCH"));
78     void *dir = gSystem->OpenDirectory(lpath);
79     if(!dir) return;
80     while(const char *file = gSystem->GetDirEntry(dir)) {
81     TString s(file);
82     if (s.Index(re) == kNPOS)
83     continue;
84     ::Info("make_doc","Loading %s", file);
85     gSystem->Load(file);
86     }
87     gSystem->FreeDirectory(dir);
88     }
89    
90     void make_doc()
91     {
92     MyHtml h;
93     h.SetProductName("MitRoot");
94    
95     // load our libraries
96 loizides 1.2 load_libs("MitCommon");
97 loizides 1.1 load_libs("MitAna");
98 loizides 1.2 load_libs("MitPhysics");
99 loizides 1.1
100 loizides 1.3 TString cb(gSystem->ExpandPathName("$CMSSW_BASE"));
101 loizides 1.5 h.SetInputDir("$CMSSW_BASE/src:$ROOTSYS/include");
102     h.SetIncludePath(Form("%s/src/",cb.Data()));
103 loizides 1.1 h.SetClassDocTag("//------------------------------------------------------------");
104     h.SetViewCVS("http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/UserCode/");
105 loizides 1.6 h.SetRootURL("http://root.cern.ch/root/html522");
106 loizides 1.5 h.MakeAll(0,"(mithep::|TAM)");
107 loizides 1.1 }