CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Protected Member Functions
CTPPSRPAlignmentCorrectionsMethods Class Reference

#include <CTPPSRPAlignmentCorrectionsMethods.h>

Public Member Functions

 CTPPSRPAlignmentCorrectionsMethods ()
 

Static Public Member Functions

static std::string iovValueToString (const edm::IOVSyncValue &)
 
static CTPPSRPAlignmentCorrectionsDataSequence loadFromXML (const std::string &fileName)
 loads sequence of alignment corrections from XML file More...
 
static edm::IOVSyncValue stringToIOVValue (const std::string &)
 
static void writeToXML (const CTPPSRPAlignmentCorrectionsDataSequence &seq, const std::string &fileName, bool precise=false, bool wrErrors=true, bool wrSh_xy=true, bool wrSh_z=false, bool wrRot_xy=false, bool wrRot_z=true)
 writes sequence of alignment corrections into a single XML file More...
 
static void writeToXML (const CTPPSRPAlignmentCorrectionsData &ad, const std::string &fileName, bool precise=false, bool wrErrors=true, bool wrSh_xy=true, bool wrSh_z=false, bool wrRot_xy=false, bool wrRot_z=true)
 writes alignment corrections into a single XML file, assigning infinite interval of validity More...
 

Static Protected Member Functions

static CTPPSRPAlignmentCorrectionsData getCorrectionsData (xercesc::DOMNode *)
 load corrections data corresponding to one IOV More...
 
static void writeXML (const CTPPSRPAlignmentCorrectionData &data, FILE *f, bool precise, bool wrErrors, bool wrSh_xy, bool wrSh_z, bool wrRot_xy, bool wrRot_z)
 writes data of a correction in XML format More...
 
static void writeXMLBlock (const CTPPSRPAlignmentCorrectionsData &, FILE *, bool precise=false, bool wrErrors=true, bool wrSh_xy=true, bool wrSh_z=false, bool wrRot_xy=false, bool wrRot_z=true)
 writes a block of corrections into a file More...
 

Detailed Description

Definition at line 22 of file CTPPSRPAlignmentCorrectionsMethods.h.

Constructor & Destructor Documentation

◆ CTPPSRPAlignmentCorrectionsMethods()

CTPPSRPAlignmentCorrectionsMethods::CTPPSRPAlignmentCorrectionsMethods ( )
inline

Definition at line 24 of file CTPPSRPAlignmentCorrectionsMethods.h.

24 {}

Member Function Documentation

◆ getCorrectionsData()

CTPPSRPAlignmentCorrectionsData CTPPSRPAlignmentCorrectionsMethods::getCorrectionsData ( xercesc::DOMNode *  )
staticprotected

load corrections data corresponding to one IOV

Definition at line 209 of file CTPPSRPAlignmentCorrectionsMethods.cc.

References a, class-composition::children, MillePedeFileConverter_cfg::e, Exception, mps_fire::i, dqmiolumiharvest::j, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, cms::xerces::toDouble(), cms::xerces::toString(), and cms::xerces::toUInt().

Referenced by loadFromXML().

