#include #include #include #include //Analyzer includes #include "Cell.h" //ROOT includes #include "TROOT.h" #include "TStyle.h" #include "TMath.h" #include "TFile.h" #include "TCanvas.h" #include "TSpline.h" #include "TTree.h" int main () { char *Direct; Direct=getenv("MIN_EXAMPLE_DIRECTORY"); if (Direct==NULL){ cout << "The environment variable MIN_EXAMPLE_DIRECTORY is not defined! Set it up first!\n"; return -1; } string DIRECT = Direct; string fname = DIRECT + "/MinExampleData/OutTrees_He6_Diffuse_06172016_IonTOFCut_Triple.root"; TFile* f = new TFile(fname.c_str(),"update"); TTree* OutTrees = (TTree*) f->Get("EventTree_Cond0,0"); double delX = 10; double delY = 10; double r = 40; //Q_Cell qcell(delX, delY, r); //Initialize Q cell instance //T0_Cell tcell(delX, delY, r); //Initialize T0 cell instance fname.clear(); fname = DIRECT +"/MinExampleData/MCPQMap0001.root"; T0_Cell tcell(fname.c_str()); Q_Cell qcell(fname.c_str());//Initialize Q cell instance from file (load MCP QMap) qcell.PrintClass(); tcell.PrintClass(); int n = qcell.GetNCells(); double Qmean,T0mean,T0err; Qmean=T0mean=T0err=0; TCut xyCellCut,QCellCut; TH1D* h_tcell = NULL; TF1* t0Fit = NULL; double Qfact = .5; for(int i=0;iDraw("TOFAA>>h_tcell_internal(100,-20,20)", xyCellCut+QCellCut)<Get("h_tcell_internal");//brings into memory, still belongs to OutTrees directory //h_tcell->Fit("gaus","Quiet"); //t0Fit = (TF1*) h_tcell->GetFunction("gaus"); //T0mean = t0Fit->GetParameter(1); //T0err = t0Fit->GetParError(1); //tcell.SetPoint(i,T0mean,T0err); } qcell.PrintClass(); tcell.PrintClass(); return 0; }