utilities.hh
Go to the documentation of this file.00001
00007 #ifndef UTILITIES_h
00008 #define UTILITIES_h
00009
00010
00011
00012
00013 class TFile;
00014 class TTree;
00015 class TGraph;
00016 class TGraphErrors;
00017 class TPad;
00018 class TChain;
00019 class TObject;
00020
00021 #include "TCanvas.h"
00022 #include "TCut.h"
00023 #include "ChannelData.hh"
00024
00025 #include <string>
00026 #include <vector>
00027
00030
00032 TFile* OpenFile(const char* filename, const char* option = "READ");
00034 TTree* GetEventsTree(const char* filename);
00036 TGraph* GetAverageGraph(const char* filename, int channel);
00038 TGraphErrors* GetAverageGraph(int run_no, int channel);
00040 double GetBaseline(TGraph* g, int npts=100, bool subtract = false);
00042 int DividePad(TPad* p, int nplots);
00043
00045 int explode_string(const std::string& s, char delim,
00046 std::vector<std::string>& out);
00047
00049 std::vector<std::string> explode_cut(const TCut& cut);
00050
00052 void DrawOperationsBoxes(bool drawbubble=true, bool drawrecirc=true);
00053
00055 TGraph* GetRealEvent(const char* filename, int eventnum, int channel);
00056
00058 ChannelData* GetChannelData(const char* filename, int eventnum, int channel);
00059
00061 double CorrelationCoefficient(int npts, double* x, double* y);
00062
00064 TCut GetStandardCuts();
00065
00067 TCut GetTwoPulseCuts();
00068
00070 TCut GetOnePulseCuts(bool onlyone=true);
00071
00073 TCanvas* TwoPulsePlots(TTree* Events, bool queryfit=false, TCut cuts="",TCanvas* c = new TCanvas);
00074
00076 TCanvas* OnePulsePlots(TTree* Events, TCut cuts="",TCanvas* c = new TCanvas);
00077
00079 TCanvas* PlotSpeDistributions(TTree* Events, bool normalize=true);
00080
00082 double ElectronLifetime(TTree* Events, bool newcanvas=false,
00083 bool defaultlimits=true);
00085 void SaveHistoToFile(TObject* c);
00087 void CustomizeHistogramMenus();
00088
00090 #endif