CMS 3D CMS Logo

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

#include <HIPAlignmentAlgorithm.h>

Inheritance diagram for HIPAlignmentAlgorithm:
AlignmentAlgorithmBase

Public Member Functions

 HIPAlignmentAlgorithm (const edm::ParameterSet &cfg)
 Constructor. More...
 
void initialize (const edm::EventSetup &setup, AlignableTracker *tracker, AlignableMuon *muon, AlignableExtras *extras, AlignmentParameterStore *store) override
 Call at beginning of job. More...
 
void run (const edm::EventSetup &setup, const EventInfo &eventInfo) override
 Run the algorithm. More...
 
void startNewLoop (void) override
 Called at start of new loop. More...
 
void terminate (const edm::EventSetup &setup) override
 Call at end of job. More...
 
 ~HIPAlignmentAlgorithm () override
 Destructor. More...
 
- Public Member Functions inherited from AlignmentAlgorithmBase
virtual bool addCalibrations (const Calibrations &)
 
bool addCalibrations (const CalibrationsOwner &cals)
 
 AlignmentAlgorithmBase (const edm::ParameterSet &)
 Constructor. More...
 
virtual void beginLuminosityBlock (const edm::EventSetup &setup)
 called at begin of luminosity block (no lumi block info passed yet) More...
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &, bool changed)
 called at begin of run More...
 
virtual void endLuminosityBlock (const edm::EventSetup &setup)
 called at end of luminosity block (no lumi block info passed yet) More...
 
virtual void endRun (const EndRunInfo &runInfo, const edm::EventSetup &setup)
 called at end of run - order of arguments like in EDProducer etc. More...
 
virtual bool processesEvents ()
 Returns whether algorithm proccesses events in current configuration. More...
 
virtual bool setParametersForRunRange (const RunRange &rr)
 
virtual bool storeAlignments ()
 Returns whether algorithm produced results to be stored. More...
 
virtual bool supportsCalibrations ()
 
virtual void terminate ()
 Called at end of job (must be implemented in derived class) More...
 
virtual ~AlignmentAlgorithmBase ()
 Destructor. More...
 

Private Member Functions

void bookRoot (void)
 
double calcAPE (double *par, int iter, int function)
 
bool calcParameters (Alignable *ali, int setDet, double start, double step)
 
void collectMonitorTrees (const std::vector< std::string > &filenames)
 
void collector (void)
 
void fillAlignablesMonitor (const edm::EventSetup &setup)
 
HIPAlignableSpecificParametersfindAlignableSpecs (const Alignable *ali)
 
bool processHit1D (const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
 
bool processHit2D (const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
 
int readIterationFile (std::string filename)
 
void setAlignmentPositionError (void)
 
void writeIterationFile (std::string filename, int iter)
 

Private Attributes

std::unique_ptr< AlignableObjectIdalignableObjectId_
 
double col_cut
 
double cos_cut
 
HIPAlignableSpecificParameters defaultAlignableSpecs
 
const bool doTrackHitMonitoring
 
int ioerr
 
bool isCollector
 
bool IsCollision
 
int m2_datatype
 
SurfaceDeformationFactory::Type m2_dtype
 
align::ID m2_Id
 
int m2_Layer
 
int m2_Nhit
 
unsigned int m2_nsurfdef
 
align::StructureType m2_ObjId
 
std::vector< float > m2_surfDef
 
int m2_Type
 
float m2_Xpos
 
float m2_Ypos
 
float m2_Zpos
 
align::ID m3_Id
 
align::StructureType m3_ObjId
 
float m3_par [6]
 
int m_datatype
 
std::string outfile2
 
std::string outpath
 
bool rewgtPerAli
 
std::string salignedfile
 
double Scale
 
std::vector< double > SetScanDet
 
std::string siterationfile
 
std::string smisalignedfile
 
std::string sparameterfile
 
std::string ssurveyfile
 
std::string struefile
 
const std::vector< std::string > surveyResiduals_
 
std::string suvarfile
 
std::string suvarfilecore
 
std::unique_ptr< AlignableNavigatortheAlignableDetAccessor
 
align::Alignables theAlignables
 
TFile * theAlignablesMonitorIORootFile
 
TTree * theAlignablesMonitorTree
 
std::vector< HIPAlignableSpecificParameterstheAlignableSpecifics
 
AlignmentParameterStoretheAlignmentParameterStore
 
std::vector< std::pair< align::Alignables, std::vector< double > > > theAPEParameters
 
std::vector< edm::ParameterSettheAPEParameterSet
 
bool theApplyAPE
 
bool theApplyCutsPerComponent
 
int theCollectorNJobs
 
std::string theCollectorPath
 
std::vector< edm::ParameterSettheCutsPerComponent
 
int theDataGroup
 
std::unique_ptr< TFormula > theEtaFormula
 
TTree * theHitMonitorTree
 
AlignmentIORoot theIO
 
std::vector< unsigned > theIOVrangeSet
 
int theIteration
 
std::vector< align::StructureTypetheLevels
 
HIPMonitorConfig theMonitorConfig
 
bool themultiIOV
 
TFile * theSurveyIORootFile
 
TTree * theSurveyTree
 
TFile * theTrackHitMonitorIORootFile
 
TTree * theTrackMonitorTree
 
bool trackPs
 
bool trackWt
 
bool uniEta
 
std::string uniEtaFormula
 
const bool verbose
 

Additional Inherited Members

- Public Types inherited from AlignmentAlgorithmBase
typedef std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
 
typedef std::vector< ConstTrajTrackPairConstTrajTrackPairCollection
 
using RunNumber = align::RunNumber
 
using RunRange = align::RunRange
 

Detailed Description

Definition at line 31 of file HIPAlignmentAlgorithm.h.

Constructor & Destructor Documentation

◆ HIPAlignmentAlgorithm()

HIPAlignmentAlgorithm::HIPAlignmentAlgorithm ( const edm::ParameterSet cfg)

Constructor.

Definition at line 45 of file HIPAlignmentAlgorithm.cc.

47  verbose(cfg.getParameter<bool>("verbosity")),
51  surveyResiduals_(cfg.getUntrackedParameter<std::vector<std::string>>("surveyResiduals")),
53  theTrackMonitorTree(nullptr),
54  theHitMonitorTree(nullptr),
56  theAlignablesMonitorTree(nullptr),
57  theSurveyIORootFile(nullptr),
58  theSurveyTree(nullptr) {
59  // parse parameters
60  outpath = cfg.getParameter<std::string>("outpath");
61  outfile2 = cfg.getParameter<std::string>("outfile2");
62  struefile = cfg.getParameter<std::string>("trueFile");
63  smisalignedfile = cfg.getParameter<std::string>("misalignedFile");
64  salignedfile = cfg.getParameter<std::string>("alignedFile");
65  siterationfile = cfg.getParameter<std::string>("iterationFile");
66  suvarfilecore = cfg.getParameter<std::string>("uvarFile");
68  sparameterfile = cfg.getParameter<std::string>("parameterFile");
69  ssurveyfile = cfg.getParameter<std::string>("surveyFile");
70 
71  outfile2 = outpath + outfile2; //Alignablewise tree
79 
80  // parameters for APE
81  theApplyAPE = cfg.getParameter<bool>("applyAPE");
82  theAPEParameterSet = cfg.getParameter<std::vector<edm::ParameterSet>>("apeParam");
83 
84  themultiIOV = cfg.getParameter<bool>("multiIOV");
85  theIOVrangeSet = cfg.getParameter<std::vector<unsigned>>("IOVrange");
86 
87  defaultAlignableSpecs.minNHits = cfg.getParameter<int>("minimumNumberOfHits");
88  ;
89  defaultAlignableSpecs.minRelParError = cfg.getParameter<double>("minRelParameterError");
90  defaultAlignableSpecs.maxRelParError = cfg.getParameter<double>("maxRelParameterError");
91  defaultAlignableSpecs.maxHitPull = cfg.getParameter<double>("maxAllowedHitPull");
92  theApplyCutsPerComponent = cfg.getParameter<bool>("applyCutsPerComponent");
93  theCutsPerComponent = cfg.getParameter<std::vector<edm::ParameterSet>>("cutsPerComponent");
94 
95  // for collector mode (parallel processing)
96  isCollector = cfg.getParameter<bool>("collectorActive");
97  theCollectorNJobs = cfg.getParameter<int>("collectorNJobs");
98  theCollectorPath = cfg.getParameter<std::string>("collectorPath");
99 
100  if (isCollector)
101  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::HIPAlignmentAlgorithm"
102  << "Collector mode";
103 
104  trackPs = cfg.getParameter<bool>("UsePreSelection");
105  theDataGroup = cfg.getParameter<int>("DataGroup");
106  trackWt = cfg.getParameter<bool>("UseReweighting");
107  Scale = cfg.getParameter<double>("Weight");
108  uniEta = trackWt && cfg.getParameter<bool>("UniformEta");
109  uniEtaFormula = cfg.getParameter<std::string>("UniformEtaFormula");
110  if (uniEtaFormula.empty()) {
111  edm::LogWarning("Alignment") << "@SUB=HIPAlignmentAlgorithm::HIPAlignmentAlgorithm"
112  << "Uniform eta formula is empty! Resetting to 1.";
113  uniEtaFormula = "1";
114  }
115  theEtaFormula = std::make_unique<TFormula>(uniEtaFormula.c_str());
116  rewgtPerAli = trackWt && cfg.getParameter<bool>("ReweightPerAlignable");
117  IsCollision = cfg.getParameter<bool>("isCollision");
118  SetScanDet = cfg.getParameter<std::vector<double>>("setScanDet");
119  col_cut = cfg.getParameter<double>("CLAngleCut");
120  cos_cut = cfg.getParameter<double>("CSAngleCut");
121 
122  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::HIPAlignmentAlgorithm"
123  << "Constructed";
124 }

References looper::cfg, col_cut, cos_cut, defaultAlignableSpecs, isCollector, IsCollision, HIPAlignableSpecificParameters::maxHitPull, HIPAlignableSpecificParameters::maxRelParError, HIPAlignableSpecificParameters::minNHits, HIPAlignableSpecificParameters::minRelParError, outfile2, outpath, rewgtPerAli, salignedfile, Scale, SetScanDet, siterationfile, smisalignedfile, sparameterfile, ssurveyfile, AlCaHLTBitMon_QueryRunRegistry::string, struefile, suvarfile, suvarfilecore, theAPEParameterSet, theApplyAPE, theApplyCutsPerComponent, theCollectorNJobs, theCollectorPath, theCutsPerComponent, theDataGroup, theEtaFormula, theIOVrangeSet, themultiIOV, trackPs, trackWt, uniEta, and uniEtaFormula.

◆ ~HIPAlignmentAlgorithm()

HIPAlignmentAlgorithm::~HIPAlignmentAlgorithm ( )
inlineoverride

Destructor.

Definition at line 37 of file HIPAlignmentAlgorithm.h.

37 {};

Member Function Documentation

◆ bookRoot()

void HIPAlignmentAlgorithm::bookRoot ( void  )
private

Definition at line 1093 of file HIPAlignmentAlgorithm.cc.

1093  {
1094  // create ROOT files
1096  theTrackHitMonitorIORootFile = TFile::Open(theMonitorConfig.outfile.c_str(), "update");
1098  // book event-wise ROOT Tree
1100  TString tname = Form("T1_%i", theIteration);
1101  theTrackMonitorTree = new TTree(tname, "Eventwise tree");
1102  //theTrackMonitorTree->Branch("Run", &m_Run, "Run/I");
1103  //theTrackMonitorTree->Branch("Event", &m_Event, "Event/I");
1104  theTrackMonitorTree->Branch("DataType", &m_datatype);
1107  }
1108  // book hit-wise ROOT Tree
1110  TString tname_hit = Form("T1_hit_%i", theIteration);
1111  theHitMonitorTree = new TTree(tname_hit, "Hitwise tree");
1112  theHitMonitorTree->Branch("DataType", &m_datatype);
1115  }
1116  }
1117 
1118  // book alignable-wise ROOT Tree
1119  if (isCollector) {
1120  TString tname = Form("T2_%i", theIteration);
1121  theAlignablesMonitorIORootFile = TFile::Open(outfile2.c_str(), "update");
1123  theAlignablesMonitorTree = new TTree(tname, "Alignablewise tree");
1124  theAlignablesMonitorTree->Branch("Id", &m2_Id, "Id/i");
1125  theAlignablesMonitorTree->Branch("ObjId", &m2_ObjId, "ObjId/I");
1126  theAlignablesMonitorTree->Branch("Nhit", &m2_Nhit);
1127  theAlignablesMonitorTree->Branch("DataType", &m2_datatype);
1128  theAlignablesMonitorTree->Branch("Type", &m2_Type);
1129  theAlignablesMonitorTree->Branch("Layer", &m2_Layer);
1130  theAlignablesMonitorTree->Branch("Xpos", &m2_Xpos);
1131  theAlignablesMonitorTree->Branch("Ypos", &m2_Ypos);
1132  theAlignablesMonitorTree->Branch("Zpos", &m2_Zpos);
1133  theAlignablesMonitorTree->Branch("DeformationsType", &m2_dtype, "DeformationsType/I");
1134  theAlignablesMonitorTree->Branch("NumDeformations", &m2_nsurfdef);
1135  theAlignablesMonitorTree->Branch("Deformations", &m2_surfDef);
1136  }
1137 
1138  // book survey-wise ROOT Tree only if survey is enabled
1139  if (!theLevels.empty()) {
1140  TString tname = Form("T3_%i", theIteration);
1141  theSurveyIORootFile = TFile::Open(ssurveyfile.c_str(), "update");
1142  theSurveyIORootFile->cd();
1143  theSurveyTree = new TTree(tname, "Survey Tree");
1144  theSurveyTree->Branch("Id", &m3_Id, "Id/i");
1145  theSurveyTree->Branch("ObjId", &m3_ObjId, "ObjId/I");
1146  theSurveyTree->Branch("Par", &m3_par, "Par[6]/F");
1147  edm::LogInfo("Alignment") << "[HIPAlignmentAlgorithm::bookRoot] Survey trees booked.";
1148  }
1149  edm::LogInfo("Alignment") << "[HIPAlignmentAlgorithm::bookRoot] Root trees booked.";
1150 }

References HIPTrackMonitorVariables::bookBranches(), HIPHitMonitorVariables::bookBranches(), doTrackHitMonitoring, HIPMonitorConfig::fillTrackHitMonitoring, HIPMonitorConfig::fillTrackMonitoring, HIPMonitorConfig::hitmonitorvars, isCollector, m2_datatype, m2_dtype, m2_Id, m2_Layer, m2_Nhit, m2_nsurfdef, m2_ObjId, m2_surfDef, m2_Type, m2_Xpos, m2_Ypos, m2_Zpos, m3_Id, m3_ObjId, m3_par, m_datatype, HIPMonitorConfig::outfile, outfile2, HIPMonitorVariables::setTree(), ssurveyfile, theAlignablesMonitorIORootFile, theAlignablesMonitorTree, theHitMonitorTree, theIteration, theLevels, theMonitorConfig, theSurveyIORootFile, theSurveyTree, theTrackHitMonitorIORootFile, theTrackMonitorTree, cond::persistency::GLOBAL_TAG::tname, and HIPMonitorConfig::trackmonitorvars.

Referenced by startNewLoop().

◆ calcAPE()

double HIPAlignmentAlgorithm::calcAPE ( double *  par,
int  iter,
int  function 
)
private

Definition at line 1076 of file HIPAlignmentAlgorithm.cc.

