//Makes plots
//rfc: working version 1.1 jul 25 2007
#ifndef RPLOTS_
#define RPLOTS_


#include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <TFile.h>
#include <TTree.h>
#include <TChain.h>
#include <TClass.h>
#include <TH2F.h>
#include <TObject.h>
#include <../rory_functions/Rtube.cxx>
#include <../rory_functions/RgetPrsSwap.cxx>
#include <LinkDef.h>
using namespace std;


///////////////////////////////////////////////////////////////////////////
//                                                                       //
// Rplots                                                                //
// Set up plots, print plots, make fits to plots                         //
//////////////////////////////////////////////////////////////////////////


//Set up plots

class Rplots : public Rtube {

private:
int relabel(TH2F **); //Relabel PMT type plots to take account of barrel wrapping for 60 PMT plots

public:
Rplots(char *mappath="./maps/") : Rtube(mappath){};
~Rplots();
int ntrack_plotsint();//Set up the plots no tracking

TH2F ** nt_hist; //No traking histogam PMT tube vs. Soft ID
TH2F ** nt_pmt;   //No traking histogram PMT tube vs. tube Array


//int ntrack_plotsprint();//Print the plots no tracking

ClassDef(Rplots, 1) //Rplots
};
#endif


#if !defined(__CINT__)
ClassImp(Rplots);
#endif

//************Set up plots no tracking *************
int Rplots::ntrack_plotsint(){
//Set up the plots for the No Tracking data files

nt_hist = new TH2F*[61];
nt_pmt = new TH2F*[0];
ostringstream name;
ostringstream pname;

for( int ih = 1; ih < 61 ; ih++ )
 {
 name.str("");name << "pmt_adc"<< ih;
 pname.str("");pname << "p_pmt_adc"<< (nt_hist+ih);
*(nt_hist+ih) =new TH2F(TString( pname.str() ),TString( name.str() ),80,0.5,80.5,100,0.5,10);
 }

pname.str("");pname << "p_pmt_tube"<< (nt_pmt);
*nt_pmt =new TH2F(TString( pname.str() ),"Pmt vs tube",80,0.5,80.5,5,0.5,5);
//Relabel these axis
relabel(nt_hist);
return 0;
}

//************Relabel axis for PMT plots
int Rplots::relabel(TH2F ** plots){
//Relabel wrapping axis correctly as barrel wraps
ostringstream name;
for(int softId=1;softId<4800;softId++){
   name.str("");
   if ( (softId+1)%2==0) {name << softId;}
   ( *( plots + (getPMT(softId) ) ) )->GetXaxis()->SetBinLabel( (PMTid[softId] ) ,TString( name.str() ) );
}
return 0;
}



//**********Destructor*********
Rplots::~Rplots(){
delete []nt_hist; 
delete []nt_pmt;
}


//fitFcn->SetNpx(500);
//fitFcn->SetLineWidth(2);
//fitFcn->SetLineColor(kMagenta);
//fitFcn->SetParLimits(0,0.0001,1000000);
//fitFcn->SetParLimits(1,0.0001,1000);
//fitFcn->SetParLimits(2,0.0001,1000);
//fitFcn->SetParLimits(3,0.0001,1000000);
//fitFcn->SetParLimits(4,0.0001,1000);




This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.