These are the files used to create and visualize the hit patterns of the BRIKEN detector.
There are three files needed plus one input data file. The three files are "HybridBRIKENPhysicalHistogram.hpp", "HybridBRIKENPhysicalHistogram.cpp", and "HybryidBRIKEN_Tube_Info_1.txt". These files are attached to this eLog entry.
In order to run this type in a terminal
root -l HybidBRIKENPhysicalHistogram.cpp+
The plus is important, it tells ROOT to compile this with the gcc compiler and then run that compiled version of the code. It runs slow, if at all, in the ROOT C++ interpreter CINT.
The code has been tested with ROOT v5.32 and v5.34, not version 6.
At the bottom of the HybidBRIKENPhysicalHistogram.cpp file is the "main program". In it you can set the input data file, which should be a BRIKEN online root output file, and the 3He energy cuts. It is easiest if all the files are in the same folder. If there are any questions please feel free to email B. Charles (Charlie) Rasco. |
//
// HybridBRIKENPhysicalHistogram.hpp
//
//
// Created by Bertis Charles Rasco on 11/4/16.
//
//
#ifndef HybridBRIKENPhysicalHistogram_hpp
#define HybridBRIKENPhysicalHistogram_hpp
#include <vector>
#include "TFile.h"
#include "TH2Poly.h"
#include "TObject.h"
#include "TString.h"
//class TFile;
class HeTube
{
public:
HeTube( Double_t r, Double_t x, Double_t y, Int_t tID, Int_t rID, char tubeTypeChars[2] )
{ radius = r; pos[0] = x; pos[1] = y; tubeID = tID; ringID = rID;
tubeType[0] = tubeTypeChars[0]; tubeType[1] = tubeTypeChars[1]; }
//private:
Double_t radius;
Double_t pos[2];
Int_t tubeID;
Int_t ringID;
Char_t tubeType[2]; // RI (RIKEN), UP (UPC), O1 (ORNL1), O2 (ORNL2)
};
class HybridBRIKENHistogram : public TH2Poly
{
public:
HybridBRIKENHistogram();// ROOT needs this to be defined if it is inherited from a ROOT class.
HybridBRIKENHistogram( const char *name, const char *title, Double_t xlow, Double_t xup, Double_t ylow, Double_t yup );
HybridBRIKENHistogram( const char *name, const char *title, Double_t xlow, Double_t xup, Double_t ylow, Double_t yup,
TString inputFileName );
~HybridBRIKENHistogram();
ClassDef(HybridBRIKENHistogram,1);// ROOT also needs this if it is inherited from a ROOT class. Not sure what the 1 means.
private:
void ReadinTubes( void );
void SetupTubes( void );
void ReadInDataFromFile( void );
void FillTubeCountsRandom( void );
Int_t AddCircularBin( Int_t tubeID );
TString m_InputFileName;
TFile *m_InputFile;
std::vector<HeTube*> m_Tubes;
};
#endif /* HybridBRIKENPhysicalHistogram_hpp */
|