1076  {
1077  double diter = (double)iter;
1078  if (function == 0)
1079  return std::max(par[1], par[0] + ((par[1] - par[0]) / par[2]) * diter);
1080  else if (function == 1)
1081  return std::max(0., par[0] * (exp(-pow(diter, par[1]) / par[2])));
1082  else if (function == 2) {
1083  int ipar2 = (int)par[2];
1084  int step = iter / ipar2;
1085  double dstep = (double)step;
1086  return std::max(0., par[0] - par[1] * dstep);
1087  } else
1088  assert(false); // should have been caught in the constructor
1089 }

References cms::cuda::assert(), JetChargeProducer_cfi::exp, createfilelist::int, SiStripPI::max, and funct::pow().

Referenced by setAlignmentPositionError().

◆ calcParameters()

bool HIPAlignmentAlgorithm::calcParameters ( Alignable ali,
int  setDet,
double  start,
double  step 
)
private

Definition at line 1234 of file HIPAlignmentAlgorithm.cc.

1234  {
1235  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::calcParameters"
1236  << "Begin: Processing detector " << ali->id();
1237 
1238  // Alignment parameters
1240  const HIPAlignableSpecificParameters* alispecifics = findAlignableSpecs(ali);
1241  // access user variables
1242  HIPUserVariables* uservar = dynamic_cast<HIPUserVariables*>(par->userVariables());
1243  int nhit = uservar->nhit;
1244  // The following variable is needed for the extended 1D/2D hit fix using
1245  // matrix shrinkage and expansion
1246  // int hitdim = uservar->hitdim;
1247 
1248  // Test nhits
1249  int minHitThreshold = (!theApplyCutsPerComponent ? defaultAlignableSpecs.minNHits : alispecifics->minNHits);
1250  if (!isCollector)
1251  minHitThreshold = 1;
1252  if (setDet == 0 && nhit < minHitThreshold) {
1253  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::calcParameters"
1254  << "Skipping detector " << ali->id() << " because number of hits = " << nhit
1255  << " <= " << minHitThreshold;
1256  par->setValid(false);
1257  return false;
1258  }
1259 
1260  AlgebraicSymMatrix jtvj = uservar->jtvj;
1261  AlgebraicVector jtve = uservar->jtve;
1262 
1263  // these are the alignment corrections+covariance (for selected params)
1264  int npar = jtve.num_row();
1265  AlgebraicVector params(npar);
1266  AlgebraicVector paramerr(npar);
1267  AlgebraicSymMatrix cov(npar);
1268 
1269  // errors of parameters
1270  if (isCollector) {
1271  if (setDet == 0) {
1272  int ierr;
1273  AlgebraicSymMatrix jtvjinv = jtvj.inverse(ierr);
1274  if (ierr != 0) {
1275  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::calcParameters"
1276  << "Matrix inversion failed!";
1277  return false;
1278  }
1279  params = -(jtvjinv * jtve);
1280  cov = jtvjinv;
1281 
1282  double minRelErrThreshold =
1284  double maxRelErrThreshold =
1286  for (int i = 0; i < npar; i++) {
1287  double relerr = 0;
1288  if (fabs(cov[i][i]) > 0.)
1289  paramerr[i] = sqrt(fabs(cov[i][i]));
1290  else
1291  paramerr[i] = params[i];
1292  if (params[i] != 0.)
1293  relerr = fabs(paramerr[i] / params[i]);
1294  if ((maxRelErrThreshold >= 0. && relerr > maxRelErrThreshold) || relerr < minRelErrThreshold) {
1295  edm::LogWarning("Alignment") << "@SUB=HIPAlignmentAlgorithm::calcParameters"
1296  << "RelError = " << relerr << " > " << maxRelErrThreshold << " or < "
1297  << minRelErrThreshold << ". Setting param = paramerr = 0 for component " << i;
1298  params[i] = 0;
1299  paramerr[i] = 0;
1300  }
1301  }
1302  } else {
1303  if (params.num_row() != 1) {
1304  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::calcParameters"
1305  << "For scanning, please only turn on one parameter! check common_cff_py.txt";
1306  return false;
1307  }
1308  if (theIteration == 1)
1309  params[0] = start;
1310  else
1311  params[0] = step;
1312  edm::LogWarning("Alignment") << "@SUB=HIPAlignmentAlgorithm::calcParameters"
1313  << "Parameters = " << params;
1314  }
1315  }
1316 
1317  uservar->alipar = params;
1318  uservar->alierr = paramerr;
1319 
1320  AlignmentParameters* parnew = par->cloneFromSelected(params, cov);
1321  ali->setAlignmentParameters(parnew);
1322  parnew->setValid(true);
1323 
1324  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::calcParameters"
1325  << "End: Processing detector " << ali->id();
1326 
1327  return true;
1328 }

References HIPUserVariables::alierr, Alignable::alignmentParameters(), HIPUserVariables::alipar, AlignmentParameters::cloneFromSelected(), defaultAlignableSpecs, findAlignableSpecs(), mps_fire::i, Alignable::id(), isCollector, HIPUserVariables::jtve, HIPUserVariables::jtvj, HIPAlignableSpecificParameters::maxRelParError, HIPAlignableSpecificParameters::minNHits, HIPAlignableSpecificParameters::minRelParError, HIPUserVariables::nhit, CalibrationSummaryClient_cfi::params, Alignable::setAlignmentParameters(), AlignmentParameters::setValid(), mathSSE::sqrt(), command_line::start, theApplyCutsPerComponent, theIteration, and AlignmentParameters::userVariables().

Referenced by terminate().

◆ collectMonitorTrees()

void HIPAlignmentAlgorithm::collectMonitorTrees ( const std::vector< std::string > &  filenames)
private

Definition at line 1486 of file HIPAlignmentAlgorithm.cc.

1486  {
1487  if (!doTrackHitMonitoring)
1488  return;
1489  if (!isCollector)
1490  throw cms::Exception("LogicError") << "[HIPAlignmentAlgorithm::collectMonitorTrees] Called in non-collector mode."
1491  << std::endl;
1492 
1493  TString theTrackMonitorTreeName = Form("T1_%i", theIteration);
1494  TString theHitMonitorTreeName = Form("T1_hit_%i", theIteration);
1495 
1496  std::vector<TFile*> finputlist;
1497  TList* eventtrees = new TList;
1498  TList* hittrees = new TList;
1499  for (std::string const& filename : filenames) {
1500  TFile* finput = TFile::Open(filename.c_str(), "read");
1501  if (finput != nullptr) {
1502  TTree* tmptree;
1504  tmptree = nullptr;
1505  tmptree = (TTree*)finput->Get(theTrackMonitorTreeName);
1506  if (tmptree != nullptr)
1507  eventtrees->Add(tmptree);
1508  }
1510  tmptree = nullptr;
1511  tmptree = (TTree*)finput->Get(theHitMonitorTreeName);
1512  if (tmptree != nullptr)
1513  hittrees->Add((TTree*)finput->Get(theHitMonitorTreeName));
1514  }
1515  finputlist.push_back(finput);
1516  }
1517  }
1518 
1519  if (theTrackHitMonitorIORootFile != nullptr) { // This should never happen
1520  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::collectMonitorTrees"
1521  << "Monitor file is already open while it is not supposed to be!";
1522  delete theTrackMonitorTree;
1523  theTrackMonitorTree = nullptr;
1524  delete theHitMonitorTree;
1525  theHitMonitorTree = nullptr;
1527  }
1528  theTrackHitMonitorIORootFile = TFile::Open(theMonitorConfig.outfile.c_str(), "update");
1530  if (eventtrees->GetSize() > 0)
1531  theTrackMonitorTree = TTree::MergeTrees(eventtrees);
1532  if (hittrees->GetSize() > 0)
1533  theHitMonitorTree = TTree::MergeTrees(hittrees);
1534  // Leave it to HIPAlignmentAlgorithm::terminate to write the trees and close theTrackHitMonitorIORootFile
1535 
1536  delete hittrees;
1537  delete eventtrees;
1538  for (TFile*& finput : finputlist)
1539  finput->Close();
1540 
1541  // Rename the trees to standard names
1542  if (theTrackMonitorTree != nullptr)
1543  theTrackMonitorTree->SetName(theTrackMonitorTreeName);
1544  if (theHitMonitorTree != nullptr)
1545  theHitMonitorTree->SetName(theHitMonitorTreeName);
1546 }

References doTrackHitMonitoring, Exception, corrVsCorr::filename, HIPMonitorConfig::fillTrackHitMonitoring, HIPMonitorConfig::fillTrackMonitoring, isCollector, HIPMonitorConfig::outfile, AlCaHLTBitMon_QueryRunRegistry::string, theHitMonitorTree, theIteration, theMonitorConfig, theTrackHitMonitorIORootFile, and theTrackMonitorTree.

Referenced by collector().

◆ collector()

void HIPAlignmentAlgorithm::collector ( void  )
private

Definition at line 1331 of file HIPAlignmentAlgorithm.cc.

