CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
sistrip::MeasureLA Class Reference

#include <MeasureLA.h>

Inheritance diagram for sistrip::MeasureLA:
edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Member Functions

 MeasureLA (const edm::ParameterSet &)
 
std::unique_ptr< SiStripLorentzAngleproduce (const SiStripLorentzAngleRcd &)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Types

enum  GRANULARITY { LAYER = 0, MODULE = 1, MODULESUMMARY = 2 }
 

Private Member Functions

void calibrate (const std::pair< unsigned, LA_Filler_Fitter::Method >, LA_Filler_Fitter::Result &) const
 
std::pair< unsigned, LA_Filler_Fitter::Methodcalibration_key (const std::string layer, const LA_Filler_Fitter::Method) const
 
std::pair< unsigned, LA_Filler_Fitter::Methodcalibration_key (const uint32_t detid, const LA_Filler_Fitter::Method) const
 
void process_reports () const
 
void store_calibrations ()
 
void store_methods_and_granularity (const edm::VParameterSet &)
 
void summarize_module_muH_byLayer (const LA_Filler_Fitter &)
 
void write_report_plots (const std::string, const LA_Filler_Fitter::Method, const GRANULARITY) const
 
template<class T >
void write_report_text (const std::string, const LA_Filler_Fitter::Method &, const std::map< T, LA_Filler_Fitter::Result > &) const
 
void write_report_text_ms (const std::string, const LA_Filler_Fitter::Method) const
 

Static Private Member Functions

static std::string granularity (int32_t g)
 

Private Attributes

Book book
 
bool byLayer
 
bool byModule
 
const edm::VParameterSet calibrations
 
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > error_scaling
 
const edm::FileInPath fp_
 
const std::string inFileLocation
 
const std::vector< std::string > inputFiles
 
const float localybin
 
const unsigned maxEvents
 
const edm::VParameterSet measurementPreferences
 
int32_t methods
 
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > offset
 
const edm::VParameterSet reports
 
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > slope
 
const unsigned stripsperbin
 
TrackerTopology tTopo_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 17 of file MeasureLA.h.

Member Enumeration Documentation

◆ GRANULARITY

Enumerator
LAYER 
MODULE 
MODULESUMMARY 

Definition at line 23 of file MeasureLA.h.

Constructor & Destructor Documentation

◆ MeasureLA()

sistrip::MeasureLA::MeasureLA ( const edm::ParameterSet conf)
explicit

Definition at line 21 of file MeasureLA.cc.

References book, byLayer, byModule, geometryDiff::file, LA_Filler_Fitter::fill(), LA_Filler_Fitter::fit(), inFileLocation, inputFiles, localybin, maxEvents, measurementPreferences, methods, process_reports(), produce(), reports, edm::ESProducer::setWhatProduced(), store_calibrations(), store_methods_and_granularity(), stripsperbin, summarize_module_muH_byLayer(), and tTopo_.

