ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/doc/make_doc.C
Revision: 1.9
Committed: Tue Aug 11 23:11:30 2009 UTC (15 years, 8 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.8: +3 -8 lines
Log Message:
Use own version of THtml.

File Contents

# User Rev Content
1 loizides 1.9 // $Id: make_doc.C,v 1.8 2009/07/23 11:13:49 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 loizides 1.9 #include "MitAna/Utils/interface/THtml.h"
21     #include "MitAna/Utils/interface/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.7 return 0;
33     //return TModuleDefinition::GetModule(cl, out_modulename);
34 loizides 1.6 }
35 loizides 1.5 TString tmp(cl->GetDeclFileName());
36     Ssiz_t fst = tmp.Index("/Mit")+1;
37     Ssiz_t snd = tmp.Index("/",tmp.Index("/",fst)+1);
38     out_modulename = tmp(fst,snd-fst);
39     return 1;
40     }
41 loizides 1.6
42     ClassDef(MyModDef, 0) // MyModDef class for BAMBU module definition
43     };
44 loizides 1.5
45     MyHtml()
46     {
47     MyModDef m;
48     SetModuleDefinition(m);
49     }
50 loizides 1.1 void SetIncludePath(const char *p) { fPathInfo.fIncludePath=p; }
51 loizides 1.8 void GetModuleNameForClass(TString& module, TClass* cl) const
52 loizides 1.5 {
53 loizides 1.7 module = "NOTUSED";
54 loizides 1.8 TString cn(cl->GetName());
55     if (!cn.BeginsWith("mithep") && !cn.BeginsWith("TAM")) {
56     return;
57     }
58     TString tmp(cl->GetDeclFileName());
59     Ssiz_t fst = tmp.Index("/Mit")+1;
60     Ssiz_t snd = tmp.Index("/",tmp.Index("/",fst)+1);
61     module = tmp(fst,snd-fst);
62 loizides 1.7 return;
63 loizides 1.5 }
64 loizides 1.7
65     void RunAll(Bool_t force, const char *filter)
66     {
67     CreateListOfClasses(filter);
68     TModuleDocInfo* module =
69     dynamic_cast<TModuleDocInfo*>(GetListOfModules()->FindObject("MitCommon"));
70     if (module)
71     module->SetSelected();
72     THtml::MakeAll(force,filter);
73 loizides 1.6 }
74 loizides 1.1
75 loizides 1.7 ClassDef(MyHtml, 0) // MyHtml class for BAMBU docu
76 loizides 1.1 };
77    
78     void load_libs(const char *ln)
79     {
80     TDirectory::TContext context(0); // automatically restore gDirectory
81     TRegexp re(Form("lib%s*.so", ln), true);
82     TString lpath(gSystem->ExpandPathName("$CMSSW_BASE/lib/$SCRAM_ARCH"));
83     void *dir = gSystem->OpenDirectory(lpath);
84     if(!dir) return;
85     while(const char *file = gSystem->GetDirEntry(dir)) {
86     TString s(file);
87     if (s.Index(re) == kNPOS)
88     continue;
89     ::Info("make_doc","Loading %s", file);
90     gSystem->Load(file);
91     }
92     gSystem->FreeDirectory(dir);
93     }
94    
95     void make_doc()
96     {
97     MyHtml h;
98     h.SetProductName("MitRoot");
99    
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.7 h.RunAll(0,"(mithep::|TAM)");
107 loizides 1.1 }