Macros | Functions
energyhistogram.cc File Reference
#include <iostream>
#include <fstream>
#include <string>
#include <TCanvas.h>
#include <TH2F.h>
#include <TMath.h>
#include <TFile.h>
#include <TGraph.h>
#include <TROOT.h>
#include <TStyle.h>
#include <TColor.h>
#include <TTimeStamp.h>
#include "RecEventFile.h"
#include "RecEvent.h"
#include "RdEvent.h"
#include "DetectorGeometry.h"
#include "SDEvent.h"
#include "SdRecStation.h"
#include "ShowerRRecDataQuantities.h"
#include "StationRRecDataQuantities.h"
#include "PolarHist.h"
#include <TEllipse.h>
#include <TGraphPolar.h>
#include <TPaletteAxis.h>
#include <TText.h>
#include <TVector3.h>
#include <TProfile.h>
#include <RdTrace.h>
#include <vector>
#include <TArrow.h>

Go to the source code of this file.

Macros

#define AUGER_RADIO_ENABLED
 

Functions

int main ()
 
void reverse (double arr[], int count)
 
bool SetRealAspectRatio (TCanvas *const c, const Int_t axis=1)
 Function to resize a canvas so that a 2D histogram or TGraph / TGraph2D are shown in real aspect ratio. More...
 

Macro Definition Documentation

#define AUGER_RADIO_ENABLED

Definition at line 13 of file energyhistogram.cc.

Function Documentation

int main ( void  )
void reverse ( double  arr[],
int  count 
)
bool SetRealAspectRatio ( TCanvas *const  c,
const Int_t  axis = 1 
)

Function to resize a canvas so that a 2D histogram or TGraph / TGraph2D are shown in real aspect ratio.

Parameters
cpointer to a TCanvas
axis1 for resizing horizontally (x-axis) in order to get real aspect ratio, 2 for the resizing vertically (y-axis)
Returns
false if error is encountered, true otherwise
Note
For defining the concept real aspect ratio, it is assumed that x and y axes are in same units, e.g. both in MeV or both in ns
You can resize either the the width of the canvas or the height, but not both at the same time
Resize the canvas before calling this function, if you want a larger height or width of reference if you call with parameter axis= 1 or 2, respectively
Call this function AFTER drawing AND zooming (SetUserRange) your TGraph or Histogram, otherwise it cannot infer your actual axes lengths
This function ensures that the TFrame has a real aspect ratio, this does not mean that the full pad (i.e. the canvas or png output) including margins has exactly the same ratio
This function does not work if canvas is divided in several subpads
See Also
https://root-forum.cern.ch/t/resize-canvas-to-get-real-aspect-ratio-of-th2-or-tgraph/20718/1

Definition at line 62 of file energyhistogram.cc.

References utl::abs().


, generated on Tue Sep 26 2023.