209  {
211 
212  DOMNodeList* children = root->getChildNodes();
213  for (unsigned int i = 0; i < children->getLength(); i++) {
214  DOMNode* node = children->item(i);
215  if (node->getNodeType() != DOMNode::ELEMENT_NODE)
216  continue;
217 
218  const std::string node_name = cms::xerces::toString(node->getNodeName());
219 
220  // check node type
221  unsigned char nodeType = 0;
222  if (node_name == "det")
223  nodeType = 1;
224  else if (node_name == "rp")
225  nodeType = 2;
226 
227  if (nodeType == 0)
228  throw cms::Exception("CTPPSRPAlignmentCorrectionsMethods")
229  << "Unknown node `" << cms::xerces::toString(node->getNodeName()) << "'.";
230 
231  // check children
232  if (node->getChildNodes()->getLength() > 0) {
233  edm::LogProblem("CTPPSRPAlignmentCorrectionsMethods")
234  << "LoadXMLFile > Warning: tag `" << cms::xerces::toString(node->getNodeName()) << "' has "
235  << node->getChildNodes()->getLength() << " children nodes - they will be all ignored.";
236  }
237 
238  // default values
239  double sh_x = 0., sh_y = 0., sh_z = 0., rot_x = 0., rot_y = 0., rot_z = 0.;
240  double sh_x_e = 0., sh_y_e = 0., sh_z_e = 0., rot_x_e = 0., rot_y_e = 0., rot_z_e = 0.;
241  unsigned int id = 0;
242  bool idSet = false;
243 
244  // get attributes
245  DOMNamedNodeMap* attr = node->getAttributes();
246  for (unsigned int j = 0; j < attr->getLength(); j++) {
247  DOMNode* a = attr->item(j);
248  const std::string node_name = cms::xerces::toString(a->getNodeName());
249 
250  if (node_name == "id") {
251  id = cms::xerces::toUInt(a->getNodeValue());
252  idSet = true;
253  } else if (node_name == "sh_x")
254  sh_x = cms::xerces::toDouble(a->getNodeValue());
255  else if (node_name == "sh_x_e")
256  sh_x_e = cms::xerces::toDouble(a->getNodeValue());
257  else if (node_name == "sh_y")
258  sh_y = cms::xerces::toDouble(a->getNodeValue());
259  else if (node_name == "sh_y_e")
260  sh_y_e = cms::xerces::toDouble(a->getNodeValue());
261  else if (node_name == "sh_z")
262  sh_z = cms::xerces::toDouble(a->getNodeValue());
263  else if (node_name == "sh_z_e")
264  sh_z_e = cms::xerces::toDouble(a->getNodeValue());
265  else if (node_name == "rot_x")
266  rot_x = cms::xerces::toDouble(a->getNodeValue());
267  else if (node_name == "rot_x_e")
268  rot_x_e = cms::xerces::toDouble(a->getNodeValue());
269  else if (node_name == "rot_y")
270  rot_y = cms::xerces::toDouble(a->getNodeValue());
271  else if (node_name == "rot_y_e")
272  rot_y_e = cms::xerces::toDouble(a->getNodeValue());
273  else if (node_name == "rot_z")
274  rot_z = cms::xerces::toDouble(a->getNodeValue());
275  else if (node_name == "rot_z_e")
276  rot_z_e = cms::xerces::toDouble(a->getNodeValue());
277  else
278  edm::LogProblem("CTPPSRPAlignmentCorrectionsMethods")
279  << ">> CTPPSRPAlignmentCorrectionsMethods::getCorrectionsData > Warning: unknown attribute `"
280  << cms::xerces::toString(a->getNodeName()) << "'.";
281  }
282 
283  // id must be set
284  if (!idSet)
285  throw cms::Exception("CTPPSRPAlignmentCorrectionsMethods")
286  << "Id not set for tag `" << cms::xerces::toString(node->getNodeName()) << "'.";
287 
288  // build alignment
289  const CTPPSRPAlignmentCorrectionData align_corr(sh_x * 1e-3,
290  sh_x_e * 1e-3,
291  sh_y * 1e-3,
292  sh_y_e * 1e-3,
293  sh_z * 1e-3,
294  sh_z_e * 1e-3,
295  rot_x * 1e-3,
296  rot_x_e * 1e-3,
297  rot_y * 1e-3,
298  rot_y_e * 1e-3,
299  rot_z * 1e-3,
300  rot_z_e * 1e-3);
301 
302  // add the alignment to the right list
303  if (nodeType == 1)
304  result.addSensorCorrection(id, align_corr, true);
305  if (nodeType == 2)
306  result.addRPCorrection(id, align_corr, true);
307  }
308 
309  return result;
310 }
double toDouble(XMLCh const *toTranscode)
std::string toString(XMLCh const *toTranscode)
unsigned int toUInt(XMLCh const *toTranscode)
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
double a
Definition: hdecay.h:121
Alignment correction for an element of the CT-PPS detector. Within the geometry description, every sensor (more generally every element) is given its translation and rotation. These two quantities shall be understood in local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then it holds.
Log< level::Error, true > LogProblem

◆ iovValueToString()

std::string CTPPSRPAlignmentCorrectionsMethods::iovValueToString ( const edm::IOVSyncValue val)
static

Definition at line 95 of file CTPPSRPAlignmentCorrectionsMethods.cc.

References edm::IOVSyncValue::beginOfTime(), visDQMUpload::buf, edm::IOVSyncValue::endOfTime(), and heppy_batch::val.

