ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PixelCalib::PixelChargeInterpolationCalibration Class Reference

#include <PixelChargeInterpolationCalibration.h>

Collaboration diagram for PixelCalib::PixelChargeInterpolationCalibration:

Public Member Functions

 PixelChargeInterpolationCalibration (const std::string &tag, PixelChargeInterpolationParameters &parametersModel)
 
virtual ~PixelChargeInterpolationCalibration ()
 
void Fill (int DetType, double GeVTrkPt, double alpha, double DeltaRow, double digresphi, double resphi, double OmegaPhi, double TrkEta, double DeltaCol, double digreseta, double reseta, double OmegaEta)
 
void Read (TDirectory *readdir=0)
 
void Write (TDirectory *writedir=0)
 
int Analyze (const std::string &output, std::vector< std::string > &reference_names)
 

Private Member Functions

 PixelChargeInterpolationCalibration (const PixelChargeInterpolationCalibration &)
 
PixelChargeInterpolationCalibrationoperator= (const PixelChargeInterpolationCalibration &)
 

Private Attributes

PixelChargeInterpolationHistogramsm_DigitalCalibration
 
PixelChargeInterpolationHistogramsm_AnalogCalibration
 
PixelChargeInterpolationPlotm_plots
 

Detailed Description

Definition at line 20 of file PixelChargeInterpolationCalibration.h.

Constructor & Destructor Documentation

◆ PixelChargeInterpolationCalibration() [1/2]

PixelCalib::PixelChargeInterpolationCalibration::PixelChargeInterpolationCalibration ( const std::string &  tag,
PixelChargeInterpolationParameters parametersModel 
)

Definition at line 22 of file PixelChargeInterpolationCalibration.cxx.

23  :
26  m_plots(0){
27 
28  m_DigitalCalibration = new PixelChargeInterpolationHistograms(tag,model);
29  m_AnalogCalibration = new PixelChargeInterpolationHistograms("analog_" + tag,model);
30 
31 }

◆ ~PixelChargeInterpolationCalibration()

PixelCalib::PixelChargeInterpolationCalibration::~PixelChargeInterpolationCalibration ( )
virtual

Definition at line 35 of file PixelChargeInterpolationCalibration.cxx.

35  {
36 
39  delete m_plots; m_plots = 0;
40 
41 }

◆ PixelChargeInterpolationCalibration() [2/2]

PixelCalib::PixelChargeInterpolationCalibration::PixelChargeInterpolationCalibration ( const PixelChargeInterpolationCalibration )
private

Member Function Documentation

◆ Analyze()

int PixelCalib::PixelChargeInterpolationCalibration::Analyze ( const std::string &  output,
std::vector< std::string > &  reference_names 
)

Definition at line 104 of file PixelChargeInterpolationCalibration.cxx.

105  {
106 
107  PixelChargeInterpolationParameters *DigitalParameters = 0;
108  PixelChargeInterpolationParameters *AnalogParameters = 0;
109 
110  std::ofstream logfile;
111  logfile.open((output + ".log").c_str());
112  logfile << "Log file for the pixel calibration fits." << std::endl;
113 
114  DigitalParameters = m_DigitalCalibration->Analyze(logfile);
115  AnalogParameters = m_AnalogCalibration->Analyze(logfile);
116 
117  logfile.close();
118 
119  std::string name = "PixelChargeInterpolationData-" + output;
120  size_t pos = output.find("PixelOfflineReco");
121  if(pos != std::string::npos){
122  name = "PixelChargeInterpolationData"
123  + output.substr(pos+16,std::string::npos);
124  }
125  DigitalParameters->Print(name);
126  name = "Analog-" + name;
127  AnalogParameters->Print(name);
128 
129  m_plots = new PixelChargeInterpolationPlot(*DigitalParameters);
130  m_plots->AddReference(*AnalogParameters,
131  std::string("Fit on analog residual (should give 0)").c_str(),3,std::string("P"));
132  //std::cout << reference_names.size() << std::endl;
133  for(unsigned int i = 0 ; i < reference_names.size() ; i++ ){
134  //std::cout << reference_names[i] << std::endl;
135  std::ifstream fin((reference_names[i]).c_str());
136  if(!fin.fail()){
137  fin.close();
138  PixelChargeInterpolationParameters *RefParameters =
140  RefParameters->Load(reference_names[i]);
141  int color = 4+i;
142  if(color == 5) color = 1;
143  m_plots->AddReference(*RefParameters,reference_names[i],color,std::string("P"));
144  delete RefParameters;
145  }
146  }
147  m_plots->Plot(output);
148 
149 
150  return 0;
151 }

◆ Fill()

void PixelCalib::PixelChargeInterpolationCalibration::Fill ( int  DetType,
double  GeVTrkPt,
double  alpha,
double  DeltaRow,
double  digresphi,
double  resphi,
double  OmegaPhi,
double  TrkEta,
double  DeltaCol,
double  digreseta,
double  reseta,
double  OmegaEta 
)

Definition at line 77 of file PixelChargeInterpolationCalibration.cxx.