1331  {
1332  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1333  << "Called for iteration " << theIteration;
1334 
1335  std::vector<std::string> monitorFileList;
1336  HIPUserVariablesIORoot HIPIO;
1337 
1338  typedef int pawt_t;
1339  std::unordered_map<Alignable*, std::unordered_map<int, pawt_t>> ali_datatypecountpair_map;
1340  if (rewgtPerAli) {
1341  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1342  << "Per-alignable reweighting is turned on. Iterating over the parallel jobs to sum "
1343  "number of hits per alignable for each data type.";
1344  // Counting step for per-alignable reweighting
1345  for (int ijob = 1; ijob <= theCollectorNJobs; ijob++) {
1346  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1347  << "Pre-reading uservar for job " << ijob;
1348 
1349  std::string str = std::to_string(ijob);
1350  std::string uvfile = theCollectorPath + "/job" + str + "/" + suvarfilecore;
1351 
1352  std::vector<AlignmentUserVariables*> uvarvec =
1353  HIPIO.readHIPUserVariables(theAlignables, uvfile.c_str(), theIteration, ioerr);
1354  if (uvarvec.size() != theAlignables.size())
1355  edm::LogWarning("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1356  << "Number of alignables = " << theAlignables.size()
1357  << " is not the same as number of user variables = " << uvarvec.size()
1358  << ". A mismatch might occur!";
1359  if (ioerr != 0) {
1360  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1361  << "Could not read user variable files for job " << ijob << " in iteration "
1362  << theIteration;
1363  continue;
1364  }
1365  std::vector<AlignmentUserVariables*>::const_iterator iuvar =
1366  uvarvec.begin(); // This vector should have 1-to-1 correspondence with the alignables vector
1367  for (const auto& ali : theAlignables) {
1368  // No need for the user variables already attached to the alignables
1369  // Just count from what you read.
1370  HIPUserVariables* uvar = dynamic_cast<HIPUserVariables*>(*iuvar);
1371  if (uvar != nullptr) {
1372  int alijobdtype = uvar->datatype;
1373  pawt_t alijobnhits = uvar->nhit;
1374  if (ali_datatypecountpair_map.find(ali) == ali_datatypecountpair_map.end()) { // This is a new alignable
1375  std::unordered_map<int, pawt_t> newmap;
1376  ali_datatypecountpair_map[ali] = newmap;
1377  ali_datatypecountpair_map[ali][alijobdtype] = alijobnhits;
1378  } else { // Alignable already exists in the map
1379  std::unordered_map<int, pawt_t>& theMap = ali_datatypecountpair_map[ali];
1380  if (theMap.find(alijobdtype) == theMap.end())
1381  theMap[alijobdtype] = alijobnhits;
1382  else
1383  theMap[alijobdtype] += alijobnhits;
1384  }
1385  delete uvar; // Delete new user variables as they are added
1386  }
1387  iuvar++;
1388  } // End loop over alignables
1389  } // End loop over subjobs
1390  }
1391 
1392  for (int ijob = 1; ijob <= theCollectorNJobs; ijob++) {
1393  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1394  << "Reading uservar for job " << ijob;
1395 
1396  std::string str = std::to_string(ijob);
1397  std::string uvfile = theCollectorPath + "/job" + str + "/" + suvarfilecore;
1398 
1399  std::vector<AlignmentUserVariables*> uvarvec =
1400  HIPIO.readHIPUserVariables(theAlignables, uvfile.c_str(), theIteration, ioerr);
1401  if (uvarvec.size() != theAlignables.size())
1402  edm::LogWarning("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1403  << "Number of alignables = " << theAlignables.size()
1404  << " is not the same as number of user variables = " << uvarvec.size()
1405  << ". A mismatch might occur!";
1406 
1407  if (ioerr != 0) {
1408  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1409  << "Could not read user variable files for job " << ijob << " in iteration "
1410  << theIteration;
1411  continue;
1412  }
1413 
1414  // add
1415  std::vector<AlignmentUserVariables*> uvarvecadd;
1416  std::vector<AlignmentUserVariables*>::const_iterator iuvarnew = uvarvec.begin();
1417  for (const auto& ali : theAlignables) {
1418  AlignmentParameters* ap = ali->alignmentParameters();
1419 
1420  HIPUserVariables* uvarold = dynamic_cast<HIPUserVariables*>(ap->userVariables());
1421  HIPUserVariables* uvarnew = dynamic_cast<HIPUserVariables*>(*iuvarnew);
1422 
1423  HIPUserVariables* uvar = uvarold->clone();
1424  uvar->datatype =
1425  theDataGroup; // Set the data type of alignable to that specified for the collector job (-2 by default)
1426 
1427  if (uvarnew != nullptr) {
1428  double peraliwgt = 1;
1429  if (rewgtPerAli) {
1430  int alijobdtype = uvarnew->datatype;
1431  if (ali_datatypecountpair_map.find(ali) != ali_datatypecountpair_map.end() &&
1432  ali_datatypecountpair_map[ali].find(alijobdtype) != ali_datatypecountpair_map[ali].end()) {
1433  peraliwgt = ali_datatypecountpair_map[ali][alijobdtype];
1434  unsigned int nNonZeroTypes = 0;
1435  pawt_t sumwgts = 0;
1436  for (auto it = ali_datatypecountpair_map[ali].cbegin(); it != ali_datatypecountpair_map[ali].cend(); ++it) {
1437  sumwgts += it->second;
1438  if (it->second != pawt_t(0))
1439  nNonZeroTypes++;
1440  }
1441  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1442  << "Reweighting detector " << ali->id() << " / " << ali->alignableObjectId()
1443  << " for data type " << alijobdtype << " by " << sumwgts << "/" << peraliwgt
1444  << "/" << nNonZeroTypes;
1445  peraliwgt = ((nNonZeroTypes == 0 || peraliwgt == double(0))
1446  ? double(1)
1447  : double((double(sumwgts)) / peraliwgt / (double(nNonZeroTypes))));
1448  } else if (ali_datatypecountpair_map.find(ali) != ali_datatypecountpair_map.end())
1449  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1450  << "Could not find data type " << alijobdtype << " for detector " << ali->id()
1451  << " / " << ali->alignableObjectId();
1452  else
1453  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::collector"
1454  << "Could not find detector " << ali->id() << " / " << ali->alignableObjectId()
1455  << " in the map ali_datatypecountpair_map";
1456  }
1457 
1458  uvar->nhit = (uvarold->nhit) + (uvarnew->nhit);
1459  uvar->jtvj = (uvarold->jtvj) + peraliwgt * (uvarnew->jtvj);
1460  uvar->jtve = (uvarold->jtve) + peraliwgt * (uvarnew->jtve);
1461  uvar->alichi2 = (uvarold->alichi2) + peraliwgt * (uvarnew->alichi2);
1462  uvar->alindof = (uvarold->alindof) + (uvarnew->alindof);
1463 
1464  delete uvarnew; // Delete new user variables as they are added
1465  }
1466 
1467  uvarvecadd.push_back(uvar);
1468  iuvarnew++;
1469  }
1470 
1472 
1473  // fill Eventwise Tree
1474  if (doTrackHitMonitoring) {
1475  uvfile = theCollectorPath + "/job" + str + "/" + theMonitorConfig.outfilecore;
1476  monitorFileList.push_back(uvfile);
1477  }
1478  } // end loop on jobs
1479 
1480  // Collect monitor (eventwise and hitwise) trees
1482  collectMonitorTrees(monitorFileList);
1483 }

References HIPUserVariables::alichi2, HIPUserVariables::alindof, AlignmentParameterStore::attachUserVariables(), HIPUserVariables::clone(), collectMonitorTrees(), HIPUserVariables::datatype, doTrackHitMonitoring, ioerr, HIPUserVariables::jtve, HIPUserVariables::jtvj, HIPUserVariables::nhit, HIPMonitorConfig::outfilecore, HIPUserVariablesIORoot::readHIPUserVariables(), rewgtPerAli, str, AlCaHLTBitMon_QueryRunRegistry::string, suvarfilecore, theAlignables, theAlignmentParameterStore, theCollectorNJobs, theCollectorPath, theDataGroup, theIteration, theMonitorConfig, and AlignmentParameters::userVariables().

Referenced by startNewLoop().

◆ fillAlignablesMonitor()

void HIPAlignmentAlgorithm::fillAlignablesMonitor ( const edm::EventSetup setup)
private

Definition at line 1154 of file HIPAlignmentAlgorithm.cc.

1154  {
1155  if (theAlignablesMonitorIORootFile == (TFile*)nullptr)
1156  return;
1157  using std::setw;
1159 
1160  int naligned = 0;
1161 
1162  //Retrieve tracker topology from geometry
1163  edm::ESHandle<TrackerTopology> tTopoHandle;
1164  // iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
1165  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
1166 
1167  const TrackerTopology* const tTopo = tTopoHandle.product();
1168 
1169  for (const auto& ali : theAlignables) {
1170  AlignmentParameters* dap = ali->alignmentParameters();
1171 
1172  // consider only those parameters classified as 'valid'
1173  if (dap->isValid()) {
1174  // get number of hits from user variable
1175  HIPUserVariables* uservar = dynamic_cast<HIPUserVariables*>(dap->userVariables());
1176  m2_Nhit = uservar->nhit;
1177  m2_datatype = uservar->datatype;
1178 
1179  // get type/layer
1180  std::pair<int, int> tl = theAlignmentParameterStore->typeAndLayer(ali, tTopo);
1181  m2_Type = tl.first;
1182  m2_Layer = tl.second;
1183 
1184  // get identifier (as for IO)
1185  m2_Id = ali->id();
1186  m2_ObjId = ali->alignableObjectId();
1187 
1188  // get position
1189  GlobalPoint pos = ali->surface().position();
1190  m2_Xpos = pos.x();
1191  m2_Ypos = pos.y();
1192  m2_Zpos = pos.z();
1193 
1194  m2_surfDef.clear();
1195  {
1196  std::vector<std::pair<int, SurfaceDeformation*>> dali_id_pairs;
1197  SurfaceDeformation* dali_obj = nullptr;
1199  std::vector<double> dali;
1200  if (1 == ali->surfaceDeformationIdPairs(dali_id_pairs)) {
1201  dali_obj = dali_id_pairs[0].second;
1202  dali = dali_obj->parameters();
1204  }
1205  for (auto& dit : dali)
1206  m2_surfDef.push_back((float)dit);
1207  m2_dtype = dtype;
1208  m2_nsurfdef = m2_surfDef.size();
1209  }
1210 
1211  if (verbose) {
1212  AlgebraicVector pars = dap->parameters();
1213  edm::LogVerbatim("Alignment") << "------------------------------------------------------------------------\n"
1214  << " ALIGNABLE: " << setw(6) << naligned << '\n'
1215  << "hits: " << setw(4) << m2_Nhit << " type: " << setw(4) << m2_Type
1216  << " layer: " << setw(4) << m2_Layer << " id: " << setw(4) << m2_Id
1217  << " objId: " << setw(4) << m2_ObjId << '\n'
1218  << std::fixed << std::setprecision(5) << "x,y,z: " << setw(12) << m2_Xpos
1219  << setw(12) << m2_Ypos << setw(12) << m2_Zpos
1220  << "\nDeformations type, nDeformations: " << setw(12) << m2_dtype << setw(12)
1221  << m2_nsurfdef << '\n'
1222  << "params: " << setw(12) << pars[0] << setw(12) << pars[1] << setw(12) << pars[2]
1223  << setw(12) << pars[3] << setw(12) << pars[4] << setw(12) << pars[5];
1224  }
1225 
1226  naligned++;
1227  if (theAlignablesMonitorTree != nullptr)
1228  theAlignablesMonitorTree->Fill();
1229  }
1230  }
1231 }

References HIPUserVariables::datatype, runTauDisplay::dtype, alignBH_cfg::fixed, edm::EventSetup::get(), get, AlignmentParameters::isValid(), SurfaceDeformationFactory::kNoDeformations, m2_datatype, m2_dtype, m2_Id, m2_Layer, m2_Nhit, m2_nsurfdef, m2_ObjId, m2_surfDef, m2_Type, m2_Xpos, m2_Ypos, m2_Zpos, HIPUserVariables::nhit, SurfaceDeformation::parameters(), AlignmentParameters::parameters(), edm::ESHandle< T >::product(), theAlignables, theAlignablesMonitorIORootFile, theAlignablesMonitorTree, theAlignmentParameterStore, SurfaceDeformation::type(), AlignmentParameterStore::typeAndLayer(), AlignmentParameters::userVariables(), and verbose.

Referenced by terminate().

◆ findAlignableSpecs()

HIPAlignableSpecificParameters * HIPAlignmentAlgorithm::findAlignableSpecs ( const Alignable ali)
private

Definition at line 1549 of file HIPAlignmentAlgorithm.cc.

1549  {
1550  if (ali != nullptr) {
1551  for (std::vector<HIPAlignableSpecificParameters>::iterator it = theAlignableSpecifics.begin();
1552  it != theAlignableSpecifics.end();
1553  it++) {
1554  if (it->matchAlignable(ali))
1555  return &(*it);
1556  }
1557  edm::LogInfo("Alignment") << "[HIPAlignmentAlgorithm::findAlignableSpecs] Alignment object with id " << ali->id()
1558  << " / " << ali->alignableObjectId() << " could not be found. Returning default.";
1559  }
1560  return &defaultAlignableSpecs;
1561 }

References Alignable::alignableObjectId(), defaultAlignableSpecs, Alignable::id(), and theAlignableSpecifics.

Referenced by calcParameters(), and run().

◆ initialize()

void HIPAlignmentAlgorithm::initialize ( const edm::EventSetup setup,
AlignableTracker tracker,
AlignableMuon muon,
AlignableExtras extras,
AlignmentParameterStore store 
)
overridevirtual

Call at beginning of job.

Implements AlignmentAlgorithmBase.

Definition at line 127 of file HIPAlignmentAlgorithm.cc.

131  {
132  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::initialize"
133  << "Initializing...";
134 
135  alignableObjectId_ = std::make_unique<AlignableObjectId>(AlignableObjectId::commonObjectIdProvider(tracker, muon));
136 
137  for (const auto& level : surveyResiduals_)
138  theLevels.push_back(alignableObjectId_->stringToId(level));
139 
140  edm::ESHandle<Alignments> globalPositionRcd;
141 
142  const edm::ValidityInterval& validity = setup.get<TrackerAlignmentRcd>().validityInterval();
143  const edm::IOVSyncValue first1 = validity.first();
144  unsigned int firstrun = first1.eventID().run();
145  if (themultiIOV) {
146  if (theIOVrangeSet.size() != 1) {
147  bool findMatchIOV = false;
148  for (unsigned int iovl = 0; iovl < theIOVrangeSet.size(); iovl++) {
149  if (firstrun == theIOVrangeSet.at(iovl)) {
150  std::string iovapp = std::to_string(firstrun);
151  iovapp.append(".root");
152  iovapp.insert(0, "_");
153  salignedfile.replace(salignedfile.end() - 5, salignedfile.end(), iovapp);
154  siterationfile.replace(siterationfile.end() - 5, siterationfile.end(), iovapp);
155  //sparameterfile.replace(sparameterfile.end()-5, sparameterfile.end(),iovapp);
156  if (isCollector) {
157  outfile2.replace(outfile2.end() - 5, outfile2.end(), iovapp);
158  ssurveyfile.replace(ssurveyfile.end() - 5, ssurveyfile.end(), iovapp);
159  suvarfile.replace(suvarfile.end() - 5, suvarfile.end(), iovapp);
160  }
161 
162  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::initialize"
163  << "Found the IOV file matching IOV first run " << firstrun;
164  findMatchIOV = true;
165  break;
166  }
167  }
168  if (!findMatchIOV)
169  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::initialize"
170  << "Didn't find the IOV file matching IOV first run " << firstrun
171  << " from the validity interval";
172  } else {
173  std::string iovapp = std::to_string(theIOVrangeSet.at(0));
174  iovapp.append(".root");
175  iovapp.insert(0, "_");
176  salignedfile.replace(salignedfile.end() - 5, salignedfile.end(), iovapp);
177  siterationfile.replace(siterationfile.end() - 5, siterationfile.end(), iovapp);
178  }
179  }
180 
181  // accessor Det->AlignableDet
182  theAlignableDetAccessor = std::make_unique<AlignableNavigator>(extras, tracker, muon);
183  if (extras != nullptr)
184  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::initialize"
185  << "AlignableNavigator initialized with AlignableExtras";
186 
187  // set alignmentParameterStore
189 
190  // get alignables
192 
193  // Config flags that specify different detectors
194  {
195  AlignmentParameterSelector selector(tracker, muon, extras);
196 
197  // APE parameters, clear if necessary
198  theAPEParameters.clear();
199  if (theApplyAPE) {
200  for (std::vector<edm::ParameterSet>::const_iterator setiter = theAPEParameterSet.begin();
201  setiter != theAPEParameterSet.end();
202  ++setiter) {
203  align::Alignables alignables;
204 
205  selector.clear();
206  edm::ParameterSet selectorPSet = setiter->getParameter<edm::ParameterSet>("Selector");
207  std::vector<std::string> alignParams = selectorPSet.getParameter<std::vector<std::string>>("alignParams");
208  if (alignParams.size() == 1 && alignParams[0] == std::string("selected"))
209  alignables = theAlignables;
210  else {
211  selector.addSelections(selectorPSet);
212  alignables = selector.selectedAlignables();
213  }
214 
215  std::vector<double> apeSPar = setiter->getParameter<std::vector<double>>("apeSPar");
216  std::vector<double> apeRPar = setiter->getParameter<std::vector<double>>("apeRPar");
217  std::string function = setiter->getParameter<std::string>("function");
218 
219  if (apeSPar.size() != 3 || apeRPar.size() != 3)
220  throw cms::Exception("BadConfig") << "apeSPar and apeRPar must have 3 values each" << std::endl;
221 
222  for (std::vector<double>::const_iterator i = apeRPar.begin(); i != apeRPar.end(); ++i)
223  apeSPar.push_back(*i);
224 
225  if (function == std::string("linear"))
226  apeSPar.push_back(0); // c.f. note in calcAPE
227  else if (function == std::string("exponential"))
228  apeSPar.push_back(1); // c.f. note in calcAPE
229  else if (function == std::string("step"))
230  apeSPar.push_back(2); // c.f. note in calcAPE
231  else
232  throw cms::Exception("BadConfig")
233  << "APE function must be \"linear\", \"exponential\", or \"step\"." << std::endl;
234 
235  theAPEParameters.push_back(std::make_pair(alignables, apeSPar));
236  }
237  }
238 
239  // Relative error per component instead of overall relative error
240  theAlignableSpecifics.clear();
242  for (std::vector<edm::ParameterSet>::const_iterator setiter = theCutsPerComponent.begin();
243  setiter != theCutsPerComponent.end();
244  ++setiter) {
245  align::Alignables alignables;
246 
247  selector.clear();
248  edm::ParameterSet selectorPSet = setiter->getParameter<edm::ParameterSet>("Selector");
249  std::vector<std::string> alignParams = selectorPSet.getParameter<std::vector<std::string>>("alignParams");
250  if (alignParams.size() == 1 && alignParams[0] == std::string("selected"))
251  alignables = theAlignables;
252  else {
253  selector.addSelections(selectorPSet);
254  alignables = selector.selectedAlignables();
255  }
256 
257  double minRelParError = setiter->getParameter<double>("minRelParError");
258  double maxRelParError = setiter->getParameter<double>("maxRelParError");
259  int minNHits = setiter->getParameter<int>("minNHits");
260  double maxHitPull = setiter->getParameter<double>("maxHitPull");
261  bool applyPixelProbCut = setiter->getParameter<bool>("applyPixelProbCut");
262  bool usePixelProbXYOrProbQ = setiter->getParameter<bool>("usePixelProbXYOrProbQ");
263  double minPixelProbXY = setiter->getParameter<double>("minPixelProbXY");
264  double maxPixelProbXY = setiter->getParameter<double>("maxPixelProbXY");
265  double minPixelProbQ = setiter->getParameter<double>("minPixelProbQ");
266  double maxPixelProbQ = setiter->getParameter<double>("maxPixelProbQ");
267  for (auto& ali : alignables) {
268  HIPAlignableSpecificParameters alispecs(ali);
269  alispecs.minRelParError = minRelParError;
270  alispecs.maxRelParError = maxRelParError;
271  alispecs.minNHits = minNHits;
272  alispecs.maxHitPull = maxHitPull;
273 
274  alispecs.applyPixelProbCut = applyPixelProbCut;
275  alispecs.usePixelProbXYOrProbQ = usePixelProbXYOrProbQ;
276  alispecs.minPixelProbXY = minPixelProbXY;
277  alispecs.maxPixelProbXY = maxPixelProbXY;
278  alispecs.minPixelProbQ = minPixelProbQ;
279  alispecs.maxPixelProbQ = maxPixelProbQ;
280 
281  theAlignableSpecifics.push_back(alispecs);
282  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::initialize"
283  << "Alignment specifics acquired for detector " << alispecs.id() << " / "
284  << alispecs.objId() << ":\n"
285  << " - minRelParError = " << alispecs.minRelParError << "\n"
286  << " - maxRelParError = " << alispecs.maxRelParError << "\n"
287  << " - minNHits = " << alispecs.minNHits << "\n"
288  << " - maxHitPull = " << alispecs.maxHitPull << "\n"
289  << " - applyPixelProbCut = " << alispecs.applyPixelProbCut << "\n"
290  << " - usePixelProbXYOrProbQ = " << alispecs.usePixelProbXYOrProbQ << "\n"
291  << " - minPixelProbXY = " << alispecs.minPixelProbXY << "\n"
292  << " - maxPixelProbXY = " << alispecs.maxPixelProbXY << "\n"
293  << " - minPixelProbQ = " << alispecs.minPixelProbQ << "\n"
294  << " - maxPixelProbQ = " << alispecs.maxPixelProbQ;
295  }
296  }
297  }
298  }
299 }

References AlignmentParameterSelector::addSelections(), alignableObjectId_, AlignmentParameterStore::alignables(), ALCARECOPromptCalibProdSiPixelAli0T_cff::alignParams, HIPAlignableSpecificParameters::applyPixelProbCut, AlignmentParameterSelector::clear(), AlignableObjectId::commonObjectIdProvider(), edm::IOVSyncValue::eventID(), Exception, edm::ValidityInterval::first(), writedatasetfile::firstrun, edm::ParameterSet::getParameter(), mps_fire::i, HIPAlignableSpecificParameters::id(), isCollector, personalPlayback::level, HIPAlignableSpecificParameters::maxHitPull, HIPAlignableSpecificParameters::maxPixelProbQ, HIPAlignableSpecificParameters::maxPixelProbXY, HIPAlignableSpecificParameters::maxRelParError, FastTrackerRecHitCombiner_cfi::minNHits, HIPAlignableSpecificParameters::minNHits, HIPAlignableSpecificParameters::minPixelProbQ, HIPAlignableSpecificParameters::minPixelProbXY, HIPAlignableSpecificParameters::minRelParError, HIPAlignableSpecificParameters::objId(), outfile2, edm::EventID::run(), salignedfile, AlignmentParameterSelector::selectedAlignables(), singleTopDQM_cfi::setup, siterationfile, ssurveyfile, AlCaHLTBitMon_QueryRunRegistry::string, surveyResiduals_, suvarfile, theAlignableDetAccessor, theAlignables, theAlignableSpecifics, theAlignmentParameterStore, theAPEParameters, theAPEParameterSet, theApplyAPE, theApplyCutsPerComponent, theCutsPerComponent, theIOVrangeSet, theLevels, themultiIOV, PbPb_ZMuSkimMuonDPG_cff::tracker, and HIPAlignableSpecificParameters::usePixelProbXYOrProbQ.

◆ processHit1D()

bool HIPAlignmentAlgorithm::processHit1D ( const AlignableDetOrUnitPtr alidet,
const Alignable ali,
const HIPAlignableSpecificParameters alispecifics,
const TrajectoryStateOnSurface tsos,
const TrackingRecHit hit,
double  hitwt 
)
private

Definition at line 519 of file HIPAlignmentAlgorithm.cc.

524  {
525  static const unsigned int hitDim = 1;
526  if (hitwt == 0.)
527  return false;
528 
529  // get trajectory impact point
530  LocalPoint alvec = tsos.localPosition();
531  AlgebraicVector pos(hitDim);
532  pos[0] = alvec.x();
533 
534  // get impact point covariance
535  AlgebraicSymMatrix ipcovmat(hitDim);
536  ipcovmat[0][0] = tsos.localError().positionError().xx();
537 
538  // get hit local position and covariance
539  AlgebraicVector coor(hitDim);
540  coor[0] = hit->localPosition().x();
541 
542  AlgebraicSymMatrix covmat(hitDim);
543  covmat[0][0] = hit->localPositionError().xx();
544 
545  // add hit and impact point covariance matrices
546  covmat = covmat + ipcovmat;
547 
548  // calculate the x pull of this hit
549  double xpull = 0.;
550  if (covmat[0][0] != 0.)
551  xpull = (pos[0] - coor[0]) / sqrt(fabs(covmat[0][0]));
552 
553  // get Alignment Parameters
555  HIPUserVariables* uservar = dynamic_cast<HIPUserVariables*>(params->userVariables());
556  uservar->datatype = theDataGroup;
557  // get derivatives
558  AlgebraicMatrix derivs2D = params->selectedDerivatives(tsos, alidet);
559  // calculate user parameters
560  int npar = derivs2D.num_row();
561  AlgebraicMatrix derivs(npar, hitDim, 0); // This is jT
562 
563  for (int ipar = 0; ipar < npar; ipar++) {
564  for (unsigned int idim = 0; idim < hitDim; idim++) {
565  derivs[ipar][idim] = derivs2D[ipar][idim];
566  }
567  }
568 
569  // invert covariance matrix
570  int ierr;
571  covmat.invert(ierr);
572  if (ierr != 0) {
573  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::processHit1D"
574  << "Cov. matrix inversion failed!";
575  return false;
576  }
577 
578  double maxHitPullThreshold =
580  bool useThisHit = (maxHitPullThreshold < 0.);
581  useThisHit |= (fabs(xpull) < maxHitPullThreshold);
582  if (!useThisHit) {
583  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::processHit2D"
584  << "Hit pull (x) " << xpull << " fails the cut " << maxHitPullThreshold;
585  return false;
586  }
587 
588  AlgebraicMatrix covtmp(covmat);
589  AlgebraicMatrix jtvjtmp(derivs * covtmp * derivs.T());
590  AlgebraicSymMatrix thisjtvj(npar);
591  AlgebraicVector thisjtve(npar);
592  thisjtvj.assign(jtvjtmp);
593  thisjtve = derivs * covmat * (pos - coor);
594 
595  AlgebraicVector hitresidual(hitDim);
596  hitresidual[0] = (pos[0] - coor[0]);
597 
598  AlgebraicMatrix hitresidualT;
599  hitresidualT = hitresidual.T();
600 
601  uservar->jtvj += hitwt * thisjtvj;
602  uservar->jtve += hitwt * thisjtve;
603  uservar->nhit++;
604 
605  //for alignable chi squared
606  float thischi2;
607  thischi2 = hitwt * (hitresidualT * covmat * hitresidual)[0];
608 
609  if (verbose && (thischi2 / static_cast<float>(uservar->nhit)) > 10.)
610  edm::LogWarning("Alignment") << "[HIPAlignmentAlgorithm::processHit1D] Added to Chi2 the number " << thischi2
611  << " having " << uservar->nhit << " ndof"
612  << ", X-resid " << hitresidual[0] << ", Cov^-1 matr (covmat):"
613  << " [0][0] = " << covmat[0][0];
614 
615  uservar->alichi2 += thischi2;
616  uservar->alindof += hitDim;
617 
618  return true;
619 }

References HIPUserVariables::alichi2, Alignable::alignmentParameters(), HIPUserVariables::alindof, HIPUserVariables::datatype, defaultAlignableSpecs, HIPUserVariables::jtve, HIPUserVariables::jtvj, TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), HIPAlignableSpecificParameters::maxHitPull, HIPUserVariables::nhit, CalibrationSummaryClient_cfi::params, LocalTrajectoryError::positionError(), mathSSE::sqrt(), theApplyCutsPerComponent, theDataGroup, verbose, PV3DBase< T, PVType, FrameType >::x(), hit::x, and LocalError::xx().