Referenced by CTPPSRPAlignmentCorrectionsDataESSourceXMLCommon::Merge(), CTPPSRPAlignmentCorrectionsDataESSourceXML::setIntervalFor(), and writeToXML().

95  {
97  return "-inf";
98 
100  return "+inf";
101 
102  char buf[50];
103  sprintf(buf, "%u:%u", val.eventID().run(), val.eventID().luminosityBlock());
104  return buf;
105 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88

◆ loadFromXML()

CTPPSRPAlignmentCorrectionsDataSequence CTPPSRPAlignmentCorrectionsMethods::loadFromXML ( const std::string &  fileName)
static

loads sequence of alignment corrections from XML file

Definition at line 109 of file CTPPSRPAlignmentCorrectionsMethods.cc.

References edm::IOVSyncValue::beginOfTime(), class-composition::children, edm::IOVSyncValue::endOfTime(), Exception, MillePedeFileConverter_cfg::fileName, dqmdumpme::first, getCorrectionsData(), mps_fire::i, dqmiolumiharvest::j, dqmdumpme::last, convertSQLitetoXML_cfg::output, writedatasetfile::parser, AlCaHLTBitMon_QueryRunRegistry::string, stringToIOVValue(), and cms::xerces::toString().

Referenced by PPSModifySingularModes::beginRun(), and CTPPSRPAlignmentCorrectionsDataESSourceXMLCommon::PrepareSequence().

109  {
110  // prepare output
112 
113  // load DOM tree
114  try {
115  XMLPlatformUtils::Initialize();
116  } catch (const XMLException& toCatch) {
117  throw cms::Exception("CTPPSRPAlignmentCorrectionsMethods")
118  << "An XMLException caught with message: " << cms::xerces::toString(toCatch.getMessage()) << ".";
119  }
120 
121  auto parser = std::make_unique<XercesDOMParser>();
122  parser->setValidationScheme(XercesDOMParser::Val_Always);
123  parser->setDoNamespaces(true);
124  parser->parse(fileName.c_str());
125 
126  if (!parser)
127  throw cms::Exception("CTPPSRPAlignmentCorrectionsMethods")
128  << "Cannot parse file `" << fileName << "' (parser = NULL).";
129 
130  DOMDocument* xmlDoc = parser->getDocument();
131 
132  if (!xmlDoc)
133  throw cms::Exception("CTPPSRPAlignmentCorrectionsMethods")
134  << "Cannot parse file `" << fileName << "' (xmlDoc = NULL).";
135 
136  DOMElement* elementRoot = xmlDoc->getDocumentElement();
137  if (!elementRoot)
138  throw cms::Exception("CTPPSRPAlignmentCorrectionsMethods") << "File `" << fileName << "' is empty.";
139 
140  // extract useful information form the DOM tree
141  DOMNodeList* children = elementRoot->getChildNodes();
142  for (unsigned int i = 0; i < children->getLength(); i++) {
143  DOMNode* node = children->item(i);
144  if (node->getNodeType() != DOMNode::ELEMENT_NODE)
145  continue;
146 
147  const std::string node_name = cms::xerces::toString(node->getNodeName());
148 
149  // check node type
150  unsigned char nodeType = 0;
151  if (node_name == "iov")
152  nodeType = 1;
153  else if (node_name == "det")
154  nodeType = 2;
155  else if (node_name == "rp")
156  nodeType = 3;
157 
158  if (nodeType == 0)
159  throw cms::Exception("CTPPSRPAlignmentCorrectionsMethods") << "Unknown node `" << node_name << "'.";
160 
161  // for backward compatibility: support files with no iov block
162  if (nodeType == 2 || nodeType == 3) {
164  output.insert(iov, getCorrectionsData(elementRoot));
165  break;
166  }
167 
168  // get attributes
170  bool first_set = false, last_set = false;
171  DOMNamedNodeMap* attrs = node->getAttributes();
172  for (unsigned int j = 0; j < attrs->getLength(); j++) {
173  const DOMNode* attr = attrs->item(j);
174  const std::string attr_name = cms::xerces::toString(attr->getNodeName());
175 
176  if (attr_name == "first") {
177  first_set = true;
178  first = stringToIOVValue(cms::xerces::toString(attr->getNodeValue()));
179  } else if (attr_name == "last") {
180  last_set = true;
181  last = stringToIOVValue(cms::xerces::toString(attr->getNodeValue()));
182  } else
183  edm::LogProblem("CTPPSRPAlignmentCorrectionsMethods")
184  << ">> CTPPSRPAlignmentCorrectionsDataSequence::loadFromXML > Warning: unknown attribute `" << attr_name
185  << "'.";
186  }
187 
188  // interval of validity must be set
189  if (!first_set || !last_set)
190  throw cms::Exception("CTPPSRPAlignmentCorrectionsMethods")
191  << "iov tag must have `first' and `last' attributes set.";
192 
193  // process data
195 
196  // save result
197  output.insert(edm::ValidityInterval(first, last), corrections);
198  }
199 
200  // clean up
201  parser.reset();
202  XMLPlatformUtils::Terminate();
203 
204  return output;
205 }
static edm::IOVSyncValue stringToIOVValue(const std::string &)
Time sequence of alignment corrections. I/O methods have been factored out to: CondFormats/PPSObjects...
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::string toString(XMLCh const *toTranscode)
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
Definition: output.py:1
static CTPPSRPAlignmentCorrectionsData getCorrectionsData(xercesc::DOMNode *)
load corrections data corresponding to one IOV
Log< level::Error, true > LogProblem

◆ stringToIOVValue()

edm::IOVSyncValue CTPPSRPAlignmentCorrectionsMethods::stringToIOVValue ( const std::string &  str)
static

STRUCTURE OF CTPPS ALINGMENT XML FILE The file has the following structure <xml> <iov first="run:ls" last="run:ls"> <tag> <tag> ... </iov> <iov first="run:ls" last="run:ls"> ... </iov></xml> The time intervals are specified by the ‘first’ and ‘last’ run-lumisection pairs. If the <iov> tag is not present, an infinite validty is assumed for all the tags. The tag can be either "det" - the alignment correction is applied to one detector or "rp" - the alignment correction id applied to one RP Each tag must have an "id" attribute set. In addition the following attributes are recognized: sh_x - shift in x sh_x_e - the uncertainty of sh_x determination sh_y - shift in y sh_y_e - the uncertainty of sh_y determination sh_z - shift in z sh_z_e - the uncertainty of sh_z determination rot_x - rotation around x rot_x_e - the uncertainty of rot_x determination rot_y - rotation around y rot_y_e - the uncertainty of rot_y determination rot_z - rotation around z rot_z_e - the uncertainty of rot_z determination UNITS: shifts are in um, rotations are in mrad.

Definition at line 79 of file CTPPSRPAlignmentCorrectionsMethods.cc.

References edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime(), str, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by loadFromXML().

79  {
80  if (str == "-inf")
82 
83  if (str == "+inf")
85 
86  size_t sep_pos = str.find(':');
87  const std::string& runStr = str.substr(0, sep_pos);
88  const std::string& lsStr = str.substr(sep_pos + 1);
89 
90  return edm::IOVSyncValue(edm::EventID(atoi(runStr.c_str()), atoi(lsStr.c_str()), 1));
91 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
#define str(s)

◆ writeToXML() [1/2]

void CTPPSRPAlignmentCorrectionsMethods::writeToXML ( const CTPPSRPAlignmentCorrectionsDataSequence seq,
const std::string &  fileName,
bool  precise = false,
bool  wrErrors = true,
bool  wrSh_xy = true,
bool  wrSh_z = false,
bool  wrRot_xy = false,
bool  wrRot_z = true 
)
static

writes sequence of alignment corrections into a single XML file

Definition at line 315 of file CTPPSRPAlignmentCorrectionsMethods.cc.

References data, Exception, MillePedeFileConverter_cfg::fileName, iovValueToString(), AlCaHLTBitMon_ParallelJobs::p, hltPixelTracks_cff::precise, hcal_runs::rf, and writeXMLBlock().

Referenced by PPSModifySingularModes::beginRun(), StraightTrackAlignment::finish(), and writeToXML().

322  {
323  FILE* rf = fopen(fileName.c_str(), "w");
324  if (!rf)
325  throw cms::Exception("CTPPSRPAlignmentCorrectionsMethods")
326  << "Cannot open file `" << fileName << "' to save alignments.";
327 
328  fprintf(rf, "<!-- Shifts in um, rotations in mrad. -->\n");
329  fprintf(rf, "<xml DocumentType=\"AlignmentDescription\">\n");
330 
331  // write all IOVs
332  for (const auto& p : data) {
333  fprintf(rf,
334  "\t<iov first=\"%s\" last=\"%s\">\n",
335  iovValueToString(p.first.first()).c_str(),
336  iovValueToString(p.first.last()).c_str());
337 
338  writeXMLBlock(p.second, rf, precise, wrErrors, wrSh_xy, wrSh_z, wrRot_xy, wrRot_z);
339 
340  fprintf(rf, "\t</iov>\n");
341  }
342 
343  fprintf(rf, "</xml>\n");
344  fclose(rf);
345 }
static std::string iovValueToString(const edm::IOVSyncValue &)
static void writeXMLBlock(const CTPPSRPAlignmentCorrectionsData &, FILE *, bool precise=false, bool wrErrors=true, bool wrSh_xy=true, bool wrSh_z=false, bool wrRot_xy=false, bool wrRot_z=true)
writes a block of corrections into a file
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ writeToXML() [2/2]

static void CTPPSRPAlignmentCorrectionsMethods::writeToXML ( const CTPPSRPAlignmentCorrectionsData ad,
const std::string &  fileName,
bool  precise = false,
bool  wrErrors = true,
bool  wrSh_xy = true,
bool  wrSh_z = false,
bool  wrRot_xy = false,
bool  wrRot_z = true 
)
inlinestatic

writes alignment corrections into a single XML file, assigning infinite interval of validity

Definition at line 40 of file CTPPSRPAlignmentCorrectionsMethods.h.

References edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime(), MillePedeFileConverter_cfg::fileName, hltPixelTracks_cff::precise, alignCSCRings::s, and writeToXML().

47  {
50  s.insert(iov, ad);
51  writeToXML(s, fileName, precise, wrErrors, wrSh_xy, wrSh_z, wrRot_xy, wrRot_z);
52  }
Time sequence of alignment corrections. I/O methods have been factored out to: CondFormats/PPSObjects...
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
static void writeToXML(const CTPPSRPAlignmentCorrectionsDataSequence &seq, const std::string &fileName, bool precise=false, bool wrErrors=true, bool wrSh_xy=true, bool wrSh_z=false, bool wrRot_xy=false, bool wrRot_z=true)
writes sequence of alignment corrections into a single XML file

◆ writeXML()

void CTPPSRPAlignmentCorrectionsMethods::writeXML ( const CTPPSRPAlignmentCorrectionData data,
FILE *  f,
bool  precise,
bool  wrErrors,
bool  wrSh_xy,
bool  wrSh_z,
bool  wrRot_xy,
bool  wrRot_z 
)
staticprotected

writes data of a correction in XML format

Definition at line 433 of file CTPPSRPAlignmentCorrectionsMethods.cc.

References data, and WRITE.

Referenced by writeXMLBlock().

440  {
441  if (wrSh_xy) {
442  WRITE(data.getShX(), "sh_x", 2, 0.1);
443  WRITE(data.getShY(), "sh_y", 2, 0.1);
444  if (wrErrors) {
445  WRITE(data.getShXUnc(), "sh_x_e", 2, 0.1);
446  WRITE(data.getShYUnc(), "sh_y_e", 2, 0.1);
447  }
448  }
449 
450  if (wrSh_z) {
451  WRITE(data.getShZ(), "sh_z", 2, 0.1);
452  if (wrErrors) {
453  WRITE(data.getShZUnc(), "sh_z_e", 2, 0.1);
454  }
455  }
456 
457  if (wrRot_xy) {
458  WRITE(data.getRotX(), "rot_x", 3, 0.01);
459  WRITE(data.getRotY(), "rot_y", 3, 0.01);
460  if (wrErrors) {
461  WRITE(data.getRotXUnc(), "rot_x_e", 3, 0.01);
462  WRITE(data.getRotYUnc(), "rot_y_e", 3, 0.01);
463  }
464  }
465 
466  if (wrRot_z) {
467  WRITE(data.getRotZ(), "rot_z", 3, 0.01);
468  if (wrErrors) {
469  WRITE(data.getRotZUnc(), "rot_z_e", 3, 0.01);
470  }
471  }
472 }
#define WRITE(q, tag, dig, lim)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ writeXMLBlock()

void CTPPSRPAlignmentCorrectionsMethods::writeXMLBlock ( const CTPPSRPAlignmentCorrectionsData data,
FILE *  rf,
bool  precise = false,
bool  wrErrors = true,
bool  wrSh_xy = true,
bool  wrSh_z = false,
bool  wrRot_xy = false,
bool  wrRot_z = true 
)
staticprotected

writes a block of corrections into a file

Definition at line 347 of file CTPPSRPAlignmentCorrectionsMethods.cc.

References CTPPSDetId::arm(), data, protons_cff::decRPId, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, CTPPSPixelDetId::plane(), CTPPSDiamondDetId::plane(), TotemRPDetId::plane(), hltPixelTracks_cff::precise, hcal_runs::rf, CTPPSDetId::rp(), CTPPSDetId::rpId(), CTPPSDetId::sdTimingDiamond, CTPPSDetId::sdTrackingPixel, CTPPSDetId::sdTrackingStrip, CTPPSDetId::station(), DetId::subdetId(), and writeXML().

Referenced by writeToXML().

354  {
355  bool firstRP = true;
356  unsigned int prevRP = 0;
357  std::set<unsigned int> writtenRPs;
358 
359  const auto& sensors = data.getSensorMap();
360  const auto& rps = data.getRPMap();
361 
362  for (auto it = sensors.begin(); it != sensors.end(); ++it) {
363  CTPPSDetId sensorId(it->first);
364  unsigned int rpId = sensorId.rpId();
365  unsigned int decRPId = sensorId.arm() * 100 + sensorId.station() * 10 + sensorId.rp();
366 
367  // start a RP block
368  if (firstRP || prevRP != rpId) {
369  if (!firstRP)
370  fprintf(rf, "\n");
371  firstRP = false;
372 
373  fprintf(rf, "\t<!-- RP %3u -->\n", decRPId);
374 
375  auto rit = rps.find(rpId);
376  if (rit != rps.end()) {
377  fprintf(rf, "\t<rp id=\"%u\" ", rit->first);
378  writeXML(rit->second, rf, precise, wrErrors, wrSh_xy, wrSh_z, wrRot_xy, wrRot_z);
379  fprintf(rf, "/>\n");
380  writtenRPs.insert(rpId);
381  }
382  }
383  prevRP = rpId;
384 
385  // write plane id
386  unsigned int planeIdx = 1000;
387  if (sensorId.subdetId() == CTPPSDetId::sdTrackingStrip)
388  planeIdx = TotemRPDetId(it->first).plane();
389  if (sensorId.subdetId() == CTPPSDetId::sdTrackingPixel)
390  planeIdx = CTPPSPixelDetId(it->first).plane();
391  if (sensorId.subdetId() == CTPPSDetId::sdTimingDiamond)
392  planeIdx = CTPPSDiamondDetId(it->first).plane();
393  fprintf(rf, "\t<!-- plane %u --> ", planeIdx);
394 
395  // write the correction
396  fprintf(rf, "<det id=\"%u\"", it->first);
397  writeXML(it->second, rf, precise, wrErrors, wrSh_xy, wrSh_z, wrRot_xy, wrRot_z);
398  fprintf(rf, "/>\n");
399  }
400 
401  // write remaining RPs
402  for (auto it = rps.begin(); it != rps.end(); ++it) {
403  std::set<unsigned int>::iterator wit = writtenRPs.find(it->first);
404  if (wit == writtenRPs.end()) {
405  CTPPSDetId rpId(it->first);
406  unsigned int decRPId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
407 
408  if (!firstRP)
409  fprintf(rf, "\n");
410  firstRP = false;
411 
412  fprintf(rf, "\t<!-- RP %3u -->\n", decRPId);
413 
414  fprintf(rf, "\t<rp id=\"%u\" ", it->first);
415  writeXML(it->second, rf, precise, wrErrors, wrSh_xy, wrSh_z, wrRot_xy, wrRot_z);
416  fprintf(rf, "/>\n");
417  }
418  }
419 }
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
uint32_t plane() const
uint32_t plane() const
Definition: TotemRPDetId.h:46
uint32_t plane() const
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
static void writeXML(const CTPPSRPAlignmentCorrectionData &data, FILE *f, bool precise, bool wrErrors, bool wrSh_xy, bool wrSh_z, bool wrRot_xy, bool wrRot_z)
writes data of a correction in XML format