81  {
82 
83  // hack to uniform constants for all layers and for all disks
84  int modifier = 0;
85  int totlayers = 3;
86  if(DetType == 0) totlayers = 1;
87  else if(DetType < 4) modifier = 1;
88  else modifier = 4;
89  // fill with the same values for the relevant layers
90  for(int iLayer = 0; iLayer < totlayers; iLayer++){
91  DetType = iLayer + modifier;
93  TrkEta, DeltaCol, digreseta, OmegaEta,
94  alpha, DeltaRow, digresphi, OmegaPhi);
95  m_AnalogCalibration->Fill(DetType, GeVTrkPt,
96  TrkEta, DeltaCol, reseta, OmegaEta,
97  alpha, DeltaRow, resphi, OmegaPhi);
98  }
99 
100 }

◆ operator=()

PixelChargeInterpolationCalibration& PixelCalib::PixelChargeInterpolationCalibration::operator= ( const PixelChargeInterpolationCalibration )
private

◆ Read()

void PixelCalib::PixelChargeInterpolationCalibration::Read ( TDirectory *  readdir = 0)

Definition at line 45 of file PixelChargeInterpolationCalibration.cxx.

45  {
46 
47  TDirectory *current = gDirectory;
48  TDirectory *globaldir = gDirectory;
49  if(histofile != 0) globaldir = histofile;
50 
51  globaldir->cd("ChargeInterpolation");
54 
55  current->cd();
56 }

◆ Write()

void PixelCalib::PixelChargeInterpolationCalibration::Write ( TDirectory *  writedir = 0)

Definition at line 60 of file PixelChargeInterpolationCalibration.cxx.

60  {
61 
62  TDirectory *current = gDirectory;
63  TDirectory *globaldir = gDirectory;
64  if(writedir != 0) globaldir = writedir;
65 
66  globaldir->mkdir("ChargeInterpolation")->cd();
69  m_plots->Write();
70 
71  current->cd();
72 
73 }

Member Data Documentation

◆ m_AnalogCalibration

PixelChargeInterpolationHistograms* PixelCalib::PixelChargeInterpolationCalibration::m_AnalogCalibration
private

Definition at line 43 of file PixelChargeInterpolationCalibration.h.

◆ m_DigitalCalibration

PixelChargeInterpolationHistograms* PixelCalib::PixelChargeInterpolationCalibration::m_DigitalCalibration
private

Definition at line 42 of file PixelChargeInterpolationCalibration.h.

◆ m_plots

PixelChargeInterpolationPlot* PixelCalib::PixelChargeInterpolationCalibration::m_plots
private

Definition at line 44 of file PixelChargeInterpolationCalibration.h.


The documentation for this class was generated from the following files:
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
color
Definition: jFexInputByteStreamTool.cxx:25
PixelCalib::PixelChargeInterpolationCalibration::m_plots
PixelChargeInterpolationPlot * m_plots
Definition: PixelChargeInterpolationCalibration.h:44
PixelCalib::PixelChargeInterpolationHistograms::Fill
int Fill(int DetType, double GeVTrkPt, double TrkEta, double DeltaCol, double reseta, double OmegaEta, double alpha, double DeltaRow, double resphi, double OmegaPhi)
Definition: PixelChargeInterpolationHistograms.cxx:150
PixelCalib::PixelChargeInterpolationHistograms::Write
int Write()
Definition: PixelChargeInterpolationHistograms.cxx:214
PixelCalib::PixelChargeInterpolationHistograms::Analyze
PixelChargeInterpolationParameters * Analyze(std::ofstream &logfile)
Definition: PixelChargeInterpolationHistograms.cxx:232
PixelCalib::PixelChargeInterpolationPlot::AddReference
void AddReference(const PixelChargeInterpolationParameters &parameters, const std::string &title="Reference", int color=0, const std::string &drawopt="HIST")
Definition: PixelChargeInterpolationPlot.cxx:81
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
lumiFormat.i
int i
Definition: lumiFormat.py:85
merge.output
output
Definition: merge.py:17
PixelCalib::PixelChargeInterpolationCalibration::m_AnalogCalibration
PixelChargeInterpolationHistograms * m_AnalogCalibration
Definition: PixelChargeInterpolationCalibration.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.runDiffRootOnChanged.logfile
logfile
Definition: runDiffRootOnChanged.py:143
PixelChargeInterpolationParameters
make_hlt_rep.modifier
string modifier
Definition: make_hlt_rep.py:14
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
correlationModel::model
model
Definition: AsgElectronEfficiencyCorrectionTool.cxx:46
PixelCalib::PixelChargeInterpolationPlot::Write
void Write()
Definition: PixelChargeInterpolationPlot.cxx:456
compute_lumi.fin
fin
Definition: compute_lumi.py:19
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
PixelCalib::PixelChargeInterpolationPlot::Plot
void Plot(const std::string &output)
Definition: PixelChargeInterpolationPlot.cxx:99
DetType
Definition: DetType.h:10
PixelCalib::PixelChargeInterpolationHistograms::Read
int Read()
Definition: PixelChargeInterpolationHistograms.cxx:197
PixelCalib::PixelChargeInterpolationCalibration::m_DigitalCalibration
PixelChargeInterpolationHistograms * m_DigitalCalibration
Definition: PixelChargeInterpolationCalibration.h:42