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, edm::ConsumesCollector &iC)
 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 &, const edm::ConsumesCollector &)
 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
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken2_
 
const edm::ESGetToken< TrackerTopology, IdealGeometryRecordtopoToken_
 
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 36 of file HIPAlignmentAlgorithm.h.

Constructor & Destructor Documentation

◆ HIPAlignmentAlgorithm()

HIPAlignmentAlgorithm::HIPAlignmentAlgorithm ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

Constructor.

Definition at line 41 of file HIPAlignmentAlgorithm.cc.

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

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 42 of file HIPAlignmentAlgorithm.h.

42 {};

Member Function Documentation

◆ bookRoot()

void HIPAlignmentAlgorithm::bookRoot ( void  )
private

Definition at line 1087 of file HIPAlignmentAlgorithm.cc.

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

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, tname(), and HIPMonitorConfig::trackmonitorvars.

Referenced by startNewLoop().

◆ calcAPE()

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

Definition at line 1070 of file HIPAlignmentAlgorithm.cc.

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

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 1224 of file HIPAlignmentAlgorithm.cc.

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

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 1476 of file HIPAlignmentAlgorithm.cc.

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

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 1321 of file HIPAlignmentAlgorithm.cc.

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

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 1148 of file HIPAlignmentAlgorithm.cc.

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

References HIPUserVariables::datatype, runTauDisplay::dtype, alignBH_cfg::fixed, edm::EventSetup::getData(), 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(), theAlignables, theAlignablesMonitorIORootFile, theAlignablesMonitorTree, theAlignmentParameterStore, topoToken2_, SurfaceDeformation::type(), AlignmentParameterStore::typeAndLayer(), AlignmentParameters::userVariables(), and verbose.

Referenced by terminate().

◆ findAlignableSpecs()

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

Definition at line 1539 of file HIPAlignmentAlgorithm.cc.

1539  {
1540  if (ali != nullptr) {
1541  for (std::vector<HIPAlignableSpecificParameters>::iterator it = theAlignableSpecifics.begin();
1542  it != theAlignableSpecifics.end();
1543  it++) {
1544  if (it->matchAlignable(ali))
1545  return &(*it);
1546  }
1547  edm::LogInfo("Alignment") << "[HIPAlignmentAlgorithm::findAlignableSpecs] Alignment object with id " << ali->id()
1548  << " / " << ali->alignableObjectId() << " could not be found. Returning default.";
1549  }
1550  return &defaultAlignableSpecs;
1551 }

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 125 of file HIPAlignmentAlgorithm.cc.

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

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 513 of file HIPAlignmentAlgorithm.cc.

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

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 615 of file HIPAlignmentAlgorithm.cc.

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

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 986 of file HIPAlignmentAlgorithm.cc.

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

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 731 of file HIPAlignmentAlgorithm.cc.

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

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, dumpTauVariables_cfi::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, 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 1019 of file HIPAlignmentAlgorithm.cc.

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

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 298 of file HIPAlignmentAlgorithm.cc.

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

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 362 of file HIPAlignmentAlgorithm.cc.

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

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

◆ writeIterationFile()

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

Definition at line 1005 of file HIPAlignmentAlgorithm.cc.

1005  {
1006  std::ofstream outIterFile((filename.c_str()), std::ios::out);
1007  if (!outIterFile)
1008  edm::LogError("Alignment") << "[HIPAlignmentAlgorithm::writeIterationFile] ERROR: Unable to write Iteration file";
1009  else {
1010  outIterFile << iter;
1011  edm::LogWarning("Alignment") << "[HIPAlignmentAlgorithm::writeIterationFile] writing iteration number to file: "
1012  << iter;
1013  }
1014  outIterFile.close();
1015 }

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

Referenced by terminate().

Member Data Documentation

◆ alignableObjectId_

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

Definition at line 91 of file HIPAlignmentAlgorithm.h.

Referenced by initialize().

◆ col_cut

double HIPAlignmentAlgorithm::col_cut
private

Definition at line 136 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ cos_cut

double HIPAlignmentAlgorithm::cos_cut
private

Definition at line 136 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ defaultAlignableSpecs