Referenced by run().

◆ processHit2D()

bool HIPAlignmentAlgorithm::processHit2D ( const AlignableDetOrUnitPtr alidet,
const Alignable ali,
const HIPAlignableSpecificParameters alispecifics,
const TrajectoryStateOnSurface tsos,
const TrackingRecHit hit,
double  hitwt 
)
private

Definition at line 621 of file HIPAlignmentAlgorithm.cc.

626  {
627  static const unsigned int hitDim = 2;
628  if (hitwt == 0.)
629  return false;
630 
631  // get trajectory impact point
632  LocalPoint alvec = tsos.localPosition();
633  AlgebraicVector pos(hitDim);
634  pos[0] = alvec.x();
635  pos[1] = alvec.y();
636 
637  // get impact point covariance
638  AlgebraicSymMatrix ipcovmat(hitDim);
639  ipcovmat[0][0] = tsos.localError().positionError().xx();
640  ipcovmat[1][1] = tsos.localError().positionError().yy();
641  ipcovmat[0][1] = tsos.localError().positionError().xy();
642 
643  // get hit local position and covariance
644  AlgebraicVector coor(hitDim);
645  coor[0] = hit->localPosition().x();
646  coor[1] = hit->localPosition().y();
647 
648  AlgebraicSymMatrix covmat(hitDim);
649  covmat[0][0] = hit->localPositionError().xx();
650  covmat[1][1] = hit->localPositionError().yy();
651  covmat[0][1] = hit->localPositionError().xy();
652 
653  // add hit and impact point covariance matrices
654  covmat = covmat + ipcovmat;
655 
656  // calculate the x pull and y pull of this hit
657  double xpull = 0.;
658  double ypull = 0.;
659  if (covmat[0][0] != 0.)
660  xpull = (pos[0] - coor[0]) / sqrt(fabs(covmat[0][0]));
661  if (covmat[1][1] != 0.)
662  ypull = (pos[1] - coor[1]) / sqrt(fabs(covmat[1][1]));
663 
664  // get Alignment Parameters
666  HIPUserVariables* uservar = dynamic_cast<HIPUserVariables*>(params->userVariables());
667  uservar->datatype = theDataGroup;
668  // get derivatives
669  AlgebraicMatrix derivs2D = params->selectedDerivatives(tsos, alidet);
670  // calculate user parameters
671  int npar = derivs2D.num_row();
672  AlgebraicMatrix derivs(npar, hitDim, 0); // This is jT
673 
674  for (int ipar = 0; ipar < npar; ipar++) {
675  for (unsigned int idim = 0; idim < hitDim; idim++) {
676  derivs[ipar][idim] = derivs2D[ipar][idim];
677  }
678  }
679 
680  // invert covariance matrix
681  int ierr;
682  covmat.invert(ierr);
683  if (ierr != 0) {
684  edm::LogError("Alignment") << "@SUB=HIPAlignmentAlgorithm::processHit2D"
685  << "Cov. matrix inversion failed!";
686  return false;
687  }
688 
689  double maxHitPullThreshold =
691  bool useThisHit = (maxHitPullThreshold < 0.);
692  useThisHit |= (fabs(xpull) < maxHitPullThreshold && fabs(ypull) < maxHitPullThreshold);
693  if (!useThisHit) {
694  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::processHit2D"
695  << "Hit pull (x,y) " << xpull << " , " << ypull << " fails the cut "
696  << maxHitPullThreshold;
697  return false;
698  }
699 
700  AlgebraicMatrix covtmp(covmat);
701  AlgebraicMatrix jtvjtmp(derivs * covtmp * derivs.T());
702  AlgebraicSymMatrix thisjtvj(npar);
703  AlgebraicVector thisjtve(npar);
704  thisjtvj.assign(jtvjtmp);
705  thisjtve = derivs * covmat * (pos - coor);
706 
707  AlgebraicVector hitresidual(hitDim);
708  hitresidual[0] = (pos[0] - coor[0]);
709  hitresidual[1] = (pos[1] - coor[1]);
710 
711  AlgebraicMatrix hitresidualT;
712  hitresidualT = hitresidual.T();
713 
714  uservar->jtvj += hitwt * thisjtvj;
715  uservar->jtve += hitwt * thisjtve;
716  uservar->nhit++;
717 
718  //for alignable chi squared
719  float thischi2;
720  thischi2 = hitwt * (hitresidualT * covmat * hitresidual)[0];
721 
722  if (verbose && (thischi2 / static_cast<float>(uservar->nhit)) > 10.)
723  edm::LogWarning("Alignment") << "[HIPAlignmentAlgorithm::processHit2D] Added to Chi2 the number " << thischi2
724  << " having " << uservar->nhit << " ndof"
725  << ", X-resid " << hitresidual[0] << ", Y-resid " << hitresidual[1]
726  << ", Cov^-1 matr (covmat):"
727  << " [0][0] = " << covmat[0][0] << " [0][1] = " << covmat[0][1]
728  << " [1][0] = " << covmat[1][0] << " [1][1] = " << covmat[1][1];
729 
730  uservar->alichi2 += thischi2;
731  uservar->alindof += hitDim;
732 
733  return true;
734 }

References HIPUserVariables::alichi2, Alignable::alignmentParameters(), HIPUserVariables::alindof, HIPUserVariables::datatype, defaultAlignableSpecs, HIPUserVariables::jtve, HIPUserVariables::jtvj, TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), HIPAlignableSpecificParameters::maxHitPull, HIPUserVariables::nhit, CalibrationSummaryClient_cfi::params, LocalTrajectoryError::positionError(), mathSSE::sqrt(), theApplyCutsPerComponent, theDataGroup, verbose, PV3DBase< T, PVType, FrameType >::x(), hit::x, LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), hit::y, and LocalError::yy().

Referenced by run().

◆ readIterationFile()

int HIPAlignmentAlgorithm::readIterationFile ( std::string  filename)
private

Definition at line 992 of file HIPAlignmentAlgorithm.cc.

992  {
993  int result;
994 
995  std::ifstream inIterFile(filename.c_str(), std::ios::in);
996  if (!inIterFile) {
997  edm::LogError("Alignment") << "[HIPAlignmentAlgorithm::readIterationFile] ERROR! "
998  << "Unable to open Iteration file";
999  result = -1;
1000  } else {
1001  inIterFile >> result;
1002  edm::LogWarning("Alignment") << "[HIPAlignmentAlgorithm::readIterationFile] "
1003  << "Read last iteration number from file: " << result;
1004  }
1005  inIterFile.close();
1006 
1007  return result;
1008 }

References corrVsCorr::filename, recoMuon::in, and mps_fire::result.

Referenced by startNewLoop().

◆ run()

void HIPAlignmentAlgorithm::run ( const edm::EventSetup setup,
const EventInfo eventInfo 
)
overridevirtual

Run the algorithm.

Implements AlignmentAlgorithmBase.

Definition at line 737 of file HIPAlignmentAlgorithm.cc.

