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

Public Member Functions

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

Public Attributes

TGraph * rtgraph
 

Detailed Description

Definition at line 1797 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ DvGraph()

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

Definition at line 1805 of file TRTCalib_makeplots.cxx.

1806 {
1807 
1808  this->SetName(Form("Dv_%i_%i", det, lay));
1809 
1810  vector<string> levels;
1811 
1812  while (true)
1813  {
1814  if (const auto f = path.find(','); f==std::string::npos ){
1815  break;
1816  } else {
1817  levels.push_back(path.substr(0, f));
1818  path.erase(f+1,std::string::npos);
1819  }
1820  }
1821  levels.push_back(path.substr(0, path.find(",")));
1822  cout << " In DvGraph folder: " << folder << " det " << det << " lay " << lay << endl;
1823  for (unsigned int i = 0; i < levels.size(); i++)
1824  cout << " " << levels.at(i);
1825  cout << endl;
1826 
1827  TFile *file = new TFile(infile);
1828  cout << infile << endl;
1829  file->cd();
1830 
1831  TDirectory *trt = (TDirectory *)file->FindKey("TRT_all")->ReadObj();
1832  if (folder != "")
1833  {
1834  TDirectory *thisdet = (TDirectory *)trt->FindKey(folder.c_str())->ReadObj();
1835  cout << "PLOT FOR " << folder << endl;
1836  if (thisdet->FindKey("rtgraph"))
1837  {
1838  rtgraph = (TGraphErrors *)thisdet->FindKey("rtgraph")->ReadObj();
1839  cout << "found rtgraph " << folder << endl;
1840  }
1841  else
1842  {
1843  rtgraph = nullptr;
1844  cout << "did not find rtgraph " << folder << endl;
1845  }
1846  }
1847  else if (trt->FindKey("rtgraph"))
1848  {
1849  rtgraph = (TGraphErrors *)trt->FindKey("rtgraph")->ReadObj();
1850  cout << "no folder, but found rtgraph " << folder << endl;
1851  }
1852  else
1853  {
1854  rtgraph = nullptr;
1855  cout << "no folder, no rtgraph " << folder << endl;
1856  }
1857 
1858  if (rtgraph)
1859  {
1860 
1861  TF1 *rtfunc = (TF1 *)rtgraph->GetListOfFunctions()->First();
1862 
1863  double p0 = rtfunc->GetParameter(0);
1864  double p1 = rtfunc->GetParameter(1);
1865  double p2 = rtfunc->GetParameter(2);
1866  double p3 = rtfunc->GetParameter(3);
1867 
1868  cout << " R-t PARAMETERS: " << p0 << " " << p1 << " " << p2 << " " << p3 << endl;
1869 
1870  bool isdines = false;
1871 
1872  if (isdines)
1873  {
1874  string vrrelation;
1875  if (isinverted)
1876  vrrelation = "x*[2]/sqrt([0]*[0]+x*x)";
1877  else
1878  vrrelation = "sqrt([0]*[0]+x*x)/(x*[2])";
1879 
1880  TF1 *vr1 = new TF1("vr-relation", vrrelation.c_str(), 0.0001, 2.0);
1881  vr1->SetParameters(p0, p1, p2);
1882 
1883  for (int i = 0; i <= 100; i++)
1884  {
1885  float r = 0.1 + (2.0 - 0.1) * (float)i / 100;
1886  float v1 = vr1->Eval(r, 0, 0, 0);
1887  this->SetPoint(i, r, v1);
1888  // cout << i << " " << r << " " << v1 << endl;
1889  }
1890 
1891  vr1->Delete();
1892  }
1893  else
1894  {
1895  cout << " USING POLYNOMIAL R-t RELATION" << endl;
1896 
1897  string rtrelation = "[0]+x*([1]+x*([2]+x*[3]))";
1898  string vtrelation;
1899  if (isinverted)
1900  vtrelation = "1/([0]+2*x*[1]+3*x*x*[2])";
1901  else
1902  vtrelation = "[0]+2*x*[1]+3*x*x*[2]";
1903 
1904  TF1 *rt1 = new TF1("rt-relation", rtrelation.c_str(), -10000, 10000);
1905  rt1->SetParameters(p0, p1, p2, p3);
1906  TF1 *vt1 = new TF1("vt-relation", vtrelation.c_str(), -10000, 10000);
1907  vt1->SetParameters(p1, p2, p3);
1908 
1909  for (int i = 0; i <= 100; i++)
1910  {
1911  float r = 0.1 + (2.0 - 0.1) * (float)i / 100;
1912  float t1 = rt1->GetX(r, -10000, 10000);
1913  float v1 = vt1->Eval(t1, 0, 0, 0);
1914  this->SetPoint(i, r, v1);
1915  // cout << i << " " << r << " " << t1 << " " << v1 << endl;
1916  }
1917 
1918  rt1->Delete();
1919  vt1->Delete();
1920  }
1921  }
1922 }

Member Data Documentation

◆ rtgraph

TGraph* DvGraph::rtgraph

Definition at line 1802 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
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
DvGraph::rtgraph
TGraph * rtgraph
Definition: TRTCalib_makeplots.cxx:1802
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
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