22  : inputFiles(conf.getParameter<std::vector<std::string> >("InputFiles")),
23  inFileLocation(conf.getParameter<std::string>("InFileLocation")),
24  fp_(conf.getParameter<edm::FileInPath>("SiStripDetInfo")),
25  reports(conf.getParameter<edm::VParameterSet>("Reports")),
26  measurementPreferences(conf.getParameter<edm::VParameterSet>("MeasurementPreferences")),
27  calibrations(conf.getParameter<edm::VParameterSet>("Calibrations")),
28  methods(0),
29  byModule(false),
30  byLayer(false),
31  localybin(conf.getUntrackedParameter<double>("LocalYBin", 0.0)),
32  stripsperbin(conf.getUntrackedParameter<unsigned>("StripsPerBin", 0)),
33  maxEvents(conf.getUntrackedParameter<unsigned>("MaxEvents", 0)),
35  conf.getParameter<edm::FileInPath>("TrackerParameters").fullPath())) {
39 
40  TChain* const chain = new TChain("la_data");
41  for (auto const& file : inputFiles)
42  chain->Add((file + inFileLocation).c_str());
43 
45  laff.fill(chain, book);
46  laff.fit(book);
49 
51  }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
const edm::FileInPath fp_
Definition: MeasureLA.h:56
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void summarize_module_muH_byLayer(const LA_Filler_Fitter &)
Definition: MeasureLA.cc:67
const unsigned stripsperbin
Definition: MeasureLA.h:62
const edm::VParameterSet measurementPreferences
Definition: MeasureLA.h:57
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:35
const std::vector< std::string > inputFiles
Definition: MeasureLA.h:54
const unsigned maxEvents
Definition: MeasureLA.h:62
const float localybin
Definition: MeasureLA.h:61
void store_methods_and_granularity(const edm::VParameterSet &)
Definition: MeasureLA.cc:13
void process_reports() const
Definition: MeasureLA.cc:89
T getUntrackedParameter(std::string const &, T const &) const
const edm::VParameterSet calibrations
Definition: MeasureLA.h:57
const edm::VParameterSet reports
Definition: MeasureLA.h:57
const std::string inFileLocation
Definition: MeasureLA.h:55
std::unique_ptr< SiStripLorentzAngle > produce(const SiStripLorentzAngleRcd &)
Definition: MeasureLA.cc:53
void store_calibrations()
Definition: MeasureLA.cc:155
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
const std::string & fullPath() const
Definition: FileInPath.cc:144
TrackerTopology tTopo_
Definition: MeasureLA.h:65

Member Function Documentation

◆ calibrate()

void sistrip::MeasureLA::calibrate ( const std::pair< unsigned, LA_Filler_Fitter::Method key,
LA_Filler_Fitter::Result result 
) const
inlineprivate

Definition at line 174 of file MeasureLA.cc.

References error_scaling, submitPVResolutionJobs::key, offset, mps_fire::result, and slope.

Referenced by summarize_module_muH_byLayer(), and write_report_text().

175  {
176  result.calMeasured = std::make_pair<float, float>(
177  (result.measured.first - offset.find(key)->second) / slope.find(key)->second,
178  result.measured.second * error_scaling.find(key)->second / slope.find(key)->second);
179  }
key
prepare the HTCondor submission files and eventually submit them
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > error_scaling
Definition: MeasureLA.h:58
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > slope
Definition: MeasureLA.h:58
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > offset
Definition: MeasureLA.h:58

◆ calibration_key() [1/2]

std::pair< uint32_t, LA_Filler_Fitter::Method > sistrip::MeasureLA::calibration_key ( const std::string  layer,
const LA_Filler_Fitter::Method  method 
) const
private

Definition at line 181 of file MeasureLA.cc.

References dqm-mbProfile::format, LA_Filler_Fitter::layer_index(), and AlcaSiPixelAliHarvester0T_cff::method.

Referenced by summarize_module_muH_byLayer(), and write_report_text().

182  {
183  std::regex format(".*(T[IO]B)_layer(\\d)([as]).*");
184  const bool isTIB = "TIB" == std::regex_replace(layer, format, "\\1");
185  const bool stereo = "s" == std::regex_replace(layer, format, "\\3");
186  const unsigned layerNum = std::stoul(std::regex_replace(layer, format, "\\2"));
187  return std::make_pair(LA_Filler_Fitter::layer_index(isTIB, stereo, layerNum), method);
188  }
static unsigned layer_index(bool TIB, bool stereo, unsigned layer)

◆ calibration_key() [2/2]

std::pair< uint32_t, LA_Filler_Fitter::Method > sistrip::MeasureLA::calibration_key ( const uint32_t  detid,
const LA_Filler_Fitter::Method  method 
) const
private

Definition at line 190 of file MeasureLA.cc.

References ALCARECOPPSCalTrackBasedSel_cff::detid, LA_Filler_Fitter::layer_index(), AlcaSiPixelAliHarvester0T_cff::method, SiStripDetId::subDetector(), SiStripDetId::TIB, TrackerTopology::tibLayer(), TrackerTopology::tibStereo(), TrackerTopology::tobStereo(), and tTopo_.