737  {
738  if (isCollector)
739  return;
740 
741  TrajectoryStateCombiner tsoscomb;
742 
744 
745  // loop over tracks
746  const ConstTrajTrackPairCollection& tracks = eventInfo.trajTrackPairs();
747  for (ConstTrajTrackPairCollection::const_iterator it = tracks.begin(); it != tracks.end(); ++it) {
748  const Trajectory* traj = (*it).first;
749  const reco::Track* track = (*it).second;
750 
751  float pt = track->pt();
752  float eta = track->eta();
753  float phi = track->phi();
754  float p = track->p();
755  float chi2n = track->normalizedChi2();
756  int nhit = track->numberOfValidHits();
757  float d0 = track->d0();
758  float dz = track->dz();
759 
760  int nhpxb = track->hitPattern().numberOfValidPixelBarrelHits();
761  int nhpxf = track->hitPattern().numberOfValidPixelEndcapHits();
762  int nhtib = track->hitPattern().numberOfValidStripTIBHits();
763  int nhtob = track->hitPattern().numberOfValidStripTOBHits();
764  int nhtid = track->hitPattern().numberOfValidStripTIDHits();
765  int nhtec = track->hitPattern().numberOfValidStripTECHits();
766 
767  if (verbose)
768  edm::LogInfo("Alignment") << "New track pt,eta,phi,chi2n,hits: " << pt << "," << eta << "," << phi << "," << chi2n
769  << "," << nhit;
770 
771  double ihitwt = 1;
772  double trkwt = 1;
773  if (trackWt) {
774  trkwt = Scale;
775  // Reweight by the specified eta distribution
776  if (uniEta)
777  trkwt *= theEtaFormula->Eval(fabs(eta));
778  }
779  if (trackPs) {
780  double r = gRandom->Rndm();
781  if (trkwt < r)
782  continue;
783  } else if (trackWt)
784  ihitwt = trkwt;
785 
786  // fill track parameters in root tree
787  {
788  theMonitorConfig.trackmonitorvars.m_Nhits.push_back(nhit);
794  theMonitorConfig.trackmonitorvars.m_nhPXB.push_back(nhpxb);
795  theMonitorConfig.trackmonitorvars.m_nhPXF.push_back(nhpxf);
796  theMonitorConfig.trackmonitorvars.m_nhTIB.push_back(nhtib);
797  theMonitorConfig.trackmonitorvars.m_nhTOB.push_back(nhtob);
798  theMonitorConfig.trackmonitorvars.m_nhTID.push_back(nhtid);
799  theMonitorConfig.trackmonitorvars.m_nhTEC.push_back(nhtec);
802  theMonitorConfig.trackmonitorvars.m_wt.push_back(ihitwt);
803  }
804 
805  std::vector<const TransientTrackingRecHit*> hitvec;
806  std::vector<TrajectoryStateOnSurface> tsosvec;
807 
808  // loop over measurements
809  std::vector<TrajectoryMeasurement> measurements = traj->measurements();
810  for (std::vector<TrajectoryMeasurement>::iterator im = measurements.begin(); im != measurements.end(); ++im) {
811  TrajectoryMeasurement meas = *im;
812 
813  // const TransientTrackingRecHit* ttrhit = &(*meas.recHit());
814  // const TrackingRecHit *hit = ttrhit->hit();
815  const TransientTrackingRecHit* hit = &(*meas.recHit());
816 
817  if (hit->isValid() && theAlignableDetAccessor->detAndSubdetInMap(hit->geographicalId())) {
818  // this is the updated state (including the current hit)
819  // TrajectoryStateOnSurface tsos=meas.updatedState();
820  // combine fwd and bwd predicted state to get state
821  // which excludes current hit
822 
824  if (eventInfo.clusterValueMap()) {
825  // check from the PrescalingMap if the hit was taken.
826  // If not skip to the next TM
827  // bool hitTaken=false;
828  AlignmentClusterFlag myflag;
829 
830  int subDet = hit->geographicalId().subdetId();
831  //take the actual RecHit out of the Transient one
832  const TrackingRecHit* rechit = hit->hit();
833  if (subDet > 2) { // AM: if possible use enum instead of hard-coded value
834  const std::type_info& type = typeid(*rechit);
835 
836  if (type == typeid(SiStripRecHit1D)) {
837  const SiStripRecHit1D* stripHit1D = dynamic_cast<const SiStripRecHit1D*>(rechit);
838  if (stripHit1D) {
839  SiStripRecHit1D::ClusterRef stripclust(stripHit1D->cluster());
840  // myflag=PrescMap[stripclust];
841  myflag = (*eventInfo.clusterValueMap())[stripclust];
842  } else
843  edm::LogError("HIPAlignmentAlgorithm")
844  << "ERROR in <HIPAlignmentAlgorithm::run>: Dynamic cast of Strip RecHit failed! "
845  << "TypeId of the RecHit: " << className(*hit);
846  } //end if type = SiStripRecHit1D
847  else if (type == typeid(SiStripRecHit2D)) {
848  const SiStripRecHit2D* stripHit2D = dynamic_cast<const SiStripRecHit2D*>(rechit);
849  if (stripHit2D) {
850  SiStripRecHit2D::ClusterRef stripclust(stripHit2D->cluster());
851  // myflag=PrescMap[stripclust];
852  myflag = (*eventInfo.clusterValueMap())[stripclust];
853  } else
854  edm::LogError("HIPAlignmentAlgorithm")
855  << "ERROR in <HIPAlignmentAlgorithm::run>: Dynamic cast of Strip RecHit failed! "
856  << "TypeId of the TTRH: " << className(*hit);
857  } //end if type == SiStripRecHit2D
858  } //end if hit from strips
859  else {
860  const SiPixelRecHit* pixelhit = dynamic_cast<const SiPixelRecHit*>(rechit);
861  if (pixelhit) {
862  SiPixelClusterRefNew pixelclust(pixelhit->cluster());
863  // myflag=PrescMap[pixelclust];
864  myflag = (*eventInfo.clusterValueMap())[pixelclust];
865  } else
866  edm::LogError("HIPAlignmentAlgorithm")
867  << "ERROR in <HIPAlignmentAlgorithm::run>: Dynamic cast of Pixel RecHit failed! "
868  << "TypeId of the TTRH: " << className(*hit);
869  } //end 'else' it is a pixel hit
870  if (!myflag.isTaken())
871  continue;
872  } //end if Prescaled Hits
874 
876 
877  if (tsos.isValid()) {
878  hitvec.push_back(hit);
879  tsosvec.push_back(tsos);
880  }
881 
882  } //hit valid
883  }
884 
885  // transform RecHit vector to AlignableDet vector
886  std::vector<AlignableDetOrUnitPtr> alidetvec = theAlignableDetAccessor->alignablesFromHits(hitvec);
887 
888  // get concatenated alignment parameters for list of alignables
890 
891  std::vector<TrajectoryStateOnSurface>::const_iterator itsos = tsosvec.begin();
892  std::vector<const TransientTrackingRecHit*>::const_iterator ihit = hitvec.begin();
893 
894  // loop over vectors(hit,tsos)
895  while (itsos != tsosvec.end()) {
896  // get AlignableDet for this hit
897  const GeomDet* det = (*ihit)->det();
898  // int subDet= (*ihit)->geographicalId().subdetId();
899  uint32_t nhitDim = (*ihit)->dimension();
900 
901  AlignableDetOrUnitPtr alidet = theAlignableDetAccessor->alignableFromGeomDet(det);
902 
903  // get relevant Alignable
904  Alignable* ali = aap.alignableFromAlignableDet(alidet);
905 
906  if (ali != nullptr) {
907  const HIPAlignableSpecificParameters* alispecifics = findAlignableSpecs(ali);
908  const TrajectoryStateOnSurface& tsos = *itsos;
909 
910  // LocalVector v = tsos.localDirection();
911  // double proj_z = v.dot(LocalVector(0,0,1));
912 
913  //In fact, sin_theta=Abs(mom_z)
914  double mom_x = tsos.localDirection().x();
915  double mom_y = tsos.localDirection().y();
916  double mom_z = tsos.localDirection().z();
917  double sin_theta = TMath::Abs(mom_z) / sqrt(pow(mom_x, 2) + pow(mom_y, 2) + pow(mom_z, 2));
918  double angle = TMath::ASin(sin_theta);
919  double alihitwt = ihitwt;
920 
921  //Make cut on hit impact angle, reduce collision hits perpendicular to modules
922  if (IsCollision) {
923  if (angle > col_cut)
924  alihitwt = 0;
925  } else {
926  if (angle < cos_cut)
927  alihitwt = 0;
928  }
929 
930  // Fill hit monitor variables
934 
935  // Check pixel XY and Q probabilities
936  if ((*ihit)->hit() != nullptr) {
937  const SiPixelRecHit* pixhit = dynamic_cast<const SiPixelRecHit*>((*ihit)->hit());
938  if (pixhit != nullptr) {
941  // Prob X, Y are deprecated
945  if (alispecifics->applyPixelProbCut) {
946  bool probXYgood = (theMonitorConfig.hitmonitorvars.m_probXY >= alispecifics->minPixelProbXY &&
948  bool probQgood = (theMonitorConfig.hitmonitorvars.m_probQ >= alispecifics->minPixelProbQ &&
950  bool probXYQgood;
951  if (alispecifics->usePixelProbXYOrProbQ)
952  probXYQgood = (probXYgood || probQgood);
953  else
954  probXYQgood = (probXYgood && probQgood);
955  if (!probXYQgood)
956  alihitwt = 0;
957  }
958  }
959  }
960  }
961 
963  bool hitProcessed = false;
964  switch (nhitDim) {
965  case 1:
966  hitProcessed = processHit1D(alidet, ali, alispecifics, tsos, *ihit, alihitwt);
967  break;
968  case 2:
969  hitProcessed = processHit2D(alidet, ali, alispecifics, tsos, *ihit, alihitwt);
970  break;
971  default:
972  edm::LogError("HIPAlignmentAlgorithm")
973  << "ERROR in <HIPAlignmentAlgorithm::run>: Number of hit dimensions = " << nhitDim
974  << " is not supported!" << std::endl;
975  break;
976  }
979  }
980 
981  itsos++;
982  ihit++;
983  }
984  } // end of track loop
985 
986  // fill eventwise root tree (with prescale defined in pset)
989 }

References Abs(), CompositeAlignmentParameters::alignableFromAlignableDet(), angle(), HIPAlignableSpecificParameters::applyPixelProbCut, TrajectoryMeasurement::backwardPredictedState(), HIPMonitorConfig::checkNevents(), HIPMonitorConfig::checkNhits(), chi2n, className(), SiStripRecHit1D::cluster(), SiStripRecHit2D::cluster(), col_cut, TrajectoryStateCombiner::combine(), cos_cut, d0, PVValHelper::dz, PVValHelper::eta, ZMuMuAnalysisNtupler_cff::eventInfo, HIPTrackMonitorVariables::fill(), HIPHitMonitorVariables::fill(), HIPMonitorConfig::fillTrackHitMonitoring, HIPMonitorConfig::fillTrackMonitoring, findAlignableSpecs(), TrajectoryMeasurement::forwardPredictedState(), SiPixelRecHit::hasFilledProb(), HIPMonitorConfig::hitmonitorvars, Alignable::id(), isCollector, IsCollision, AlignmentClusterFlag::isTaken(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), HIPHitMonitorVariables::m_angle, HIPTrackMonitorVariables::m_Chi2n, HIPTrackMonitorVariables::m_d0, m_datatype, HIPHitMonitorVariables::m_detId, HIPTrackMonitorVariables::m_dz, HIPTrackMonitorVariables::m_Eta, HIPHitMonitorVariables::m_hasHitProb, HIPHitMonitorVariables::m_hitwt, HIPTrackMonitorVariables::m_Nhits, HIPTrackMonitorVariables::m_nhPXB, HIPTrackMonitorVariables::m_nhPXF, HIPTrackMonitorVariables::m_nhTEC, HIPTrackMonitorVariables::m_nhTIB, HIPTrackMonitorVariables::m_nhTID, HIPTrackMonitorVariables::m_nhTOB, HIPTrackMonitorVariables::m_P, HIPTrackMonitorVariables::m_Phi, HIPHitMonitorVariables::m_probQ, HIPHitMonitorVariables::m_probXY, HIPTrackMonitorVariables::m_Pt, HIPHitMonitorVariables::m_rawQualityWord, HIPHitMonitorVariables::m_sinTheta, HIPTrackMonitorVariables::m_wt, HIPAlignableSpecificParameters::maxPixelProbQ, HIPAlignableSpecificParameters::maxPixelProbXY, Trajectory::measurements(), HIPAlignableSpecificParameters::minPixelProbQ, HIPAlignableSpecificParameters::minPixelProbXY, AlCaHLTBitMon_ParallelJobs::p, phi, pixelClusterTagInfos_cfi::pixelhit, funct::pow(), SiPixelRecHit::probabilityQ(), SiPixelRecHit::probabilityXY(), processHit1D(), processHit2D(), DiDispStaMuonMonitor_cfi::pt, alignCSCRings::r, SiPixelRecHit::rawQualityWord(), TrajectoryMeasurement::recHit(), Scale, AlignmentParameterStore::selectParameters(), mathSSE::sqrt(), theAlignableDetAccessor, theAlignmentParameterStore, theDataGroup, theEtaFormula, theMonitorConfig, HLT_FULL_cff::track, HIPMonitorConfig::trackmonitorvars, trackPs, PDWG_EXOHSCP_cff::tracks, trackWt, uniEta, HIPAlignableSpecificParameters::usePixelProbXYOrProbQ, verbose, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by DTWorkflow.DTWorkflow::all(), Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), and o2olib.O2OTool::execute().

◆ setAlignmentPositionError()

void HIPAlignmentAlgorithm::setAlignmentPositionError ( void  )
private

Definition at line 1025 of file HIPAlignmentAlgorithm.cc.

1025  {
1026  // Check if user wants to override APE
1027  if (!theApplyAPE) {
1028  edm::LogInfo("Alignment") << "[HIPAlignmentAlgorithm::setAlignmentPositionError] No APE applied";
1029  return; // NO APE APPLIED
1030  }
1031 
1032  edm::LogInfo("Alignment") << "[HIPAlignmentAlgorithm::setAlignmentPositionError] Apply APE!";
1033 
1034  double apeSPar[3], apeRPar[3];
1035  for (const auto& alipars : theAPEParameters) {
1036  const auto& alignables = alipars.first;
1037  const auto& pars = alipars.second;
1038 
1039  apeSPar[0] = pars[0];
1040  apeSPar[1] = pars[1];
1041  apeSPar[2] = pars[2];
1042  apeRPar[0] = pars[3];
1043  apeRPar[1] = pars[4];
1044  apeRPar[2] = pars[5];
1045 
1046  int function = pars[6];
1047 
1048  // Printout for debug
1049  printf("APE: %u alignables\n", (unsigned int)alignables.size());
1050  for (int i = 0; i < 21; ++i) {
1051  double apelinstest = calcAPE(apeSPar, i, 0);
1052  double apeexpstest = calcAPE(apeSPar, i, 1);
1053  double apestepstest = calcAPE(apeSPar, i, 2);
1054  double apelinrtest = calcAPE(apeRPar, i, 0);
1055  double apeexprtest = calcAPE(apeRPar, i, 1);
1056  double apesteprtest = calcAPE(apeRPar, i, 2);
1057  printf("APE: iter slin sexp sstep rlin rexp rstep: %5d %12.5f %12.5f %12.5f %12.5f %12.5f %12.5f \n",
1058  i,
1059  apelinstest,
1060  apeexpstest,
1061  apestepstest,
1062  apelinrtest,
1063  apeexprtest,
1064  apesteprtest);
1065  }
1066 
1067  // set APE
1068  double apeshift = calcAPE(apeSPar, theIteration, function);
1069  double aperot = calcAPE(apeRPar, theIteration, function);
1070  theAlignmentParameterStore->setAlignmentPositionError(alignables, apeshift, aperot);
1071  }
1072 }

References calcAPE(), mps_fire::i, AlignmentParameterStore::setAlignmentPositionError(), theAlignmentParameterStore, theAPEParameters, theApplyAPE, and theIteration.

Referenced by startNewLoop().

◆ startNewLoop()

void HIPAlignmentAlgorithm::startNewLoop ( void  )
overridevirtual

Called at start of new loop.

Reimplemented from AlignmentAlgorithmBase.

Definition at line 302 of file HIPAlignmentAlgorithm.cc.

302  {
303  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::startNewLoop"
304  << "Begin";
305 
306  // iterate over all alignables and attach user variables
307  for (const auto& it : theAlignables) {
308  AlignmentParameters* ap = it->alignmentParameters();
309  int npar = ap->numSelected();
310  HIPUserVariables* userpar = new HIPUserVariables(npar);
311  ap->setUserVariables(userpar);
312  }
313 
314  // try to read in alignment parameters from a previous iteration
315  AlignablePositions theAlignablePositionsFromFile =
317  int numAlignablesFromFile = theAlignablePositionsFromFile.size();
318  if (numAlignablesFromFile == 0) { // file not there: first iteration
319  // set iteration number to 1 when needed
320  if (isCollector)
321  theIteration = 0;
322  else
323  theIteration = 1;
324  edm::LogWarning("Alignment") << "@SUB=HIPAlignmentAlgorithm::startNewLoop"
325  << "IO alignables file not found for iteration " << theIteration;
326  } else { // there have been previous iterations
327  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::startNewLoop"
328  << "Alignables Read " << numAlignablesFromFile;
329 
330  // get iteration number from file
332  // Where is the target for this?
334 
335  // increase iteration
336  if (ioerr == 0) {
337  theIteration++;
338  edm::LogWarning("Alignment") << "@SUB=HIPAlignmentAlgorithm::startNewLoop"
339  << "Iteration increased by one and is now " << theIteration;
340  }
341 
342  // now apply psotions of file from prev iteration
343  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::startNewLoop"
344  << "Apply positions from file ...";
346  }
347 
348  edm::LogWarning("Alignment") << "@SUB=HIPAlignmentAlgorithm::startNewLoop"
349  << "Current Iteration number: " << theIteration;
350 
351  // book root trees
352  bookRoot();
353 
354  // set alignment position error
356 
357  // run collector job if we are in parallel mode
358  if (isCollector)
359  collector();
360 
361  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::startNewLoop"
362  << "End";
363 }

References AlignmentParameterStore::applyAlignableAbsolutePositions(), bookRoot(), collector(), ioerr, isCollector, AlignmentParameters::numSelected(), AlignmentIORoot::readAlignableAbsolutePositions(), readIterationFile(), salignedfile, setAlignmentPositionError(), AlignmentParameters::setUserVariables(), siterationfile, theAlignables, theAlignmentParameterStore, theIO, and theIteration.

