utilities.hh File Reference

Useful functions for loading trees/files/etc within root. More...

#include "TCanvas.h"
#include "TCut.h"
#include "ChannelData.hh"
#include <string>
#include <vector>

Go to the source code of this file.

Functions

TFile * OpenFile (const char *filename, const char *option="READ")
 Open a file, and make sure it actually did open properly.
TTree * GetEventsTree (const char *filename)
 Load the 'Events' tree from a given file.
TGraph * GetAverageGraph (const char *filename, int channel)
 Load the 'average_channel#' graph from a given file for channel n.
TGraphErrors * GetAverageGraph (int run_no, int channel)
 Load the 'average_channel#' graph from the official file for run run_no and channel n.
double GetBaseline (TGraph *g, int npts=100, bool subtract=false)
 Get the baseline of a TGraph by averagint the first npts points.
int DividePad (TPad *p, int nplots)
 Decide how to divde a pad based on the number of plots.
int explode_string (const std::string &s, char delim, std::vector< std::string > &out)
 Break a string at char delim into subtstrings in the out vector.
std::vector< std::string > explode_cut (const TCut &cut)
 Break a compound TCut into it's individual pieces.
void DrawOperationsBoxes (bool drawbubble=true, bool drawrecirc=true)
 Draw TBoxes on a graph where we did mechanical operations on the detector.
TGraph * GetRealEvent (const char *filename, int eventnum, int channel)
 Get the response for the given channel and event in file as a TGraph.
ChannelDataGetChannelData (const char *filename, int eventnum, int channel)
 Get the pointer to ChannelData the the given event and channel.
double CorrelationCoefficient (int npts, double *x, double *y)
 Calculate the correlation coefficient between two vectors.
TCut GetStandardCuts ()
 Get a TCut with the standard analysis cuts.
TCut GetTwoPulseCuts ()
 Get a TCut with standard cuts used for two-phase runs.
TCut GetOnePulseCuts (bool onlyone=true)
 Get a TCut with standard cuts used for single-phase runs.
TCanvas * TwoPulsePlots (TTree *Events, bool queryfit=false, TCut cuts="", TCanvas *c=new TCanvas)
 Plot relevant plots for 2-pulse events.
TCanvas * OnePulsePlots (TTree *Events, TCut cuts="", TCanvas *c=new TCanvas)
 Plot relevant plots for 1-pulse events.
TCanvas * PlotSpeDistributions (TTree *Events, bool normalize=true)
 Plot the single photoelectron distribution from in-run events.
double ElectronLifetime (TTree *Events, bool newcanvas=false, bool defaultlimits=true)
 Get the electron lifetime for a run.
void SaveHistoToFile (TObject *c)
 Print a TH1 bin contents to a text file.
void CustomizeHistogramMenus ()
 Add menus to TH1{F,D}.

Detailed Description

Useful functions for loading trees/files/etc within root.

Author:
bloer

Definition in file utilities.hh.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 20 Jun 2014 for daqman by  doxygen 1.6.1