HIPAlignableSpecificParameters HIPAlignmentAlgorithm::defaultAlignableSpecs
private

◆ doTrackHitMonitoring

const bool HIPAlignmentAlgorithm::doTrackHitMonitoring
private

Definition at line 106 of file HIPAlignmentAlgorithm.h.

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

◆ ioerr

int HIPAlignmentAlgorithm::ioerr
private

Definition at line 97 of file HIPAlignmentAlgorithm.h.

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

◆ isCollector

bool HIPAlignmentAlgorithm::isCollector
private

◆ IsCollision

bool HIPAlignmentAlgorithm::IsCollision
private

Definition at line 134 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ m2_datatype

int HIPAlignmentAlgorithm::m2_datatype
private

Definition at line 160 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_dtype

SurfaceDeformationFactory::Type HIPAlignmentAlgorithm::m2_dtype
private

Definition at line 162 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Id

align::ID HIPAlignmentAlgorithm::m2_Id
private

Definition at line 157 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Layer

int HIPAlignmentAlgorithm::m2_Layer
private

Definition at line 159 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Nhit

int HIPAlignmentAlgorithm::m2_Nhit
private

Definition at line 159 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_nsurfdef

unsigned int HIPAlignmentAlgorithm::m2_nsurfdef
private

Definition at line 163 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_ObjId

align::StructureType HIPAlignmentAlgorithm::m2_ObjId
private

Definition at line 158 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_surfDef

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

Definition at line 164 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Type

int HIPAlignmentAlgorithm::m2_Type
private

Definition at line 159 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Xpos

float HIPAlignmentAlgorithm::m2_Xpos
private

Definition at line 161 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Ypos

float HIPAlignmentAlgorithm::m2_Ypos
private

Definition at line 161 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m2_Zpos

float HIPAlignmentAlgorithm::m2_Zpos
private

Definition at line 161 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and fillAlignablesMonitor().

◆ m3_Id

align::ID HIPAlignmentAlgorithm::m3_Id
private

Definition at line 167 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ m3_ObjId

align::StructureType HIPAlignmentAlgorithm::m3_ObjId
private

Definition at line 168 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ m3_par

float HIPAlignmentAlgorithm::m3_par[6]
private

Definition at line 169 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ m_datatype

int HIPAlignmentAlgorithm::m_datatype
private

Definition at line 154 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and run().

◆ outfile2

std::string HIPAlignmentAlgorithm::outfile2
private

Definition at line 108 of file HIPAlignmentAlgorithm.h.

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

◆ outpath

std::string HIPAlignmentAlgorithm::outpath
private

Definition at line 108 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm().

◆ rewgtPerAli

bool HIPAlignmentAlgorithm::rewgtPerAli
private

Definition at line 134 of file HIPAlignmentAlgorithm.h.

Referenced by collector(), and HIPAlignmentAlgorithm().

◆ salignedfile

std::string HIPAlignmentAlgorithm::salignedfile
private

◆ Scale

double HIPAlignmentAlgorithm::Scale
private

Definition at line 136 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ SetScanDet

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

Definition at line 137 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and terminate().

◆ siterationfile

std::string HIPAlignmentAlgorithm::siterationfile
private

◆ smisalignedfile

std::string HIPAlignmentAlgorithm::smisalignedfile
private

Definition at line 109 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm().

◆ sparameterfile

std::string HIPAlignmentAlgorithm::sparameterfile
private

Definition at line 108 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm().

◆ ssurveyfile

std::string HIPAlignmentAlgorithm::ssurveyfile
private

Definition at line 109 of file HIPAlignmentAlgorithm.h.

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

◆ struefile

std::string HIPAlignmentAlgorithm::struefile
private

Definition at line 109 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm().

◆ surveyResiduals_

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

Definition at line 141 of file HIPAlignmentAlgorithm.h.

Referenced by initialize().

◆ suvarfile

std::string HIPAlignmentAlgorithm::suvarfile
private

Definition at line 108 of file HIPAlignmentAlgorithm.h.

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

◆ suvarfilecore

std::string HIPAlignmentAlgorithm::suvarfilecore
private