◆ terminate()

void HIPAlignmentAlgorithm::terminate ( const edm::EventSetup setup)
overridevirtual

Call at end of job.

Implements AlignmentAlgorithmBase.

Definition at line 366 of file HIPAlignmentAlgorithm.cc.

366  {
367  edm::LogWarning("Alignment") << "[HIPAlignmentAlgorithm] Terminating";
368 
369  // calculating survey residuals
370  if (!theLevels.empty()) {
371  edm::LogWarning("Alignment") << "[HIPAlignmentAlgorithm] Using survey constraint";
372 
373  unsigned int nAlignable = theAlignables.size();
374  edm::ESHandle<TrackerTopology> tTopoHandle;
375  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
376  const TrackerTopology* const tTopo = tTopoHandle.product();
377  for (unsigned int i = 0; i < nAlignable; ++i) {
378  const Alignable* ali = theAlignables[i];
380  HIPUserVariables* uservar = dynamic_cast<HIPUserVariables*>(ap->userVariables());
381  int nhit = uservar->nhit;
382 
383  // get position
384  std::pair<int, int> tl = theAlignmentParameterStore->typeAndLayer(ali, tTopo);
385  int tmp_Type = tl.first;
386  int tmp_Layer = tl.second;
387  GlobalPoint pos = ali->surface().position();
388  float tmpz = pos.z();
389  if (nhit < 1500 ||
390  (tmp_Type == 5 && tmp_Layer == 4 && fabs(tmpz) > 90)) { // FIXME: Needs revision for hardcoded consts
391  for (unsigned int l = 0; l < theLevels.size(); ++l) {
392  SurveyResidual res(*ali, theLevels[l], true);
393 
394  if (res.valid()) {
395  AlgebraicSymMatrix invCov = res.inverseCovariance();
396 
397  // variable for tree
398  AlgebraicVector sensResid = res.sensorResidual();
399  m3_Id = ali->id();
400  m3_ObjId = theLevels[l];
401  m3_par[0] = sensResid[0];
402  m3_par[1] = sensResid[1];
403  m3_par[2] = sensResid[2];
404  m3_par[3] = sensResid[3];
405  m3_par[4] = sensResid[4];
406  m3_par[5] = sensResid[5];
407 
408  uservar->jtvj += invCov;
409  uservar->jtve += invCov * sensResid;
410 
411  if (theSurveyTree != nullptr)
412  theSurveyTree->Fill();
413  }
414  }
415  }
416  }
417  }
418 
419  // write user variables
421  // don't store userVariable in main, to save time
422  if (!isCollector)
424 
425  // now calculate alignment corrections...
426  int ialigned = 0;
427  // iterate over alignment parameters
428  for (const auto& ali : theAlignables) {
430 
431  if (SetScanDet.at(0) != 0) {
432  edm::LogWarning("Alignment") << "********Starting Scan*********";
433  edm::LogWarning("Alignment") << "det ID=" << SetScanDet.at(0) << ", starting position=" << SetScanDet.at(1)
434  << ", step=" << SetScanDet.at(2) << ", currentDet = " << ali->id();
435  }
436 
437  if ((SetScanDet.at(0) != 0) && (SetScanDet.at(0) != 1) && (ali->id() != SetScanDet.at(0)))
438  continue;
439 
440  bool test = calcParameters(ali, SetScanDet.at(0), SetScanDet.at(1), SetScanDet.at(2));
441  if (test) {
442  if (dynamic_cast<AlignableDetUnit*>(ali) != nullptr) {
443  std::vector<std::pair<int, SurfaceDeformation*>> pairs;
444  ali->surfaceDeformationIdPairs(pairs);
445  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::terminate"
446  << "The alignable contains " << pairs.size() << " surface deformations";
447  } else
448  edm::LogInfo("Alignment") << "@SUB=HIPAlignmentAlgorithm::terminate"
449  << "The alignable cannot contain surface deformations";
450 
452  // set these parameters 'valid'
453  ali->alignmentParameters()->setValid(true);
454  // increase counter
455  ialigned++;
456  } else
457  par->setValid(false);
458  }
459  //end looping over alignables
460 
461  edm::LogWarning("Alignment") << "[HIPAlignmentAlgorithm::terminate] Aligned units: " << ialigned;
462 
463  // fill alignable wise root tree
464  fillAlignablesMonitor(iSetup);
465 
466  edm::LogWarning("Alignment") << "[HIPAlignmentAlgorithm] Writing aligned parameters to file: " << theAlignables.size()
467  << ", for Iteration " << theIteration;
468 
469  // write user variables
470  if (isCollector)
472 
473  // write new absolute positions to disk
475 
476  // write alignment parameters to disk
477  //theIO.writeAlignmentParameters(theAlignables,
478  // sparameterfile.c_str(),theIteration,false,ioerr);
479 
480  // write iteration number to file
482 
483  // write out trees and close root file
484  // Survey tree
485  if (theSurveyIORootFile != nullptr) {
486  theSurveyIORootFile->cd();
487  if (theSurveyTree != nullptr)
488  theSurveyTree->Write();
489  delete theSurveyTree;
490  theSurveyTree = nullptr;
491  theSurveyIORootFile->Close();
492  }
493  // Alignable-wise tree is only filled once at iteration 1
494  if (theAlignablesMonitorIORootFile != nullptr) {
496  if (theAlignablesMonitorTree != nullptr)
497  theAlignablesMonitorTree->Write();
499  theAlignablesMonitorTree = nullptr;
501  }
502  // Eventwise and hitwise monitoring trees
503  if (theTrackHitMonitorIORootFile != nullptr) {
505  if (theTrackMonitorTree != nullptr) {
506  theTrackMonitorTree->Write();
507  delete theTrackMonitorTree;
508  theTrackMonitorTree = nullptr;
509  }
510  if (theHitMonitorTree != nullptr) {
511  theHitMonitorTree->Write();
512  delete theHitMonitorTree;
513  theHitMonitorTree = nullptr;
514  }
516  }
517 }

References Alignable::alignmentParameters(), AlignmentParameterStore::applyParameters(), calcParameters(), fillAlignablesMonitor(), edm::EventSetup::get(), get, mps_fire::i, Alignable::id(), ioerr, isCollector, HIPUserVariables::jtve, HIPUserVariables::jtvj, cmsLHEtoEOSManager::l, m3_Id, m3_ObjId, m3_par, HIPUserVariables::nhit, GloballyPositioned< T >::position(), edm::ESHandle< T >::product(), salignedfile, SetScanDet, AlignmentParameters::setValid(), siterationfile, Alignable::surface(), suvarfile, theAlignables, theAlignablesMonitorIORootFile, theAlignablesMonitorTree, theAlignmentParameterStore, theHitMonitorTree, theIO, theIteration, theLevels, theSurveyIORootFile, theSurveyTree, theTrackHitMonitorIORootFile, theTrackMonitorTree, AlignmentParameterStore::typeAndLayer(), AlignmentParameters::userVariables(), AlignmentIORoot::writeAlignableAbsolutePositions(), HIPUserVariablesIORoot::writeHIPUserVariables(), and writeIterationFile().

◆ writeIterationFile()

void HIPAlignmentAlgorithm::writeIterationFile ( std::string  filename,
int  iter 
)
private

Definition at line 1011 of file HIPAlignmentAlgorithm.cc.

1011  {
1012  std::ofstream outIterFile((filename.c_str()), std::ios::out);
1013  if (!outIterFile)
1014  edm::LogError("Alignment") << "[HIPAlignmentAlgorithm::writeIterationFile] ERROR: Unable to write Iteration file";
1015  else {
1016  outIterFile << iter;
1017  edm::LogWarning("Alignment") << "[HIPAlignmentAlgorithm::writeIterationFile] writing iteration number to file: "
1018  << iter;
1019  }
1020  outIterFile.close();
1021 }

References corrVsCorr::filename, and MillePedeFileConverter_cfg::out.

Referenced by terminate().

Member Data Documentation

◆ alignableObjectId_

std::unique_ptr<AlignableObjectId> HIPAlignmentAlgorithm::alignableObjectId_
private

Definition at line 84 of file HIPAlignmentAlgorithm.h.

Referenced by initialize().

◆ col_cut

double HIPAlignmentAlgorithm::col_cut
private

Definition at line 129 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ cos_cut

double HIPAlignmentAlgorithm::cos_cut
private

Definition at line 129 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ defaultAlignableSpecs

HIPAlignableSpecificParameters HIPAlignmentAlgorithm::defaultAlignableSpecs
private

◆ doTrackHitMonitoring

const bool HIPAlignmentAlgorithm::doTrackHitMonitoring
private

Definition at line 99 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), collectMonitorTrees(), and collector().

◆ ioerr

int HIPAlignmentAlgorithm::ioerr
private

Definition at line 90 of file HIPAlignmentAlgorithm.h.

Referenced by collector(), startNewLoop(), and terminate().

◆ isCollector

bool HIPAlignmentAlgorithm::isCollector
private

◆ IsCollision

bool HIPAlignmentAlgorithm::IsCollision
private

Definition at line 127 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ m2_datatype

int HIPAlignmentAlgorithm::m2_datatype
private

Definition at line 153 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_dtype

SurfaceDeformationFactory::Type HIPAlignmentAlgorithm::m2_dtype
private

Definition at line 155 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Id

align::ID HIPAlignmentAlgorithm::m2_Id
private

Definition at line 150 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Layer

int HIPAlignmentAlgorithm::m2_Layer
private

Definition at line 152 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Nhit

int HIPAlignmentAlgorithm::m2_Nhit
private

Definition at line 152 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_nsurfdef

unsigned int HIPAlignmentAlgorithm::m2_nsurfdef
private

Definition at line 156 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_ObjId

align::StructureType HIPAlignmentAlgorithm::m2_ObjId
private

Definition at line 151 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_surfDef

std::vector<float> HIPAlignmentAlgorithm::m2_surfDef
private

Definition at line 157 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Type

int HIPAlignmentAlgorithm::m2_Type
private

Definition at line 152 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Xpos

float HIPAlignmentAlgorithm::m2_Xpos
private

Definition at line 154 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Ypos

float HIPAlignmentAlgorithm::m2_Ypos
private

Definition at line 154 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Zpos

float HIPAlignmentAlgorithm::m2_Zpos
private

Definition at line 154 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m3_Id

align::ID HIPAlignmentAlgorithm::m3_Id
private

Definition at line 160 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ m3_ObjId

align::StructureType HIPAlignmentAlgorithm::m3_ObjId
private

Definition at line 161 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ m3_par

float HIPAlignmentAlgorithm::m3_par[6]
private

Definition at line 162 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ m_datatype

int HIPAlignmentAlgorithm::m_datatype
private

Definition at line 147 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and run().

◆ outfile2

std::string HIPAlignmentAlgorithm::outfile2
private

Definition at line 101 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), HIPAlignmentAlgorithm(), and initialize().

◆ outpath

std::string HIPAlignmentAlgorithm::outpath
private

Definition at line 101 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm().

◆ rewgtPerAli

bool HIPAlignmentAlgorithm::rewgtPerAli
private

Definition at line 127 of file HIPAlignmentAlgorithm.h.

Referenced by collector(), and HIPAlignmentAlgorithm().

◆ salignedfile

std::string HIPAlignmentAlgorithm::salignedfile
private

◆ Scale

double HIPAlignmentAlgorithm::Scale
private

Definition at line 129 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ SetScanDet

std::vector<double> HIPAlignmentAlgorithm::SetScanDet
private

Definition at line 130 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and terminate().

◆ siterationfile

std::string HIPAlignmentAlgorithm::siterationfile
private

◆ smisalignedfile

std::string HIPAlignmentAlgorithm::smisalignedfile
private

Definition at line 102 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm().

◆ sparameterfile

std::string HIPAlignmentAlgorithm::sparameterfile
private

Definition at line 101 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm().

◆ ssurveyfile

std::string HIPAlignmentAlgorithm::ssurveyfile
private

Definition at line 102 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), HIPAlignmentAlgorithm(), and initialize().

◆ struefile

std::string HIPAlignmentAlgorithm::struefile
private

Definition at line 102 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm().

◆ surveyResiduals_

const std::vector<std::string> HIPAlignmentAlgorithm::surveyResiduals_
private

Definition at line 134 of file HIPAlignmentAlgorithm.h.

Referenced by initialize().

◆ suvarfile

std::string HIPAlignmentAlgorithm::suvarfile
private

Definition at line 101 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), initialize(), and terminate().

◆ suvarfilecore

std::string HIPAlignmentAlgorithm::suvarfilecore
private

Definition at line 101 of file HIPAlignmentAlgorithm.h.

Referenced by collector(), and HIPAlignmentAlgorithm().

◆ theAlignableDetAccessor

std::unique_ptr<AlignableNavigator> HIPAlignmentAlgorithm::theAlignableDetAccessor
private

Definition at line 87 of file HIPAlignmentAlgorithm.h.

Referenced by initialize(), and run().

◆ theAlignables

align::Alignables HIPAlignmentAlgorithm::theAlignables
private

◆ theAlignablesMonitorIORootFile

TFile* HIPAlignmentAlgorithm::theAlignablesMonitorIORootFile
private

Definition at line 141 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), fillAlignablesMonitor(), and terminate().

◆ theAlignablesMonitorTree

TTree* HIPAlignmentAlgorithm::theAlignablesMonitorTree
private

Definition at line 142 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), fillAlignablesMonitor(), and terminate().

◆ theAlignableSpecifics

std::vector<HIPAlignableSpecificParameters> HIPAlignmentAlgorithm::theAlignableSpecifics
private

Definition at line 120 of file HIPAlignmentAlgorithm.h.

Referenced by findAlignableSpecs(), and initialize().

◆ theAlignmentParameterStore

AlignmentParameterStore* HIPAlignmentAlgorithm::theAlignmentParameterStore
private

◆ theAPEParameters

std::vector<std::pair<align::Alignables, std::vector<double> > > HIPAlignmentAlgorithm::theAPEParameters
private

Definition at line 110 of file HIPAlignmentAlgorithm.h.

Referenced by initialize(), and setAlignmentPositionError().

◆ theAPEParameterSet

std::vector<edm::ParameterSet> HIPAlignmentAlgorithm::theAPEParameterSet
private

Definition at line 109 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and initialize().

◆ theApplyAPE

bool HIPAlignmentAlgorithm::theApplyAPE
private

◆ theApplyCutsPerComponent

bool HIPAlignmentAlgorithm::theApplyCutsPerComponent
private

◆ theCollectorNJobs

int HIPAlignmentAlgorithm::theCollectorNJobs
private

Definition at line 124 of file HIPAlignmentAlgorithm.h.

Referenced by collector(), and HIPAlignmentAlgorithm().

◆ theCollectorPath

std::string HIPAlignmentAlgorithm::theCollectorPath
private

Definition at line 125 of file HIPAlignmentAlgorithm.h.

Referenced by collector(), and HIPAlignmentAlgorithm().

◆ theCutsPerComponent

std::vector<edm::ParameterSet> HIPAlignmentAlgorithm::theCutsPerComponent
private

Definition at line 119 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and initialize().

◆ theDataGroup

int HIPAlignmentAlgorithm::theDataGroup
private

◆ theEtaFormula

std::unique_ptr<TFormula> HIPAlignmentAlgorithm::theEtaFormula
private

Definition at line 132 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ theHitMonitorTree

TTree* HIPAlignmentAlgorithm::theHitMonitorTree
private

Definition at line 140 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), collectMonitorTrees(), and terminate().

◆ theIO

AlignmentIORoot HIPAlignmentAlgorithm::theIO
private

Definition at line 89 of file HIPAlignmentAlgorithm.h.

