ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
DGraph Class Reference
Inheritance diagram for DGraph:
Collaboration diagram for DGraph:

Public Member Functions

 DGraph (char *, string, const string &, int, int, bool)
 

Public Attributes

TGraph * rtgraph
 

Detailed Description

Definition at line 1926 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ DGraph()

DGraph::DGraph ( char *  infile,
string  path,
const string &  folder,
int  det,
int  lay,
bool  isinverted 
)

Definition at line 1934 of file TRTCalib_makeplots.cxx.

1935 {
1936 
1937  this->SetName(Form("Dv_%i_%i", det, lay));
1938 
1939  vector<string> levels;
1940  while (true)
1941  {
1942  if (const auto f = path.find(','); f==std::string::npos ){
1943  break;
1944  } else {
1945  levels.push_back(path.substr(0, f));
1946  path.erase(0, f+1);
1947  }
1948  }
1949  levels.push_back(path.substr(0, path.find(',')));
1950 
1951  TFile *file = new TFile(infile);
1952  file->cd();
1953 
1954  cout << " In DGraph. Folder: " << folder << " det " << det << " lay " << lay << endl;
1955  for (unsigned int i = 0; i < levels.size(); i++)
1956  cout << " " << levels.at(i);
1957  cout << endl;
1958  cout << " infile:" << string(infile) << endl;
1959 
1960  TDirectory *trt = (TDirectory *)file->FindKey("TRT_all")->ReadObj();
1961  if (folder != "")
1962  {
1963  TDirectory *thisDet = (TDirectory *)trt->FindKey(folder.c_str())->ReadObj();
1964  cout << "PLOT FOR " << folder << endl;
1965  if (thisDet->FindKey("rtgraph"))
1966  {
1967  rtgraph = (TGraphErrors *)thisDet->FindKey("rtgraph")->ReadObj();
1968  cout << " folder: " << folder << " found rtgraph " << endl;
1969  }
1970  else
1971  {
1972  rtgraph = nullptr;
1973  cout << " folder: " << folder << " did not find rtgraph " << endl;
1974  }
1975  }
1976  else if (trt->FindKey("rtgraph"))
1977  {
1978  rtgraph = (TGraphErrors *)trt->FindKey("rtgraph")->ReadObj();
1979  cout << " no folder, found rtgraph " << endl;
1980  }
1981  else
1982  {
1983  rtgraph = nullptr;
1984  cout << " no folder, no rtgraph " << endl;
1985  }
1986 
1987  if (rtgraph)
1988  {
1989  TF1 *rtfunc = (TF1 *)rtgraph->GetListOfFunctions()->First();
1990 
1991  double p0 = rtfunc->GetParameter(0);
1992  double p1 = rtfunc->GetParameter(1);
1993  double p2 = rtfunc->GetParameter(2);
1994  double p3 = rtfunc->GetParameter(3);
1995 
1996  cout << " R-t PARAMETERS: " << p0 << " " << p1 << " " << p2 << " " << p3 << endl;
1997 
1998  bool isdines = false;
1999 
2000  if (isdines)
2001  {
2002 
2003  string vrrelation;
2004  if (isinverted)
2005  vrrelation = "x*[2]/sqrt([0]*[0]+x*x)";
2006  else
2007  vrrelation = "sqrt([0]*[0]+x*x)/(x*[2])";
2008 
2009  TF1 *vr1 = new TF1("vr-relation", vrrelation.c_str(), 0.0001, 2.0);
2010  vr1->SetParameters(p0, p1, p2);
2011 
2012  for (int i = 0; i <= 100; i++)
2013  {
2014  float r = 0.1 + (2.0 - 0.1) * (float)i / 100;
2015  float v1 = vr1->Eval(r, 0, 0, 0);
2016  this->SetPoint(i, r, v1);
2017  }
2018 
2019  vr1->Delete();
2020  }
2021  else
2022  {
2023  cout << " USING POLYNOMIAL R-t RELATION" << endl;
2024 
2025  string rtrelation = "[0]+x*([1]+x*([2]+x*[3]))";
2026  string vtrelation;
2027  if (isinverted)
2028  vtrelation = "1/([0]+2*x*[1]+3*x*x*[2])";
2029  else
2030  vtrelation = "[0]+2*x*[1]+3*x*x*[2]";
2031 
2032  TF1 *rt1 = new TF1("rt-relation", rtrelation.c_str(), -10000, 10000);
2033  rt1->SetParameters(p0, p1, p2, p3);
2034  TF1 *vt1 = new TF1("vt-relation", vtrelation.c_str(), -10000, 10000);
2035  vt1->SetParameters(p1, p2, p3);
2036 
2037  for (int i = 0; i <= 1000; i++)
2038  {
2039  float t1 = -5 + i * 0.05;
2040  float r1 = rt1->Eval(t1, 0, 0, 0);
2041  this->SetPoint(i, t1, r1);
2042  }
2043 
2044  rt1->Delete();
2045  vt1->Delete();
2046  }
2047  }
2048 }

Member Data Documentation

◆ rtgraph

TGraph* DGraph::rtgraph

Definition at line 1931 of file TRTCalib_makeplots.cxx.


The documentation for this class was generated from the following file:
beamspotman.r
def r
Definition: beamspotman.py:676
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
run.infile
string infile
Definition: run.py:13
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
DGraph::rtgraph
TGraph * rtgraph
Definition: TRTCalib_makeplots.cxx:1931
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
lumiFormat.i
int i
Definition: lumiFormat.py:85
file
TFile * file
Definition: tile_monitor.h:29
hist_file_dump.f
f
Definition: hist_file_dump.py:135
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
MCP::ScaleSmearParam::r1
@ r1
TRTCalib_cfilter.p3
p3
Definition: TRTCalib_cfilter.py:132
readCCLHist.float
float
Definition: readCCLHist.py:83
TRTCalib_cfilter.p0
p0
Definition: TRTCalib_cfilter.py:129