Definition at line 108 of file HIPAlignmentAlgorithm.h.

Referenced by collector(), and HIPAlignmentAlgorithm().

◆ theAlignableDetAccessor

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

Definition at line 94 of file HIPAlignmentAlgorithm.h.

Referenced by initialize(), and run().

◆ theAlignables

align::Alignables HIPAlignmentAlgorithm::theAlignables
private

◆ theAlignablesMonitorIORootFile

TFile* HIPAlignmentAlgorithm::theAlignablesMonitorIORootFile
private

Definition at line 148 of file HIPAlignmentAlgorithm.h.

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

◆ theAlignablesMonitorTree

TTree* HIPAlignmentAlgorithm::theAlignablesMonitorTree
private

Definition at line 149 of file HIPAlignmentAlgorithm.h.

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

◆ theAlignableSpecifics

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

Definition at line 127 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 117 of file HIPAlignmentAlgorithm.h.

Referenced by initialize(), and setAlignmentPositionError().

◆ theAPEParameterSet

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

Definition at line 116 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 131 of file HIPAlignmentAlgorithm.h.

Referenced by collector(), and HIPAlignmentAlgorithm().

◆ theCollectorPath

std::string HIPAlignmentAlgorithm::theCollectorPath
private

Definition at line 132 of file HIPAlignmentAlgorithm.h.

Referenced by collector(), and HIPAlignmentAlgorithm().

◆ theCutsPerComponent

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

Definition at line 126 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 139 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ theHitMonitorTree

TTree* HIPAlignmentAlgorithm::theHitMonitorTree
private

Definition at line 147 of file HIPAlignmentAlgorithm.h.

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

◆ theIO

AlignmentIORoot HIPAlignmentAlgorithm::theIO
private

Definition at line 96 of file HIPAlignmentAlgorithm.h.

Referenced by startNewLoop(), and terminate().

◆ theIOVrangeSet

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

Definition at line 112 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 142 of file HIPAlignmentAlgorithm.h.

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

◆ theMonitorConfig

HIPMonitorConfig HIPAlignmentAlgorithm::theMonitorConfig
private

Definition at line 105 of file HIPAlignmentAlgorithm.h.

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

◆ themultiIOV

bool HIPAlignmentAlgorithm::themultiIOV
private

Definition at line 111 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and initialize().

◆ theSurveyIORootFile

TFile* HIPAlignmentAlgorithm::theSurveyIORootFile
private

Definition at line 150 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ theSurveyTree

TTree* HIPAlignmentAlgorithm::theSurveyTree
private

Definition at line 151 of file HIPAlignmentAlgorithm.h.

Referenced by bookRoot(), and terminate().

◆ theTrackHitMonitorIORootFile

TFile* HIPAlignmentAlgorithm::theTrackHitMonitorIORootFile
private

Definition at line 145 of file HIPAlignmentAlgorithm.h.

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

◆ theTrackMonitorTree

TTree* HIPAlignmentAlgorithm::theTrackMonitorTree
private

Definition at line 146 of file HIPAlignmentAlgorithm.h.

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

◆ topoToken2_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> HIPAlignmentAlgorithm::topoToken2_
private

Definition at line 89 of file HIPAlignmentAlgorithm.h.

Referenced by fillAlignablesMonitor().

◆ topoToken_

const edm::ESGetToken<TrackerTopology, IdealGeometryRecord> HIPAlignmentAlgorithm::topoToken_
private

Definition at line 88 of file HIPAlignmentAlgorithm.h.

Referenced by terminate().

◆ trackPs

bool HIPAlignmentAlgorithm::trackPs
private

Definition at line 134 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ trackWt

bool HIPAlignmentAlgorithm::trackWt
private

Definition at line 134 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ uniEta

bool HIPAlignmentAlgorithm::uniEta
private

Definition at line 134 of file HIPAlignmentAlgorithm.h.

Referenced by HIPAlignmentAlgorithm(), and run().

◆ uniEtaFormula

std::string HIPAlignmentAlgorithm::uniEtaFormula
private