Referenced by startNewLoop(), and terminate().

◆ theIOVrangeSet

std::vector<unsigned> HIPAlignmentAlgorithm::theIOVrangeSet
private

Definition at line 105 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and initialize().

◆ theIteration

int HIPAlignmentAlgorithm::theIteration
private

◆ theLevels

std::vector<align::StructureType> HIPAlignmentAlgorithm::theLevels
private

Definition at line 135 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), initialize(), and terminate().

◆ theMonitorConfig

HIPMonitorConfig HIPAlignmentAlgorithm::theMonitorConfig
private

Definition at line 98 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), collectMonitorTrees(), collector(), and run().

◆ themultiIOV

bool HIPAlignmentAlgorithm::themultiIOV
private

Definition at line 104 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and initialize().

◆ theSurveyIORootFile

TFile* HIPAlignmentAlgorithm::theSurveyIORootFile
private

Definition at line 143 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ theSurveyTree

TTree* HIPAlignmentAlgorithm::theSurveyTree
private

Definition at line 144 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ theTrackHitMonitorIORootFile

TFile* HIPAlignmentAlgorithm::theTrackHitMonitorIORootFile
private

Definition at line 138 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), collectMonitorTrees(), and terminate().

◆ theTrackMonitorTree

TTree* HIPAlignmentAlgorithm::theTrackMonitorTree
private

Definition at line 139 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), collectMonitorTrees(), and terminate().

◆ trackPs

bool HIPAlignmentAlgorithm::trackPs
private

Definition at line 127 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ trackWt

bool HIPAlignmentAlgorithm::trackWt
private

Definition at line 127 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ uniEta

bool HIPAlignmentAlgorithm::uniEta
private

Definition at line 127 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ uniEtaFormula

std::string HIPAlignmentAlgorithm::uniEtaFormula
private

Definition at line 128 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm().

◆ verbose