191  {
192  const bool isTIB = SiStripDetId(detid).subDetector() == SiStripDetId::TIB;
193  const bool stereo = isTIB ? tTopo_.tibStereo(detid) : tTopo_.tobStereo(detid);
194  const unsigned layer = isTIB ? tTopo_.tibLayer(detid) : tTopo_.tobStereo(detid);
195 
196  return std::make_pair(LA_Filler_Fitter::layer_index(isTIB, stereo, layer), method);
197  }
static unsigned layer_index(bool TIB, bool stereo, unsigned layer)
SubDetector subDetector() const
Definition: SiStripDetId.h:105
uint32_t tobStereo(const DetId &id) const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
static constexpr auto TIB
Definition: SiStripDetId.h:37
unsigned int tibLayer(const DetId &id) const
uint32_t tibStereo(const DetId &id) const
TrackerTopology tTopo_
Definition: MeasureLA.h:65

◆ granularity()

static std::string sistrip::MeasureLA::granularity ( int32_t  g)
inlinestaticprivate

Definition at line 24 of file MeasureLA.h.

References g, LAYER, MODULE, and MODULESUMMARY.

Referenced by summarize_module_muH_byLayer(), write_report_plots(), and write_report_text_ms().

24  {
25  switch (g) {
26  case LAYER:
27  return "_layer";
28  case MODULE:
29  return "_module";
30  case MODULESUMMARY:
31  return "_moduleSummary";
32  }
33  return "";
34  };
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4

◆ process_reports()

void sistrip::MeasureLA::process_reports ( ) const
private

Definition at line 89 of file MeasureLA.cc.