Definition at line 135 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:1005
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
SiStripRecHit2D::cluster
ClusterRef cluster() const
Definition: SiStripRecHit2D.h:22
HIPAlignmentAlgorithm::theMonitorConfig
HIPMonitorConfig theMonitorConfig
Definition: HIPAlignmentAlgorithm.h:105
HIPAlignmentAlgorithm::theCollectorNJobs
int theCollectorNJobs
Definition: HIPAlignmentAlgorithm.h:131
HIPAlignmentAlgorithm::fillAlignablesMonitor
void fillAlignablesMonitor(const edm::EventSetup &setup)
Definition: HIPAlignmentAlgorithm.cc:1148
mps_fire.i
i
Definition: mps_fire.py:428
AlignmentAlgorithmBase::ConstTrajTrackPairCollection
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
Definition: AlignmentAlgorithmBase.h:68
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
HIPAlignmentAlgorithm::theTrackHitMonitorIORootFile
TFile * theTrackHitMonitorIORootFile
Definition: HIPAlignmentAlgorithm.h:145
HIPAlignmentAlgorithm::theApplyCutsPerComponent
bool theApplyCutsPerComponent
Definition: HIPAlignmentAlgorithm.h:125
HIPAlignmentAlgorithm::alignableObjectId_
std::unique_ptr< AlignableObjectId > alignableObjectId_
Definition: HIPAlignmentAlgorithm.h:91
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:109
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:109
HIPAlignmentAlgorithm::theEtaFormula
std::unique_ptr< TFormula > theEtaFormula
Definition: HIPAlignmentAlgorithm.h:139
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:149
HIPMonitorConfig::fillTrackHitMonitoring
const bool fillTrackHitMonitoring
Definition: HIPMonitorConfig.h:123
TrackerTopology
Definition: TrackerTopology.h:16
HIPAlignmentAlgorithm::bookRoot
void bookRoot(void)
Definition: HIPAlignmentAlgorithm.cc:1087
HIPHitMonitorVariables::m_hitwt
float m_hitwt
Definition: HIPMonitorConfig.h:87
HIPAlignmentAlgorithm::uniEta
bool uniEta
Definition: HIPAlignmentAlgorithm.h:134
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:134
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:157
AlignableObjectId::commonObjectIdProvider
static AlignableObjectId commonObjectIdProvider(const AlignableObjectId &, const AlignableObjectId &)
Definition: AlignableObjectId.cc:336
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:126
HIPAlignmentAlgorithm::processHit2D
bool processHit2D(const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
Definition: HIPAlignmentAlgorithm.cc:615
edm::ValidityInterval::first
const IOVSyncValue & first() const
Definition: ValidityInterval.h:37
HIPAlignmentAlgorithm::m2_datatype
int m2_datatype
Definition: HIPAlignmentAlgorithm.h:160
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:117
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:137
HIPAlignmentAlgorithm::m2_Layer
int m2_Layer
Definition: HIPAlignmentAlgorithm.h:159
HIPAlignmentAlgorithm::m2_dtype
SurfaceDeformationFactory::Type m2_dtype
Definition: HIPAlignmentAlgorithm.h:162
HIPAlignmentAlgorithm::outpath
std::string outpath
Definition: HIPAlignmentAlgorithm.h:108
HIPAlignmentAlgorithm::m_datatype
int m_datatype
Definition: HIPAlignmentAlgorithm.h:154
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
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:142
HIPAlignmentAlgorithm::theTrackMonitorTree
TTree * theTrackMonitorTree
Definition: HIPAlignmentAlgorithm.h:146
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
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:1070
HIPTrackMonitorVariables::m_wt
std::vector< float > m_wt
Definition: HIPMonitorConfig.h:29
HIPAlignmentAlgorithm::theApplyAPE
bool theApplyAPE
Definition: HIPAlignmentAlgorithm.h:115
edm::Ref
Definition: AssociativeIterator.h:58
HIPAlignmentAlgorithm::readIterationFile
int readIterationFile(std::string filename)
Definition: HIPAlignmentAlgorithm.cc:986
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:108
HIPAlignmentAlgorithm::m2_nsurfdef
unsigned int m2_nsurfdef
Definition: HIPAlignmentAlgorithm.h:163
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:135
HIPAlignmentAlgorithm::m2_Type
int m2_Type
Definition: HIPAlignmentAlgorithm.h:159
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:108
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:127
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:148
SiPixelRecHit::probabilityXY
float probabilityXY() const
Definition: SiPixelRecHit.h:86
PVValHelper::eta
Definition: PVValidationHelpers.h:70
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:1539
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:161
HIPAlignmentAlgorithm::suvarfile
std::string suvarfile
Definition: HIPAlignmentAlgorithm.h:108
reco::Track
Definition: Track.h:27
str
#define str(s)
Definition: TestProcessor.cc:53
HIPAlignableSpecificParameters::minNHits
int minNHits
Definition: HIPAlignableSpecificParameters.h:17
HIPAlignmentAlgorithm::m2_ObjId
align::StructureType m2_ObjId
Definition: HIPAlignmentAlgorithm.h:158
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
HIPAlignmentAlgorithm::rewgtPerAli
bool rewgtPerAli
Definition: HIPAlignmentAlgorithm.h:134
HIPAlignmentAlgorithm::theAlignables
align::Alignables theAlignables
Definition: HIPAlignmentAlgorithm.h:93
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
Point3DBase< float, GlobalTag >
HIPAlignmentAlgorithm::collector
void collector(void)
Definition: HIPAlignmentAlgorithm.cc:1321
HIPAlignmentAlgorithm::ioerr
int ioerr
Definition: HIPAlignmentAlgorithm.h:97
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:130
HIPTrackMonitorVariables::m_dz
std::vector< float > m_dz
Definition: HIPMonitorConfig.h:29
HIPUserVariablesIORoot
Definition: HIPUserVariablesIORoot.h:10
HIPUserVariables::alindof
int alindof
Definition: HIPUserVariables.h:10
HIPAlignmentAlgorithm::surveyResiduals_
const std::vector< std::string > surveyResiduals_
Definition: HIPAlignmentAlgorithm.h:141
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
HIPUserVariables::nhit
int nhit
Definition: HIPUserVariables.h:11
HIPAlignmentAlgorithm::topoToken_
const edm::ESGetToken< TrackerTopology, IdealGeometryRecord > topoToken_
Definition: HIPAlignmentAlgorithm.h:88
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
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HIPAlignmentAlgorithm::processHit1D
bool processHit1D(const AlignableDetOrUnitPtr &alidet, const Alignable *ali, const HIPAlignableSpecificParameters *alispecifics, const TrajectoryStateOnSurface &tsos, const TrackingRecHit *hit, double hitwt)
Definition: HIPAlignmentAlgorithm.cc:513
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
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:164
HIPAlignmentAlgorithm::theAlignableDetAccessor
std::unique_ptr< AlignableNavigator > theAlignableDetAccessor
Definition: HIPAlignmentAlgorithm.h:94
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:39
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:98
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:161
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
HIPAlignmentAlgorithm::theIO
AlignmentIORoot theIO
Definition: HIPAlignmentAlgorithm.h:96
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::topoToken2_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken2_
Definition: HIPAlignmentAlgorithm.h:89
HIPAlignmentAlgorithm::trackPs
bool trackPs
Definition: HIPAlignmentAlgorithm.h:134
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:112
SiStripRecHit1D
Definition: SiStripRecHit1D.h:8
HIPAlignmentAlgorithm::themultiIOV
bool themultiIOV
Definition: HIPAlignmentAlgorithm.h:111
tname
std::string tname(const std::string &tableName, const std::string &schemaVersion)
Definition: CredentialStore.cc:150
res
Definition: Electron.h:6
HIPAlignmentAlgorithm::calcParameters
bool calcParameters(Alignable *ali, int setDet, double start, double step)
Definition: HIPAlignmentAlgorithm.cc:1224
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
Trajectory::measurements
DataContainer const & measurements() const
Definition: Trajectory.h:178
HIPAlignmentAlgorithm::theHitMonitorTree
TTree * theHitMonitorTree
Definition: HIPAlignmentAlgorithm.h:147
looper.cfg
cfg
Definition: looper.py:296
TrackingRecHit
Definition: TrackingRecHit.h:21
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HIPAlignmentAlgorithm::verbose
const bool verbose
Definition: HIPAlignmentAlgorithm.h:103
HIPTrackMonitorVariables::m_nhTID
std::vector< int > m_nhTID
Definition: HIPMonitorConfig.h:30
HIPAlignmentAlgorithm::struefile
std::string struefile
Definition: HIPAlignmentAlgorithm.h:109
TrajectoryMeasurement::recHit
ConstRecHitPointer const & recHit() const
Definition: TrajectoryMeasurement.h:190
DDAxes::phi
dumpTauVariables_cfi.eventInfo
eventInfo
add run, event number and lumi section
Definition: dumpTauVariables_cfi.py:12
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:123
HIPAlignmentAlgorithm::doTrackHitMonitoring
const bool doTrackHitMonitoring
Definition: HIPAlignmentAlgorithm.h:106
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
HIPAlignmentAlgorithm::theDataGroup
int theDataGroup
Definition: HIPAlignmentAlgorithm.h:133
HIPAlignmentAlgorithm::col_cut
double col_cut
Definition: HIPAlignmentAlgorithm.h:136
HIPAlignmentAlgorithm::theCollectorPath
std::string theCollectorPath
Definition: HIPAlignmentAlgorithm.h:132
HIPAlignmentAlgorithm::siterationfile
std::string siterationfile
Definition: HIPAlignmentAlgorithm.h:109
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:51
HIPAlignmentAlgorithm::theAlignmentParameterStore
AlignmentParameterStore * theAlignmentParameterStore
Definition: HIPAlignmentAlgorithm.h:92
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
AlignmentAlgorithmBase::AlignmentAlgorithmBase
AlignmentAlgorithmBase(const edm::ParameterSet &, const edm::ConsumesCollector &)
Constructor.
Definition: AlignmentAlgorithmBase.h:115
Exception
Definition: hltDiff.cc:245
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:134
HIPTrackMonitorVariables::m_Nhits
std::vector< int > m_Nhits
Definition: HIPMonitorConfig.h:30
HIPAlignmentAlgorithm::m3_par
float m3_par[6]
Definition: HIPAlignmentAlgorithm.h:169
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:161
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:109
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
HIPAlignmentAlgorithm::theSurveyTree
TTree * theSurveyTree
Definition: HIPAlignmentAlgorithm.h:151
mps_fire.result
result
Definition: mps_fire.py:311
HIPAlignmentAlgorithm::suvarfilecore
std::string suvarfilecore
Definition: HIPAlignmentAlgorithm.h:108
cms::Exception
Definition: Exception.h:70
HIPAlignmentAlgorithm::cos_cut
double cos_cut
Definition: HIPAlignmentAlgorithm.h:136
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:167
HIPMonitorConfig::fillTrackMonitoring
const bool fillTrackMonitoring
Definition: HIPMonitorConfig.h:119
HIPAlignmentAlgorithm::setAlignmentPositionError
void setAlignmentPositionError(void)
Definition: HIPAlignmentAlgorithm.cc:1019
HIPTrackMonitorVariables::m_Eta
std::vector< float > m_Eta
Definition: HIPMonitorConfig.h:29
HIPAlignmentAlgorithm::theSurveyIORootFile
TFile * theSurveyIORootFile
Definition: HIPAlignmentAlgorithm.h:150
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
edm::Transition::EndRun
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:85
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:1476
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:159
HIPHitMonitorVariables::m_probXY
float m_probXY
Definition: HIPMonitorConfig.h:87
HIPAlignmentAlgorithm::theAPEParameterSet
std::vector< edm::ParameterSet > theAPEParameterSet
Definition: HIPAlignmentAlgorithm.h:116
HIPAlignmentAlgorithm::m3_ObjId
align::StructureType m3_ObjId
Definition: HIPAlignmentAlgorithm.h:168
HIPAlignmentAlgorithm::Scale
double Scale
Definition: HIPAlignmentAlgorithm.h:136
HIPHitMonitorVariables::bookBranches
void bookBranches() override
Definition: HIPMonitorConfig.cc:62