CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ReadPGInfo Class Reference

#include <ReadPGInfo.h>

Public Member Functions

char * getId (int, int, int)
 
TMatrixD giveQC (int, int, int)
 
TMatrixD giveQCCal (int, int, int)
 
TMatrixD giveR (int, int, int)
 
TMatrixD giveSurvey (int, int, int)
 
 ReadPGInfo (const char *name)
 
 ~ReadPGInfo ()
 

Private Attributes

TFile * rootFile
 

Detailed Description

Date
2010/02/25 11:33:32
Revision
1.3
Author
Luca Scodellaro Luca..nosp@m.Scod.nosp@m.ellar.nosp@m.o@ce.nosp@m.rn.ch

Definition at line 16 of file ReadPGInfo.h.

Constructor & Destructor Documentation

◆ ReadPGInfo()

ReadPGInfo::ReadPGInfo ( const char *  name)

Definition at line 321 of file ReadPGInfo.cc.

321  {
322  TDirectory *dirSave = gDirectory;
323  rootFile = new TFile(name);
324  dirSave->cd();
325 }

References Skims_PA_cff::name, and rootFile.

◆ ~ReadPGInfo()

ReadPGInfo::~ReadPGInfo ( )

Definition at line 327 of file ReadPGInfo.cc.

327 { delete rootFile; }

References rootFile.

Member Function Documentation

◆ getId()

char * ReadPGInfo::getId ( int  wheel,
int  station,
int  sector 
)

Definition at line 329 of file ReadPGInfo.cc.

329  {
330  for (int counter = 0; counter < TOTALCHAMBERS; ++counter) {
331  if (wheel == position[counter][0] && sector == position[counter][1] && station == position[counter][2])
332  return chambers[counter];
333  }
334  return nullptr;
335 }

References chambers, counter, position, relativeConstraints::station, TOTALCHAMBERS, and makeMuonMisalignmentScenario::wheel.

Referenced by giveQC(), giveR(), and giveSurvey().

◆ giveQC()

TMatrixD ReadPGInfo::giveQC ( int  wheel,
int  station,
int  sector 
)

Definition at line 371 of file ReadPGInfo.cc.

371  {
372  TMatrixD *empty = new TMatrixD(0, 0);
373  char *id = getId(wheel, station, sector);
374  if (id == nullptr)
375  return *empty;
376  TDirectoryFile *myDir = (TDirectoryFile *)rootFile->Get(id);
377  TDirectoryFile *myQC = (TDirectoryFile *)myDir->Get("QCW");
378  TMatrixD *QC;
379  if (myQC == nullptr) {
380  QC = new TMatrixD(0, 0);
381  } else {
382  QC = (TMatrixD *)myQC->Get("matrix");
383  }
384  return *QC;
385 }

References relativeConstraints::empty, getId(), rootFile, relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

Referenced by giveQCCal().

◆ giveQCCal()

TMatrixD ReadPGInfo::giveQCCal ( int  wheel,
int  station,
int  sector 
)

Definition at line 348 of file ReadPGInfo.cc.

348  {
349  TMatrixD *mat = new TMatrixD(0, 0);
350  TMatrixD qc = giveQC(wheel, station, sector);
351  if (qc.GetNrows() == 0)
352  return *mat;
353  mat->ResizeTo(12, 2);
354  int maxCount = 12;
355  if (station == 4)
356  maxCount = 8;
357  for (int c = 0; c < maxCount; ++c) {
358  float error;
359  if (qc(c, 1) == 0 || qc(c, 3) == 0) {
360  (*mat)(c, 0) = (qc(c, 0) + qc(c, 2)) / 2.0;
361  (*mat)(c, 1) = 500;
362  } else {
363  error = 1.0 / (1.0 / (qc(c, 1) * qc(c, 1)) + 1.0 / (qc(c, 3) * qc(c, 3)));
364  (*mat)(c, 0) = (qc(c, 0) / (qc(c, 1) * qc(c, 1)) + qc(c, 2) / (qc(c, 3) * qc(c, 3))) * error;
365  (*mat)(c, 1) = TMath::Sqrt(error);
366  }
367  }
368  return *mat;
369 }

References c, relativeConstraints::error, giveQC(), edmScanValgrind::maxCount, relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

Referenced by DTMuonMillepede::getbcsMatrix(), DTMuonMillepede::getbqcMatrix(), DTMuonMillepede::getCcsMatrix(), and DTMuonMillepede::getCqcMatrix().

◆ giveR()

TMatrixD ReadPGInfo::giveR ( int  wheel,
int  station,
int  sector 
)

Definition at line 337 of file ReadPGInfo.cc.

337  {
338  TMatrixD *empty = new TMatrixD(0, 0);
339  char *id = getId(wheel, station, sector);
340  if (id == nullptr)
341  return *empty;
342  TDirectoryFile *myDir = (TDirectoryFile *)rootFile->Get(id);
343  TDirectoryFile *myR = (TDirectoryFile *)myDir->Get("R");
344  TMatrixD *R = (TMatrixD *)myR->Get("matrix");
345  return *R;
346 }

References relativeConstraints::empty, getId(), dttmaxenums::R, rootFile, relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

◆ giveSurvey()

TMatrixD ReadPGInfo::giveSurvey ( int  wheel,
int  station,
int  sector 
)

Definition at line 387 of file ReadPGInfo.cc.

387  {
388  TMatrixD *empty = new TMatrixD(0, 0);
389  char *id = getId(wheel, station, sector);
390  if (id == nullptr)
391  return *empty;
392  TDirectoryFile *myDir = (TDirectoryFile *)rootFile->Get(id);
393  TDirectoryFile *mySur = (TDirectoryFile *)myDir->Get("Survey");
394  TMatrixD *Survey = (TMatrixD *)mySur->Get("matrix_layer");
395  return *Survey;
396 }

References relativeConstraints::empty, getId(), rootFile, relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

Referenced by DTMuonMillepede::getbcsMatrix(), and DTMuonMillepede::getbsurveyMatrix().

Member Data Documentation

◆ rootFile

TFile* ReadPGInfo::rootFile
private

Definition at line 27 of file ReadPGInfo.h.

Referenced by giveQC(), giveR(), giveSurvey(), ReadPGInfo(), and ~ReadPGInfo().

counter
Definition: counter.py:1
ReadPGInfo::getId
char * getId(int, int, int)
Definition: ReadPGInfo.cc:329
relativeConstraints.station
station
Definition: relativeConstraints.py:67
ReadPGInfo::rootFile
TFile * rootFile
Definition: ReadPGInfo.h:27
relativeConstraints.error
error
Definition: relativeConstraints.py:53
TOTALCHAMBERS
#define TOTALCHAMBERS
Definition: ReadPGInfo.h:14
ReadPGInfo::giveQC
TMatrixD giveQC(int, int, int)
Definition: ReadPGInfo.cc:371
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
chambers
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
counter
static std::atomic< unsigned int > counter
Definition: SharedResourceNames.cc:18
edmScanValgrind.maxCount
maxCount
Definition: edmScanValgrind.py:172
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
dttmaxenums::R
Definition: DTTMax.h:29