References Book::begin(), book, Book::end(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LAYER, LA_Filler_Fitter::layer_results(), AlcaSiPixelAliHarvester0T_cff::method, MODULE, LA_Filler_Fitter::module_results(), MODULESUMMARY, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, reports, AlCaHLTBitMon_QueryRunRegistry::string, write_report_plots(), write_report_text(), and write_report_text_ms().

Referenced by MeasureLA().

89  {
90  for (auto const& p : reports) {
91  const GRANULARITY gran = (GRANULARITY)p.getParameter<int32_t>("Granularity");
92  const std::string name = p.getParameter<std::string>("ReportName");
93  const LA_Filler_Fitter::Method method = (LA_Filler_Fitter::Method)p.getParameter<int32_t>("Method");
94 
96  switch (gran) {
97  case LAYER:
99  break;
100  case MODULE:
102  break;
103  case MODULESUMMARY:
105  break;
106  }
107  }
108 
109  {
110  TFile widthsFile("widths.root", "RECREATE");
111  for (Book::const_iterator it = book.begin(".*_width"); it != book.end(); it++)
112  if (it->second)
113  it->second->Write();
114  widthsFile.Close();
115  }
116  }
static std::map< std::string, Result > layer_results(const Book &, const Method)
Definition: LA_Results.cc:69
const edm::VParameterSet reports
Definition: MeasureLA.h:57
iterator begin(string_t re=".*")
Definition: Book.h:57
void write_report_plots(const std::string, const LA_Filler_Fitter::Method, const GRANULARITY) const
Definition: MeasureLA.cc:118
static std::map< uint32_t, Result > module_results(const Book &, const Method)
Definition: LA_Results.cc:59
void write_report_text(const std::string, const LA_Filler_Fitter::Method &, const std::map< T, LA_Filler_Fitter::Result > &) const
Definition: MeasureLA.cc:129
boost::filter_iterator< match_name, book_t::const_iterator > const_iterator
Definition: Book.h:56
void write_report_text_ms(const std::string, const LA_Filler_Fitter::Method) const
Definition: MeasureLA.cc:142
iterator end(string_t re=".*")
Definition: Book.h:65

◆ produce()

std::unique_ptr< SiStripLorentzAngle > sistrip::MeasureLA::produce ( const SiStripLorentzAngleRcd )

Definition at line 53 of file MeasureLA.cc.

Referenced by MeasureLA().

53  {
54  auto lorentzAngle = std::make_unique<SiStripLorentzAngle>();
55  /*
56  std::map<uint32_t,LA_Filler_Fitter::Result>
57  module_results = LA_Filler_Fitter::module_results(book, LA_Filler_Fitter::SQRTVAR);
58 
59  BOOST_FOREACH(const uint32_t& detid, SiStripDetInfoFileReader::read(fp_.fullPath()).getAllDetIds()) {
60  float la = module_results[detid].measure / module_results[detid].field ;
61  lorentzAngle->putLorentzAngle( detid, la );
62  }
63  */
64  return lorentzAngle;
65  }

◆ store_calibrations()

void sistrip::MeasureLA::store_calibrations ( )
private

Definition at line 155 of file MeasureLA.cc.

References cms::cuda::assert(), calibrations, error_scaling, mps_fire::i, submitPVResolutionJobs::key, AlcaSiPixelAliHarvester0T_cff::method, offset, upgradeWorkflowComponents::offsets, AlCaHLTBitMon_ParallelJobs::p, and slope.

Referenced by MeasureLA().

155  {
156  for (auto const& p : calibrations) {
157  LA_Filler_Fitter::Method method = (LA_Filler_Fitter::Method)p.getParameter<int32_t>("Method");
158  std::vector<double> slopes(p.getParameter<std::vector<double> >("Slopes"));
159  assert(slopes.size() == 14);
160  std::vector<double> offsets(p.getParameter<std::vector<double> >("Offsets"));
161  assert(offsets.size() == 14);
162  std::vector<double> pulls(p.getParameter<std::vector<double> >("Pulls"));
163  assert(pulls.size() == 14);
164 
165  for (unsigned i = 0; i < 14; i++) {
166  const std::pair<unsigned, LA_Filler_Fitter::Method> key(i, method);
167  offset[key] = offsets[i];
168  slope[key] = slopes[i];
169  error_scaling[key] = pulls[i];
170  }
171  }
172  }
assert(be >=bs)
const edm::VParameterSet calibrations
Definition: MeasureLA.h:57
key
prepare the HTCondor submission files and eventually submit them
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > error_scaling
Definition: MeasureLA.h:58
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > slope
Definition: MeasureLA.h:58
std::map< std::pair< uint32_t, LA_Filler_Fitter::Method >, float > offset
Definition: MeasureLA.h:58

◆ store_methods_and_granularity()

void sistrip::MeasureLA::store_methods_and_granularity ( const edm::VParameterSet vpset)
private

Definition at line 13 of file MeasureLA.cc.

References byLayer, byModule, methods, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by MeasureLA().

13  {
14  for (auto const& p : vpset) {
15  methods |= p.getParameter<int32_t>("Method");
16  byModule = byModule || p.getParameter<int32_t>("Granularity");
17  byLayer = byLayer || !p.getParameter<int32_t>("Granularity");
18  }
19  }

◆ summarize_module_muH_byLayer()

void sistrip::MeasureLA::summarize_module_muH_byLayer ( const LA_Filler_Fitter laff)
private

Definition at line 67 of file MeasureLA.cc.

References Book::begin(), book, calibrate(), calibration_key(), Book::end(), Book::fill(), LA_Filler_Fitter::FIRST_METHOD, granularity(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, label, LA_Filler_Fitter::LAST_METHOD, LA_Filler_Fitter::layerLabel(), visualization-live-secondInstance_cfg::m, AlcaSiPixelAliHarvester0T_cff::method, LA_Filler_Fitter::method(), LA_Filler_Fitter::module_results(), MODULESUMMARY, funct::pow(), mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by MeasureLA().

67  {
71  calibrate(calibration_key(result.first, method), result.second);
74  label = std::regex_replace(label, std::regex("layer"), "");
75 
76  const double mu_H = -result.second.calMeasured.first / result.second.field;
77  const double sigma_mu_H = result.second.calMeasured.second / result.second.field;
78  const double weight = pow(1. / sigma_mu_H, 2);
79 
80  book.fill(mu_H, label, 150, -0.05, 0.1, weight);
81  }
82  for (Book::iterator it = book.begin(".*" + granularity(MODULESUMMARY) + ".*"); it != book.end(); ++it) {
83  if (it->second->GetEntries())
84  it->second->Fit("gaus", "LLQ");
85  }
86  }
87  }
Definition: weight.py:1
static std::string granularity(int32_t g)
Definition: MeasureLA.h:24
char const * label
boost::filter_iterator< match_name, book_t::iterator > iterator
Definition: Book.h:55
iterator begin(string_t re=".*")
Definition: Book.h:57
static std::string method(Method m, bool fit=true)
void calibrate(const std::pair< unsigned, LA_Filler_Fitter::Method >, LA_Filler_Fitter::Result &) const
Definition: MeasureLA.cc:174
void fill(double_t X, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
Definition: Book.h:96
static std::map< uint32_t, Result > module_results(const Book &, const Method)
Definition: LA_Results.cc:59
std::string layerLabel(const SiStripDetId) const
Definition: LA_Filler.cc:127
std::pair< unsigned, LA_Filler_Fitter::Method > calibration_key(const std::string layer, const LA_Filler_Fitter::Method) const
Definition: MeasureLA.cc:181
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
iterator end(string_t re=".*")
Definition: Book.h:65

◆ write_report_plots()

void sistrip::MeasureLA::write_report_plots ( const std::string  name,
const LA_Filler_Fitter::Method  method,
const GRANULARITY  gran 
) const
private

Definition at line 118 of file MeasureLA.cc.

References Book::begin(), book, Book::end(), geometryDiff::file, granularity(), compareTotals::hist, submitPVResolutionJobs::key, AlcaSiPixelAliHarvester0T_cff::method, LA_Filler_Fitter::method(), mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by process_reports().

118  {
119  TFile file((name + ".root").c_str(), "RECREATE");
120  const std::string key = ".*" + granularity(gran) + ".*(" + LA_Filler_Fitter::method(method) + "|" +
121  LA_Filler_Fitter::method(method, false) + ".*)";
123  if (hist->second)
124  hist->second->Write();
125  file.Close();
126  }
static std::string granularity(int32_t g)
Definition: MeasureLA.h:24
key
prepare the HTCondor submission files and eventually submit them
iterator begin(string_t re=".*")
Definition: Book.h:57
static std::string method(Method m, bool fit=true)
boost::filter_iterator< match_name, book_t::const_iterator > const_iterator
Definition: Book.h:56
iterator end(string_t re=".*")
Definition: Book.h:65

◆ write_report_text()

template<class T >
void sistrip::MeasureLA::write_report_text ( const std::string  name,
const LA_Filler_Fitter::Method _method,
const std::map< T, LA_Filler_Fitter::Result > &  _results 
) const
private

Definition at line 129 of file MeasureLA.cc.

References calibrate(), calibration_key(), geometryDiff::file, AlcaSiPixelAliHarvester0T_cff::method, mergeVDriftHistosByStation::name, MillePedeFileConverter_cfg::out, mps_fire::result, and mysort::results.

Referenced by process_reports().

131  {
133  std::map<T, LA_Filler_Fitter::Result> results = _results;
134  std::fstream file((name + ".dat").c_str(), std::ios::out);
135  for (auto& result : results) {
136  calibrate(calibration_key(result.first, method), result.second);
137  file << result.first << "\t" << result.second << std::endl;
138  }
139  file.close();
140  }
void calibrate(const std::pair< unsigned, LA_Filler_Fitter::Method >, LA_Filler_Fitter::Result &) const
Definition: MeasureLA.cc:174
results
Definition: mysort.py:8
std::pair< unsigned, LA_Filler_Fitter::Method > calibration_key(const std::string layer, const LA_Filler_Fitter::Method) const
Definition: MeasureLA.cc:181

◆ write_report_text_ms()

void sistrip::MeasureLA::write_report_text_ms ( const std::string  name,
const LA_Filler_Fitter::Method  method 
) const
private

Definition at line 142 of file MeasureLA.cc.

References Book::begin(), book, Book::end(), f, geometryDiff::file, granularity(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, submitPVResolutionJobs::key, AlcaSiPixelAliHarvester0T_cff::method, LA_Filler_Fitter::method(), MODULESUMMARY, mergeVDriftHistosByStation::name, MillePedeFileConverter_cfg::out, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by process_reports().

142  {
143  std::fstream file((name + ".dat").c_str(), std::ios::out);
145  for (Book::const_iterator it = book.begin(key); it != book.end(); ++it) {
146  const TF1* const f = it->second->GetFunction("gaus");
147  if (f) {
148  file << it->first << "\t" << f->GetParameter(1) << "\t" << f->GetParError(1) << "\t" << f->GetParameter(2)
149  << "\t" << f->GetParError(2) << std::endl;
150  }
151  }
152  file.close();
153  }
static std::string granularity(int32_t g)
Definition: MeasureLA.h:24
key
prepare the HTCondor submission files and eventually submit them
double f[11][100]
iterator begin(string_t re=".*")
Definition: Book.h:57
static std::string method(Method m, bool fit=true)
boost::filter_iterator< match_name, book_t::const_iterator > const_iterator
Definition: Book.h:56
iterator end(string_t re=".*")
Definition: Book.h:65

Member Data Documentation

◆ book

Book sistrip::MeasureLA::book
private

◆ byLayer

bool sistrip::MeasureLA::byLayer
private

Definition at line 60 of file MeasureLA.h.

Referenced by MeasureLA(), and store_methods_and_granularity().

◆ byModule

bool sistrip::MeasureLA::byModule
private

Definition at line 60 of file MeasureLA.h.

Referenced by MeasureLA(), and store_methods_and_granularity().

◆ calibrations

const edm::VParameterSet sistrip::MeasureLA::calibrations
private

Definition at line 57 of file MeasureLA.h.

Referenced by store_calibrations().

◆ error_scaling

std::map<std::pair<uint32_t, LA_Filler_Fitter::Method>, float> sistrip::MeasureLA::error_scaling
private

Definition at line 58 of file MeasureLA.h.

Referenced by calibrate(), and store_calibrations().

◆ fp_

const edm::FileInPath sistrip::MeasureLA::fp_
private

Definition at line 56 of file MeasureLA.h.

◆ inFileLocation

const std::string sistrip::MeasureLA::inFileLocation
private

Definition at line 55 of file MeasureLA.h.

Referenced by MeasureLA().

◆ inputFiles

const std::vector<std::string> sistrip::MeasureLA::inputFiles
private

◆ localybin

const float sistrip::MeasureLA::localybin
private

Definition at line 61 of file MeasureLA.h.

Referenced by MeasureLA().

◆ maxEvents

const unsigned sistrip::MeasureLA::maxEvents
private

Definition at line 62 of file MeasureLA.h.

Referenced by MeasureLA().

◆ measurementPreferences

const edm::VParameterSet sistrip::MeasureLA::measurementPreferences
private

Definition at line 57 of file MeasureLA.h.

Referenced by MeasureLA().

◆ methods

int32_t sistrip::MeasureLA::methods
private

Definition at line 59 of file MeasureLA.h.

Referenced by MeasureLA(), and store_methods_and_granularity().

◆ offset

std::map<std::pair<uint32_t, LA_Filler_Fitter::Method>, float> sistrip::MeasureLA::offset
private

◆ reports

const edm::VParameterSet sistrip::MeasureLA::reports
private

Definition at line 57 of file MeasureLA.h.

Referenced by MeasureLA(), and process_reports().

◆ slope

std::map<std::pair<uint32_t, LA_Filler_Fitter::Method>, float> sistrip::MeasureLA::slope
private

Definition at line 58 of file MeasureLA.h.

Referenced by calibrate(), and store_calibrations().

◆ stripsperbin

const unsigned sistrip::MeasureLA::stripsperbin
private

Definition at line 62 of file MeasureLA.h.

Referenced by MeasureLA().

◆ tTopo_

TrackerTopology sistrip::MeasureLA::tTopo_
private

Definition at line 65 of file MeasureLA.h.

Referenced by calibration_key(), and MeasureLA().