2 #ifndef CSMSTATUSUTILS_H
3 #define CSMSTATUSUTILS_H
23 Int_t createStatusHistograms(TString directory);
24 Int_t analyseStatusHistogram(TH2F* hist);
25 Int_t initializeHistFileFromDir(TString directory, TString filter);
26 Int_t saveStatusTablesToASCII(TString directory,
int runnumber=0);
27 Int_t saveAbbreviatedStatusTablesToASCII(TString directory);
28 Int_t readTablesFromASCII(TString directory, TString filter);
30 Int_t getNumberOfChangedTowers(Int_t runnumber);
32 TH2F* makeStatusVersusTimePlot();
33 void plotAllStatuses(TString rootfiledir=
"/star/data05/scratch/relyea/2005/DONE/",
int year=2005,
int runstart=0);
34 Int_t makeCombinedStatusTable(std::vector<Short_t>& statusVector);
38 void setDetectorFlavor(TString flavor=
"bemc");
39 void setDb(
StEEmcDb *db ) { m_eedb = db;}
41 void writeHtmlHeaderBadTowerList(std::ofstream& out,Int_t runnumber);
42 void writeHtmlFooterBadTowerList(std::ofstream& out);
43 void writeHtmlHeaderSummary(std::ofstream& out);
44 void writeHtmlFooterSummary(std::ofstream& out);
47 std::map<Int_t,std::string> mHistFileMap;
48 std::map<Int_t,std::vector<Short_t>*> mEEMCRunStatusMap;
49 std::map<Int_t,std::vector<Short_t>*> mBEMCRunStatusMap;
50 std::map<Int_t,Int_t> mRunTimestampMap;
51 std::map<Int_t,Int_t> mRunDatestampMap;
52 std::map<Int_t,Bool_t> mFillEndMap;
53 std::map<Int_t,std::vector<Short_t>*>* mRunStatusMapPtr;
54 TString mDetectorFlavor;
56 int mDetectorActualSize;
57 int eemcCrateMap[6][120];
62 TString getDateTimeString(
int runnumber,TTree* ttree=0);
64 void setDateTimeInfo(
int runnumber,TTree* ttree);
65 void writePedestals(Int_t runNumber, TString directory,
66 std::vector<Short_t>& statusVector,
67 std::vector<Float_t>& pedestalmean,
68 std::vector<Float_t>& pedestalwidth,
69 std::vector<Float_t>& pedestalchi);
70 Int_t analyseStatusHistogram(TH2F* hist, TString directory,
71 Float_t& averageNumberOfHitsPerChannel,
74 std::vector<Short_t>& statusVector,
75 std::vector<Float_t>& pedestalmean,
76 std::vector<Float_t>& pedestalwidth,
77 std::vector<Float_t>& pedestalchi,
78 TH1F* hHotTower=0, TH1F* hPedMean=0, TH1F* hPedWidth=0);
Int_t makeStatusPlots(TString plotDir)