const bool HIPAlignmentAlgorithm::verbose
private
personalPlayback.level
level
Definition: personalPlayback.py:22
HIPHitMonitorVariables::m_probQ
float m_probQ
Definition: HIPMonitorConfig.h:87
HIPAlignmentAlgorithm::writeIterationFile
void writeIterationFile(std::string filename, int iter)
Definition: HIPAlignmentAlgorithm.cc:1011
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HIPTrackMonitorVariables::fill
void fill() override
Definition: HIPMonitorConfig.cc:74
AlignmentIORoot::writeAlignableAbsolutePositions
void writeAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write Alignable current absolute positions
Definition: AlignmentIORoot.cc:145
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
SiStripRecHit2D::cluster
ClusterRef cluster() const
Definition: SiStripRecHit2D.h:22
HIPAlignmentAlgorithm::theMonitorConfig
HIPMonitorConfig theMonitorConfig
Definition: HIPAlignmentAlgorithm.h:98
HIPAlignmentAlgorithm::theCollectorNJobs
int theCollectorNJobs
Definition: HIPAlignmentAlgorithm.h:124
HIPAlignmentAlgorithm::fillAlignablesMonitor
void fillAlignablesMonitor(const edm::EventSetup &setup)
Definition: HIPAlignmentAlgorithm.cc:1154
mps_fire.i
i
Definition: mps_fire.py:428
AlignmentAlgorithmBase::ConstTrajTrackPairCollection
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
Definition: AlignmentAlgorithmBase.h:67
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11776
HIPAlignmentAlgorithm::theTrackHitMonitorIORootFile
TFile * theTrackHitMonitorIORootFile
Definition: HIPAlignmentAlgorithm.h:138
HIPAlignmentAlgorithm::theApplyCutsPerComponent
bool theApplyCutsPerComponent
Definition: HIPAlignmentAlgorithm.h:118
HIPAlignmentAlgorithm::alignableObjectId_
std::unique_ptr< AlignableObjectId > alignableObjectId_
Definition: HIPAlignmentAlgorithm.h:84
HIPMonitorConfig::outfile
std::string outfile
Definition: HIPMonitorConfig.h:127
chi2n
Definition: HIMultiTrackSelector.h:45
HIPUserVariablesIORoot::writeHIPUserVariables
void writeHIPUserVariables(const Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
Definition: HIPUserVariablesIORoot.cc:184
HIPAlignmentAlgorithm::smisalignedfile
std::string smisalignedfile
Definition: HIPAlignmentAlgorithm.h:102
Alignable::setAlignmentParameters
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
Definition: Alignable.cc:123
GeomDet
Definition: GeomDet.h:27
HIPAlignmentAlgorithm::ssurveyfile
std::string ssurveyfile
Definition: HIPAlignmentAlgorithm.h:102
HIPAlignmentAlgorithm::theEtaFormula
std::unique_ptr< TFormula > theEtaFormula
Definition: HIPAlignmentAlgorithm.h:132
HIPUserVariables::clone
HIPUserVariables * clone(void) const override
Definition: HIPUserVariables.h:41
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
AlignmentParameterStore::alignables
const align::Alignables & alignables(void) const
get all alignables
Definition: AlignmentParameterStore.h:47
LocalTrajectoryError::positionError
LocalError positionError() const
Definition: LocalTrajectoryError.h:81
step
step
Definition: StallMonitor.cc:94
LocalError::xy
float xy() const
Definition: LocalError.h:23
AlignmentParameterStore::selectParameters
CompositeAlignmentParameters selectParameters(const std::vector< AlignableDet * > &alignabledets) const
Definition: AlignmentParameterStore.cc:65
HIPTrackMonitorVariables::m_Phi
std::vector< float > m_Phi
Definition: HIPMonitorConfig.h:29
muon
Definition: MuonCocktails.h:17
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
HIPHitMonitorVariables::fill
void fill() override
Definition: HIPMonitorConfig.cc:117
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
HIPAlignableSpecificParameters::minPixelProbQ
double minPixelProbQ
Definition: HIPAlignableSpecificParameters.h:23
HIPAlignmentAlgorithm::theAlignablesMonitorTree
TTree * theAlignablesMonitorTree
Definition: HIPAlignmentAlgorithm.h:142
HIPMonitorConfig::fillTrackHitMonitoring
const bool fillTrackHitMonitoring
Definition: HIPMonitorConfig.h:123
TrackerTopology
Definition: TrackerTopology.h:16
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HIPAlignmentAlgorithm::bookRoot
void bookRoot(void)
Definition: HIPAlignmentAlgorithm.cc:1093
HIPHitMonitorVariables::m_hitwt
float m_hitwt
Definition: HIPMonitorConfig.h:87
HIPAlignmentAlgorithm::uniEta
bool uniEta
Definition: HIPAlignmentAlgorithm.h:127
Alignable
Definition: Alignable.h:27
pos
Definition: PixelAliasList.h:18
HIPAlignableSpecificParameters::maxRelParError
double maxRelParError
Definition: HIPAlignableSpecificParameters.h:16
HIPAlignmentAlgorithm::IsCollision
bool IsCollision
Definition: HIPAlignmentAlgorithm.h:127
CompositeAlignmentParameters
Definition: CompositeAlignmentParameters.h:27
AlignmentParameterStore::attachUserVariables
void attachUserVariables(const align::Alignables &alivec, const std::vector< AlignmentUserVariables * > &uvarvec, int &ierr)
Attach User Variables to given alignables.
Definition: AlignmentParameterStore.cc:629
Alignable::surfaceDeformationIdPairs
virtual int surfaceDeformationIdPairs(std::vector< std::pair< int, SurfaceDeformation * > > &) const =0
edm::ValidityInterval
Definition: ValidityInterval.h:28
HIPAlignmentAlgorithm::m2_Id
align::ID m2_Id
Definition: HIPAlignmentAlgorithm.h:150
AlignableObjectId::commonObjectIdProvider
static AlignableObjectId commonObjectIdProvider(const AlignableObjectId &, const AlignableObjectId &)
Definition: AlignableObjectId.cc:320
cms::cuda::assert
assert(be >=bs)
AlignmentParameters::userVariables
AlignmentUserVariables * userVariables(void) const
Get pointer to user variables.
Definition: AlignmentParameters.cc:101
HIPAlignmentAlgorithm::theCutsPerComponent
std::vector< edm::ParameterSet > theCutsPerComponent
Definition: HIPAlignmentAlgorithm.h:119
HIPAlignmentAlgorithm::processHit2D
bool processHit2D(const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
Definition: HIPAlignmentAlgorithm.cc:621
edm::ValidityInterval::first
const IOVSyncValue & first() const
Definition: ValidityInterval.h:37
HIPAlignmentAlgorithm::m2_datatype
int m2_datatype
Definition: HIPAlignmentAlgorithm.h:153
SiStripRecHit2D
Definition: SiStripRecHit2D.h:7
TrackerAlignmentRcd
Definition: TrackerAlignmentRcd.h:6
HIPAlignmentAlgorithm::theAPEParameters
std::vector< std::pair< align::Alignables, std::vector< double > > > theAPEParameters
Definition: HIPAlignmentAlgorithm.h:110
AlignmentParameterStore::setAlignmentPositionError
void setAlignmentPositionError(const align::Alignables &alivec, double valshift, double valrot)
Set Alignment position error.
Definition: AlignmentParameterStore.cc:646
HIPAlignmentAlgorithm::SetScanDet
std::vector< double > SetScanDet
Definition: HIPAlignmentAlgorithm.h:130
HIPAlignmentAlgorithm::m2_Layer
int m2_Layer
Definition: HIPAlignmentAlgorithm.h:152
HIPAlignmentAlgorithm::m2_dtype
SurfaceDeformationFactory::Type m2_dtype
Definition: HIPAlignmentAlgorithm.h:155
HIPAlignmentAlgorithm::outpath
std::string outpath
Definition: HIPAlignmentAlgorithm.h:101
HIPAlignmentAlgorithm::m_datatype
int m_datatype
Definition: HIPAlignmentAlgorithm.h:147
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
AlignmentAlgorithmBase::AlignmentAlgorithmBase
AlignmentAlgorithmBase(const edm::ParameterSet &)
Constructor.
Definition: AlignmentAlgorithmBase.h:114
AlignmentParameterStore::applyAlignableAbsolutePositions
void applyAlignableAbsolutePositions(const align::Alignables &alis, const AlignablePositions &newpos, int &ierr)
apply absolute positions to alignables
Definition: AlignmentParameterStore.cc:373
HIPTrackMonitorVariables::m_nhTEC
std::vector< int > m_nhTEC
Definition: HIPMonitorConfig.h:30
SurfaceDeformation::type
virtual int type() const =0
specific type, i.e. SurfaceDeformationFactory::Type
HIPAlignmentAlgorithm::theLevels
std::vector< align::StructureType > theLevels
Definition: HIPAlignmentAlgorithm.h:135
HIPAlignmentAlgorithm::theTrackMonitorTree
TTree * theTrackMonitorTree
Definition: HIPAlignmentAlgorithm.h:139
AlignableDetOrUnitPtr
Definition: AlignableDetOrUnitPtr.h:30
SurfaceDeformation
Definition: SurfaceDeformation.h:18
HIPAlignableSpecificParameters::minPixelProbXY
double minPixelProbXY
Definition: HIPAlignableSpecificParameters.h:21
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
FastTrackerRecHitCombiner_cfi.minNHits
minNHits
Definition: FastTrackerRecHitCombiner_cfi.py:7
AlignmentParameters::isValid
bool isValid(void) const
Get validity flag.
Definition: AlignmentParameters.cc:134
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
AlignmentParameters
Definition: AlignmentParameters.h:35
HIPTrackMonitorVariables::m_nhTOB
std::vector< int > m_nhTOB
Definition: HIPMonitorConfig.h:30
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
HIPAlignmentAlgorithm::calcAPE
double calcAPE(double *par, int iter, int function)
Definition: HIPAlignmentAlgorithm.cc:1076
HIPTrackMonitorVariables::m_wt
std::vector< float > m_wt
Definition: HIPMonitorConfig.h:29
HIPAlignmentAlgorithm::theApplyAPE
bool theApplyAPE
Definition: HIPAlignmentAlgorithm.h:108
edm::Ref
Definition: AssociativeIterator.h:58
HIPAlignmentAlgorithm::readIterationFile
int readIterationFile(std::string filename)
Definition: HIPAlignmentAlgorithm.cc:992
HIPTrackMonitorVariables::bookBranches
void bookBranches() override
Definition: HIPMonitorConfig.cc:41
SiPixelRecHit::hasFilledProb
bool hasFilledProb() const
Definition: SiPixelRecHit.h:104
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
HIPTrackMonitorVariables::m_Chi2n
std::vector< float > m_Chi2n
Definition: HIPMonitorConfig.h:29
HIPMonitorConfig::checkNhits
bool checkNhits()
Definition: HIPMonitorConfig.cc:35
SiPixelRecHit::probabilityQ
float probabilityQ() const
Definition: SiPixelRecHit.h:87
ALCARECOPromptCalibProdSiPixelAli0T_cff.alignParams
alignParams
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:82
HIPAlignmentAlgorithm::sparameterfile
std::string sparameterfile
Definition: HIPAlignmentAlgorithm.h:101
HIPAlignmentAlgorithm::m2_nsurfdef
unsigned int m2_nsurfdef
Definition: HIPAlignmentAlgorithm.h:156
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
pixelClusterTagInfos_cfi.pixelhit
pixelhit
Definition: pixelClusterTagInfos_cfi.py:6
test
Definition: SmallWORMDict.h:13
HIPAlignmentAlgorithm::uniEtaFormula
std::string uniEtaFormula
Definition: HIPAlignmentAlgorithm.h:128
HIPAlignmentAlgorithm::m2_Type
int m2_Type
Definition: HIPAlignmentAlgorithm.h:152
AlignmentIORoot::readAlignableAbsolutePositions
AlignablePositions readAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, int &ierr) override
read Alignable current absolute positions
Definition: AlignmentIORoot.cc:170
HIPAlignmentAlgorithm::outfile2
std::string outfile2
Definition: HIPAlignmentAlgorithm.h:101
Abs
T Abs(T a)
Definition: MathUtil.h:49
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
TrajectoryMeasurement::backwardPredictedState
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
Definition: TrajectoryMeasurement.h:179
SurfaceDeformation::parameters
virtual std::vector< double > parameters() const =0
parameters - interpretation left to the concrete implementation
HIPAlignmentAlgorithm::theAlignableSpecifics
std::vector< HIPAlignableSpecificParameters > theAlignableSpecifics
Definition: HIPAlignmentAlgorithm.h:120
LocalError::xx
float xx() const
Definition: LocalError.h:22
TrajectoryStateOnSurface::localDirection
LocalVector localDirection() const
Definition: TrajectoryStateOnSurface.h:76
AlignmentParameterStore::applyParameters
void applyParameters(void)
Obsolete: Use AlignableNavigator::alignableDetFromDetId and alignableFromAlignableDet.
Definition: AlignmentParameterStore.cc:255
Alignable::alignableObjectId
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
HIPAlignmentAlgorithm::theAlignablesMonitorIORootFile
TFile * theAlignablesMonitorIORootFile
Definition: HIPAlignmentAlgorithm.h:141
SiPixelRecHit::probabilityXY
float probabilityXY() const
Definition: SiPixelRecHit.h:86
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HIPHitMonitorVariables::m_detId
align::ID m_detId
Definition: HIPMonitorConfig.h:89
HIPAlignableSpecificParameters::maxPixelProbXY
double maxPixelProbXY
Definition: HIPAlignableSpecificParameters.h:22
AlignmentParameterStore::typeAndLayer
std::pair< int, int > typeAndLayer(const Alignable *ali, const TrackerTopology *tTopo) const
Obtain type and layer from Alignable.
Definition: AlignmentParameterStore.cc:368
HIPAlignmentAlgorithm::findAlignableSpecs
HIPAlignableSpecificParameters * findAlignableSpecs(const Alignable *ali)
Definition: HIPAlignmentAlgorithm.cc:1549
TrajectoryMeasurement::forwardPredictedState
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
Definition: TrajectoryMeasurement.h:177
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HIPTrackMonitorVariables::m_P
std::vector< float > m_P
Definition: HIPMonitorConfig.h:29
HIPAlignmentAlgorithm::m2_Xpos
float m2_Xpos
Definition: HIPAlignmentAlgorithm.h:154
HIPAlignmentAlgorithm::suvarfile
std::string suvarfile
Definition: HIPAlignmentAlgorithm.h:101
reco::Track
Definition: Track.h:27
str
#define str(s)
Definition: TestProcessor.cc:51
edm::ESHandle< TrackerTopology >
HIPAlignableSpecificParameters::minNHits
int minNHits
Definition: HIPAlignableSpecificParameters.h:17
HIPAlignmentAlgorithm::m2_ObjId
align::StructureType m2_ObjId
Definition: HIPAlignmentAlgorithm.h:151
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
HIPAlignmentAlgorithm::rewgtPerAli
bool rewgtPerAli
Definition: HIPAlignmentAlgorithm.h:127
HIPAlignmentAlgorithm::theAlignables
align::Alignables theAlignables
Definition: HIPAlignmentAlgorithm.h:86
SiPixelRecHit::rawQualityWord
SiPixelRecHitQuality::QualWordType rawQualityWord() const
Definition: SiPixelRecHit.h:78
Alignable::surface
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
AlignmentClusterFlag::isTaken
bool isTaken() const
Definition: AlignmentClusterFlag.cc:14
cond::persistency::GLOBAL_TAG::tname
static constexpr char const * tname
Definition: GTSchema.h:13
Point3DBase< float, GlobalTag >
HIPAlignmentAlgorithm::collector
void collector(void)
Definition: HIPAlignmentAlgorithm.cc:1331
HIPAlignmentAlgorithm::ioerr
int ioerr
Definition: HIPAlignmentAlgorithm.h:90
HIPMonitorConfig::hitmonitorvars
HIPHitMonitorVariables hitmonitorvars
Definition: HIPMonitorConfig.h:125
HIPHitMonitorVariables::m_hasHitProb
bool m_hasHitProb
Definition: HIPMonitorConfig.h:86
HIPUserVariables::alipar
AlgebraicVector alipar
Definition: HIPUserVariables.h:13
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
HIPAlignmentAlgorithm::isCollector
bool isCollector
Definition: HIPAlignmentAlgorithm.h:123
HIPTrackMonitorVariables::m_dz
std::vector< float > m_dz
Definition: HIPMonitorConfig.h:29
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HIPUserVariablesIORoot
Definition: HIPUserVariablesIORoot.h:10
HIPUserVariables::alindof
int alindof
Definition: HIPUserVariables.h:10
HIPAlignmentAlgorithm::surveyResiduals_
const std::vector< std::string > surveyResiduals_
Definition: HIPAlignmentAlgorithm.h:134
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
ZMuMuAnalysisNtupler_cff.eventInfo
eventInfo
Definition: ZMuMuAnalysisNtupler_cff.py:15
HIPUserVariables::nhit
int nhit
Definition: HIPUserVariables.h:11
HIPTrackMonitorVariables::m_Pt
std::vector< float > m_Pt
Definition: HIPMonitorConfig.h:29
HIPAlignableSpecificParameters::maxPixelProbQ
double maxPixelProbQ
Definition: HIPAlignableSpecificParameters.h:24
TrajectoryStateCombiner
Definition: TrajectoryStateCombiner.h:13
TrajectoryStateOnSurface::localPosition
LocalPoint localPosition() const
Definition: TrajectoryStateOnSurface.h:74
edm::IOVSyncValue::eventID
const EventID & eventID() const
Definition: IOVSyncValue.h:40
edm::ParameterSet
Definition: ParameterSet.h:47
HIPUserVariablesIORoot::readHIPUserVariables
std::vector< AlignmentUserVariables * > readHIPUserVariables(const Alignables &alivec, const char *filename, int iter, int &ierr)
Definition: HIPUserVariablesIORoot.cc:207
HIPAlignmentAlgorithm::processHit1D
bool processHit1D(const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
Definition: HIPAlignmentAlgorithm.cc:519
HIPHitMonitorVariables::m_angle
float m_angle
Definition: HIPMonitorConfig.h:87
HIPUserVariables::datatype
int datatype
Definition: HIPUserVariables.h:12
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HIPAlignmentAlgorithm::m2_surfDef
std::vector< float > m2_surfDef
Definition: HIPAlignmentAlgorithm.h:157
HIPAlignmentAlgorithm::theAlignableDetAccessor
std::unique_ptr< AlignableNavigator > theAlignableDetAccessor
Definition: HIPAlignmentAlgorithm.h:87
SurfaceDeformationFactory::Type
Type
Definition: SurfaceDeformationFactory.h:17
HIPTrackMonitorVariables::m_nhTIB
std::vector< int > m_nhTIB
Definition: HIPMonitorConfig.h:30
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HIPUserVariables::alichi2
double alichi2
Definition: HIPUserVariables.h:9
Alignable::id
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
Definition: Alignable.h:180
recoMuon::in
Definition: RecoMuonEnumerators.h:6
runTauDisplay.dtype
dtype
Definition: runTauDisplay.py:121
HIPAlignmentAlgorithm::theIteration
int theIteration
Definition: HIPAlignmentAlgorithm.h:91
HIPTrackMonitorVariables::m_nhPXF
std::vector< int > m_nhPXF
Definition: HIPMonitorConfig.h:30
HIPTrackMonitorVariables::m_d0
std::vector< float > m_d0
Definition: HIPMonitorConfig.h:29
HIPAlignmentAlgorithm::m2_Ypos
float m2_Ypos
Definition: HIPAlignmentAlgorithm.h:154
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
HIPAlignmentAlgorithm::theIO
AlignmentIORoot theIO
Definition: HIPAlignmentAlgorithm.h:89
HIPMonitorVariables::setTree
void setTree(TTree *tree_)
Definition: HIPMonitorConfig.h:18
createfilelist.int
int
Definition: createfilelist.py:10
CompositeAlignmentParameters::alignableFromAlignableDet
Alignable * alignableFromAlignableDet(const AlignableDetOrUnitPtr &adet) const
Get relevant Alignable from AlignableDet.
Definition: CompositeAlignmentParameters.cc:208
HIPAlignmentAlgorithm::trackPs
bool trackPs
Definition: HIPAlignmentAlgorithm.h:127
writedatasetfile.firstrun
firstrun
Definition: writedatasetfile.py:27
SiStripRecHit1D::cluster
ClusterRef cluster() const
Definition: SiStripRecHit1D.h:18
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HIPAlignmentAlgorithm::theIOVrangeSet
std::vector< unsigned > theIOVrangeSet
Definition: HIPAlignmentAlgorithm.h:105
SiStripRecHit1D
Definition: SiStripRecHit1D.h:8
HIPAlignmentAlgorithm::themultiIOV
bool themultiIOV
Definition: HIPAlignmentAlgorithm.h:104
get
#define get
res
Definition: Electron.h:6
HIPAlignmentAlgorithm::calcParameters
bool calcParameters(Alignable *ali, int setDet, double start, double step)
Definition: HIPAlignmentAlgorithm.cc:1234
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
Trajectory::measurements
DataContainer const & measurements() const
Definition: Trajectory.h:178
HIPAlignmentAlgorithm::theHitMonitorTree
TTree * theHitMonitorTree
Definition: HIPAlignmentAlgorithm.h:140
looper.cfg
cfg
Definition: looper.py:297
TrackingRecHit
Definition: TrackingRecHit.h:21
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HIPAlignmentAlgorithm::verbose
const bool verbose
Definition: HIPAlignmentAlgorithm.h:96
HIPTrackMonitorVariables::m_nhTID
std::vector< int > m_nhTID
Definition: HIPMonitorConfig.h:30
HIPAlignmentAlgorithm::struefile
std::string struefile
Definition: HIPAlignmentAlgorithm.h:102
TrajectoryMeasurement::recHit
ConstRecHitPointer const & recHit() const
Definition: TrajectoryMeasurement.h:190
DDAxes::phi
HIPUserVariables::jtvj
AlgebraicSymMatrix jtvj
Definition: HIPUserVariables.h:7
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
HIPAlignmentAlgorithm::defaultAlignableSpecs
HIPAlignableSpecificParameters defaultAlignableSpecs
Definition: HIPAlignmentAlgorithm.h:116
HIPAlignmentAlgorithm::doTrackHitMonitoring
const bool doTrackHitMonitoring
Definition: HIPAlignmentAlgorithm.h:99
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
HIPAlignmentAlgorithm::theDataGroup
int theDataGroup
Definition: HIPAlignmentAlgorithm.h:126
HIPAlignmentAlgorithm::col_cut
double col_cut
Definition: HIPAlignmentAlgorithm.h:129
HIPAlignmentAlgorithm::theCollectorPath
std::string theCollectorPath
Definition: HIPAlignmentAlgorithm.h:125
HIPAlignmentAlgorithm::siterationfile
std::string siterationfile
Definition: HIPAlignmentAlgorithm.h:102
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
SurveyResidual
Definition: SurveyResidual.h:22
AlignmentParameters::setValid
void setValid(bool v)
Set validity flag.
Definition: AlignmentParameters.cc:137
PVValHelper::dz
Definition: PVValidationHelpers.h:50
HIPAlignmentAlgorithm::theAlignmentParameterStore
AlignmentParameterStore * theAlignmentParameterStore
Definition: HIPAlignmentAlgorithm.h:85
Trajectory
Definition: Trajectory.h:38
HIPAlignableSpecificParameters
Definition: HIPAlignableSpecificParameters.h:7
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
AlignmentParameters::cloneFromSelected
virtual AlignmentParameters * cloneFromSelected(const AlgebraicVector &par, const AlgebraicSymMatrix &cov) const =0
HIPAlignableSpecificParameters::usePixelProbXYOrProbQ
bool usePixelProbXYOrProbQ
Definition: HIPAlignableSpecificParameters.h:20
Exception
Definition: hltDiff.cc:246
TrajectoryStateCombiner::combine
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const
Definition: TrajectoryStateCombiner.cc:6
AlignmentParameters::numSelected
int numSelected(void) const
Get number of selected parameters.
Definition: AlignmentParameters.cc:51
HIPAlignmentAlgorithm::trackWt
bool trackWt
Definition: HIPAlignmentAlgorithm.h:127
HIPTrackMonitorVariables::m_Nhits
std::vector< int > m_Nhits
Definition: HIPMonitorConfig.h:30
HIPAlignmentAlgorithm::m3_par
float m3_par[6]
Definition: HIPAlignmentAlgorithm.h:162
HIPUserVariables::alierr
AlgebraicVector alierr
Definition: HIPUserVariables.h:14
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HIPHitMonitorVariables::m_sinTheta
float m_sinTheta
Definition: HIPMonitorConfig.h:87
HIPAlignableSpecificParameters::maxHitPull
double maxHitPull
Definition: HIPAlignableSpecificParameters.h:18
SurfaceDeformationFactory::kNoDeformations
Definition: SurfaceDeformationFactory.h:21
className
std::string className(const T &t)
Definition: ClassName.h:31
HIPAlignmentAlgorithm::m2_Zpos
float m2_Zpos
Definition: HIPAlignmentAlgorithm.h:154
HIPMonitorConfig::outfilecore
const std::string outfilecore
Definition: HIPMonitorConfig.h:115
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
HIPAlignmentAlgorithm::salignedfile
std::string salignedfile
Definition: HIPAlignmentAlgorithm.h:102
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
HIPAlignmentAlgorithm::theSurveyTree
TTree * theSurveyTree
Definition: HIPAlignmentAlgorithm.h:144
mps_fire.result
result
Definition: mps_fire.py:311
HIPAlignmentAlgorithm::suvarfilecore
std::string suvarfilecore
Definition: HIPAlignmentAlgorithm.h:101
cms::Exception
Definition: Exception.h:70
HIPAlignmentAlgorithm::cos_cut
double cos_cut
Definition: HIPAlignmentAlgorithm.h:129
HIPMonitorConfig::checkNevents
bool checkNevents()
Definition: HIPMonitorConfig.cc:30
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
command_line.start
start
Definition: command_line.py:167
HIPMonitorConfig::trackmonitorvars
HIPTrackMonitorVariables trackmonitorvars
Definition: HIPMonitorConfig.h:121
HIPAlignmentAlgorithm::m3_Id
align::ID m3_Id
Definition: HIPAlignmentAlgorithm.h:160
HIPMonitorConfig::fillTrackMonitoring
const bool fillTrackMonitoring
Definition: HIPMonitorConfig.h:119
HIPAlignmentAlgorithm::setAlignmentPositionError
void setAlignmentPositionError(void)
Definition: HIPAlignmentAlgorithm.cc:1025
HIPTrackMonitorVariables::m_Eta
std::vector< float > m_Eta
Definition: HIPMonitorConfig.h:29
HIPAlignmentAlgorithm::theSurveyIORootFile
TFile * theSurveyIORootFile
Definition: HIPAlignmentAlgorithm.h:143
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
AlignablePositions
std::vector< AlignableAbsData > AlignablePositions
Definition: AlignableData.h:47
AlignmentParameters::parameters
const AlgebraicVector & parameters(void) const
Get alignment parameters.
Definition: AlignmentParameters.cc:64
HIPUserVariables::jtve
AlgebraicVector jtve
Definition: HIPUserVariables.h:8
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
edm::Log
Definition: MessageLogger.h:70
Alignable::alignmentParameters
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:58
LocalError::yy
float yy() const
Definition: LocalError.h:24
AlignmentClusterFlag
Definition: AlignmentClusterFlag.h:15
HIPAlignmentAlgorithm::collectMonitorTrees
void collectMonitorTrees(const std::vector< std::string > &filenames)
Definition: HIPAlignmentAlgorithm.cc:1486
AlignmentParameterSelector
Definition: AlignmentParameterSelector.h:26
HIPAlignableSpecificParameters::minRelParError
double minRelParError
Definition: HIPAlignableSpecificParameters.h:15
HIPTrackMonitorVariables::m_nhPXB
std::vector< int > m_nhPXB
Definition: HIPMonitorConfig.h:30
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
HIPHitMonitorVariables::m_rawQualityWord
unsigned int m_rawQualityWord
Definition: HIPMonitorConfig.h:88
HIPAlignableSpecificParameters::applyPixelProbCut
bool applyPixelProbCut
Definition: HIPAlignableSpecificParameters.h:19
HIPUserVariables
Definition: HIPUserVariables.h:4
AlignmentParameters::setUserVariables
void setUserVariables(AlignmentUserVariables *auv)
Set pointer to user variables.
Definition: AlignmentParameters.cc:94
HIPAlignmentAlgorithm::m2_Nhit
int m2_Nhit
Definition: HIPAlignmentAlgorithm.h:152
HIPHitMonitorVariables::m_probXY
float m_probXY
Definition: HIPMonitorConfig.h:87
HIPAlignmentAlgorithm::theAPEParameterSet
std::vector< edm::ParameterSet > theAPEParameterSet
Definition: HIPAlignmentAlgorithm.h:109
HIPAlignmentAlgorithm::m3_ObjId
align::StructureType m3_ObjId
Definition: HIPAlignmentAlgorithm.h:161
HIPAlignmentAlgorithm::Scale
double Scale
Definition: HIPAlignmentAlgorithm.h:129
HIPHitMonitorVariables::bookBranches
void bookBranches() override
Definition: HIPMonitorConfig.cc:62