CMS 3D CMS Logo

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

#include <ESTrivialConditionRetriever.h>

Inheritance diagram for ESTrivialConditionRetriever:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 ESTrivialConditionRetriever (const edm::ParameterSet &pset)
 
 ESTrivialConditionRetriever (const ESTrivialConditionRetriever &)=delete
 
virtual std::unique_ptr< ESChannelStatusgetChannelStatusFromConfiguration (const ESChannelStatusRcd &)
 
const ESTrivialConditionRetrieveroperator= (const ESTrivialConditionRetriever &)=delete
 
virtual std::unique_ptr< ESADCToGeVConstantproduceESADCToGeVConstant (const ESADCToGeVConstantRcd &)
 
virtual std::unique_ptr< ESChannelStatusproduceESChannelStatus (const ESChannelStatusRcd &)
 
virtual std::unique_ptr< ESIntercalibConstantsproduceESIntercalibConstants (const ESIntercalibConstantsRcd &)
 
virtual std::unique_ptr< ESPedestalsproduceESPedestals (const ESPedestalsRcd &)
 
virtual std::unique_ptr< ESTBWeightsproduceESTBWeights (const ESTBWeightsRcd &)
 
virtual std::unique_ptr< ESWeightStripGroupsproduceESWeightStripGroups (const ESWeightStripGroupsRcd &)
 
 ~ESTrivialConditionRetriever () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Protected Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 
- Protected Member Functions inherited from edm::ESProducer
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 TArg >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &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::ESProxyFactoryProducer
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::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Member Functions

void getWeightsFromConfiguration (const edm::ParameterSet &ps)
 

Private Attributes

double adcToGeVHighConstant_
 
double adcToGeVLowConstant_
 
ESWeightSet amplWeights_
 
std::string amplWeightsFile_
 
std::string channelStatusFile_
 
double ESpedMean_
 
double ESpedRMS_
 
bool getWeightsFromFile_
 
double intercalibConstantMean_
 
std::string intercalibConstantsFile_
 
double intercalibConstantSigma_
 
bool producedESADCToGeVConstant_
 
bool producedESChannelStatus_
 
bool producedESIntercalibConstants_
 
bool producedESPedestals_
 
bool producedESWeights_
 
int verbose_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 

Detailed Description

Definition at line 40 of file ESTrivialConditionRetriever.h.

Constructor & Destructor Documentation

◆ ESTrivialConditionRetriever() [1/2]

ESTrivialConditionRetriever::ESTrivialConditionRetriever ( const edm::ParameterSet pset)

Definition at line 17 of file ESTrivialConditionRetriever.cc.

References getChannelStatusFromConfiguration(), edm::ParameterSet::getUntrackedParameter(), castor_dqm_sourceclient_file_cfg::path, produceESADCToGeVConstant(), produceESChannelStatus(), produceESIntercalibConstants(), produceESPedestals(), produceESTBWeights(), produceESWeightStripGroups(), str, and AlCaHLTBitMon_QueryRunRegistry::string.

17  {
18  // initilize parameters used to produce cond DB objects
19  adcToGeVLowConstant_ = ps.getUntrackedParameter<double>("adcToGeVLowConstant", 1.0);
20  adcToGeVHighConstant_ = ps.getUntrackedParameter<double>("adcToGeVHighConstant", 1.0);
21 
22  intercalibConstantMean_ = ps.getUntrackedParameter<double>("intercalibConstantMean", 1.0);
23  intercalibConstantSigma_ = ps.getUntrackedParameter<double>("intercalibConstantSigma", 0.0);
24 
25  // intercalibErrorMean_ = ps.getUntrackedParameter<double>("IntercalibErrorMean",0.0);
26 
27  ESpedMean_ = ps.getUntrackedParameter<double>("ESpedMean", 200.);
28  ESpedRMS_ = ps.getUntrackedParameter<double>("ESpedRMS", 1.00);
29 
30  getWeightsFromFile_ = ps.getUntrackedParameter<bool>("getWeightsFromFile", false);
31 
32  std::string path = "CalibCalorimetry/EcalTrivialCondModules/data/";
33  std::string weightType;
34  std::ostringstream str;
35 
36  weightType = str.str();
37 
38  amplWeightsFile_ = ps.getUntrackedParameter<std::string>("amplWeightsFile", path + "ampWeightsES" + weightType);
39 
40  // default weights for MGPA shape after pedestal subtraction
42 
43  producedESPedestals_ = ps.getUntrackedParameter<bool>("producedESPedestals", true);
44  producedESWeights_ = ps.getUntrackedParameter<bool>("producedESWeights", true);
45 
46  producedESADCToGeVConstant_ = ps.getUntrackedParameter<bool>("producedESADCToGeVConstant", true);
47 
48  verbose_ = ps.getUntrackedParameter<int>("verbose", 0);
49 
50  //Tell Producer what we produce
51  //setWhatproduce(this);
54 
55  if (producedESWeights_) {
58  }
59 
62 
63  // intercalibration constants
64  producedESIntercalibConstants_ = ps.getUntrackedParameter<bool>("producedESIntercalibConstants", true);
65  intercalibConstantsFile_ = ps.getUntrackedParameter<std::string>("intercalibConstantsFile", "");
66 
67  if (producedESIntercalibConstants_) { // user asks to produce constants
68  if (intercalibConstantsFile_.empty()) { // if file provided read constants
69  // setWhatProduced (this, &ESTrivialConditionRetriever::getIntercalibConstantsFromConfiguration ) ;
70  // } else { // set all constants to 1. or smear as specified by user
72  }
73  findingRecord<ESIntercalibConstantsRcd>();
74  }
75 
76  // intercalibration constants errors
77  /* producedESIntercalibErrors_ = ps.getUntrackedParameter<bool>("producedESIntercalibErrors",true);
78  intercalibErrorsFile_ = ps.getUntrackedParameter<std::string>("intercalibErrorsFile","") ;
79 
80  if (producedESIntercalibErrors_) { // user asks to produce constants
81  if(intercalibErrorsFile_ != "") { // if file provided read constants
82  setWhatProduced (this, &ESTrivialConditionRetriever::getIntercalibErrorsFromConfiguration ) ;
83  } else { // set all constants to 1. or smear as specified by user
84  setWhatProduced (this, &ESTrivialConditionRetriever::produceESIntercalibErrors ) ;
85  }
86  findingRecord<ESIntercalibErrorsRcd> () ;
87  }
88  */
89 
90  // channel status
91  producedESChannelStatus_ = ps.getUntrackedParameter<bool>("producedESChannelStatus", true);
92  channelStatusFile_ = ps.getUntrackedParameter<std::string>("channelStatusFile", "");
93 
95  if (!channelStatusFile_.empty()) { // if file provided read channel map
97  } else { // set all channels to working -- FIXME might be changed
99  }
100  findingRecord<ESChannelStatusRcd>();
101  }
102 
103  //Tell Finder what records we find
105  findingRecord<ESPedestalsRcd>();
106 
107  if (producedESWeights_) {
108  findingRecord<ESWeightStripGroupsRcd>();
109  findingRecord<ESTBWeightsRcd>();
110  }
111 
113  findingRecord<ESADCToGeVConstantRcd>();
114 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
virtual std::unique_ptr< ESIntercalibConstants > produceESIntercalibConstants(const ESIntercalibConstantsRcd &)
virtual std::unique_ptr< ESChannelStatus > produceESChannelStatus(const ESChannelStatusRcd &)
virtual std::unique_ptr< ESChannelStatus > getChannelStatusFromConfiguration(const ESChannelStatusRcd &)
virtual std::unique_ptr< ESTBWeights > produceESTBWeights(const ESTBWeightsRcd &)
virtual std::unique_ptr< ESPedestals > produceESPedestals(const ESPedestalsRcd &)
void getWeightsFromConfiguration(const edm::ParameterSet &ps)
virtual std::unique_ptr< ESWeightStripGroups > produceESWeightStripGroups(const ESWeightStripGroupsRcd &)
virtual std::unique_ptr< ESADCToGeVConstant > produceESADCToGeVConstant(const ESADCToGeVConstantRcd &)
#define str(s)

◆ ESTrivialConditionRetriever() [2/2]

ESTrivialConditionRetriever::ESTrivialConditionRetriever ( const ESTrivialConditionRetriever )
delete

◆ ~ESTrivialConditionRetriever()

ESTrivialConditionRetriever::~ESTrivialConditionRetriever ( )
override

Definition at line 116 of file ESTrivialConditionRetriever.cc.

116 {}

Member Function Documentation

◆ getChannelStatusFromConfiguration()

std::unique_ptr< ESChannelStatus > ESTrivialConditionRetriever::getChannelStatusFromConfiguration ( const ESChannelStatusRcd )
virtual

Definition at line 271 of file ESTrivialConditionRetriever.cc.

References MillePedeFileConverter_cfg::e, Exception, contentValuesFiles::fullPath, edm::FileInPath::fullPath(), ESDetId::ISTRIP_MAX, ESDetId::ISTRIP_MIN, ESDetId::IX_MAX, ESDetId::IX_MIN, ESDetId::IY_MAX, ESDetId::IY_MIN, mps_update::status, str, AlCaHLTBitMon_QueryRunRegistry::string, and ESDetId::unhashIndex().

Referenced by ESTrivialConditionRetriever().

272  {
273  auto ecalStatus = std::make_unique<ESChannelStatus>();
274 
275  // start by setting all statuses to 0
276 
277  for (int istrip = ESDetId::ISTRIP_MIN; istrip <= ESDetId::ISTRIP_MAX; istrip++) {
278  for (int ix = ESDetId::IX_MIN; ix <= ESDetId::IX_MAX; ix++) {
279  for (int iy = ESDetId::IY_MIN; iy <= ESDetId::IY_MAX; iy++) {
280  for (int iplane = 1; iplane <= 2; iplane++) {
281  for (int izeta = -1; izeta <= 1; ++izeta) {
282  if (izeta == 0)
283  continue;
284  try {
285  //ESDetId Plane iplane Zside izeta
286  ESDetId anESId(istrip, ix, iy, iplane, izeta);
287  // xtalGroups->setValue(ebid.rawId(), ESStripGroupId(ieta) ); // define rings in eta
288  ecalStatus->setValue(anESId, 0);
289  } catch (cms::Exception& e) {
290  }
291  }
292  }
293  }
294  }
295  }
296 
297  // overwrite the statuses which are in the file
298 
299  edm::LogInfo("ESTrivialConditionRetriever")
300  << "Reading channel statuses from file " << edm::FileInPath(channelStatusFile_).fullPath().c_str();
301  std::ifstream statusFile(edm::FileInPath(channelStatusFile_).fullPath().c_str());
302  if (!statusFile.good()) {
303  edm::LogError("ESTrivialConditionRetriever") << "*** Problems opening file: " << channelStatusFile_;
304  throw cms::Exception("Cannot open ECAL channel status file");
305  }
306 
307  std::string ESSubDet;
309  int hashIndex(0);
310  int status(0);
311 
312  while (!statusFile.eof()) {
313  statusFile >> ESSubDet;
314  if (ESSubDet != std::string("ES")) {
315  std::getline(statusFile, str);
316  continue;
317  } else {
318  statusFile >> hashIndex >> status;
319  }
320  // std::cout << ESSubDet << " " << hashIndex << " " << status;
321 
322  if (ESSubDet == std::string("ES")) {
323  ESDetId esid = ESDetId::unhashIndex(hashIndex);
324  ecalStatus->setValue(esid, status);
325  } else {
326  edm::LogError("ESTrivialConditionRetriever") << " *** " << ESSubDet << " is not ES ";
327  }
328  }
329  // the file is supposed to be in the form
330  // ES hashed_index status
331  // ES 132332 1 --> higher than 0 means bad
332 
333  statusFile.close();
334  return ecalStatus;
335 }
std::string fullPath() const
Definition: FileInPath.cc:161
static const int IY_MAX
Definition: ESDetId.h:67
static const int ISTRIP_MAX
Definition: ESDetId.h:69
Log< level::Error, false > LogError
Log< level::Info, false > LogInfo
static const int IY_MIN
Definition: ESDetId.h:65
static const int IX_MAX
Definition: ESDetId.h:66
static ESDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: ESDetId.cc:32
#define str(s)
static const int ISTRIP_MIN
Definition: ESDetId.h:68
static const int IX_MIN
Definition: ESDetId.h:64

◆ getWeightsFromConfiguration()

void ESTrivialConditionRetriever::getWeightsFromConfiguration ( const edm::ParameterSet ps)
private

Definition at line 238 of file ESTrivialConditionRetriever.cc.

References Exception, contentValuesFiles::fullPath, edm::FileInPath::fullPath(), dqmiolumiharvest::j, and dqmdumpme::k.

238  {
240 
241  if (!getWeightsFromFile_) {
242  // vampl.set(1.);
243 
244  // amplwgtv[0]= ps.getUntrackedParameter< std::vector<double> >("amplWeights", vampl);
245  } else if (getWeightsFromFile_) {
246  edm::LogInfo("ESTrivialConditionRetriever")
247  << "Reading amplitude weights from file " << edm::FileInPath(amplWeightsFile_).fullPath().c_str();
248  std::ifstream amplFile(edm::FileInPath(amplWeightsFile_).fullPath().c_str());
249  while (!amplFile.eof()) {
250  for (int j = 0; j < 2; ++j) {
251  std::vector<float> vec(3);
252  for (int k = 0; k < 3; ++k) {
253  float ww;
254  amplFile >> ww;
255  vec[k] = ww;
256  }
257  // vampl.putRow(vec);
258  }
259  }
260  } else {
261  //Not supported
262  edm::LogError("ESTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
263  throw cms::Exception("WrongConfig");
264  }
265 
266  amplWeights_ = ESWeightSet(vampl);
267 }
std::string fullPath() const
Definition: FileInPath.cc:161
Log< level::Error, false > LogError
math::Matrix< 2, 3 >::type ESWeightMatrix
Definition: ESWeightSet.h:12
Log< level::Info, false > LogInfo

◆ operator=()

const ESTrivialConditionRetriever& ESTrivialConditionRetriever::operator= ( const ESTrivialConditionRetriever )
delete

◆ produceESADCToGeVConstant()

std::unique_ptr< ESADCToGeVConstant > ESTrivialConditionRetriever::produceESADCToGeVConstant ( const ESADCToGeVConstantRcd )
virtual

Definition at line 220 of file ESTrivialConditionRetriever.cc.

Referenced by ESTrivialConditionRetriever().

221  {
222  return std::make_unique<ESADCToGeVConstant>(adcToGeVLowConstant_, adcToGeVHighConstant_);
223 }

◆ produceESChannelStatus()

std::unique_ptr< ESChannelStatus > ESTrivialConditionRetriever::produceESChannelStatus ( const ESChannelStatusRcd )
virtual

Definition at line 337 of file ESTrivialConditionRetriever.cc.

References MillePedeFileConverter_cfg::e, ESDetId::ISTRIP_MAX, ESDetId::ISTRIP_MIN, ESDetId::IX_MAX, ESDetId::IX_MIN, ESDetId::IY_MAX, and ESDetId::IY_MIN.

Referenced by ESTrivialConditionRetriever().

337  {
338  auto ical = std::make_unique<ESChannelStatus>();
339  for (int istrip = ESDetId::ISTRIP_MIN; istrip <= ESDetId::ISTRIP_MAX; istrip++) {
340  for (int ix = ESDetId::IX_MIN; ix <= ESDetId::IX_MAX; ix++) {
341  for (int iy = ESDetId::IY_MIN; iy <= ESDetId::IY_MAX; iy++) {
342  for (int iplane = 1; iplane <= 2; iplane++) {
343  for (int izeta = -1; izeta <= 1; ++izeta) {
344  if (izeta == 0)
345  continue;
346  try {
347  //ESDetId Plane iplane Zside izeta
348  ESDetId anESId(istrip, ix, iy, iplane, izeta);
349  // xtalGroups->setValue(ebid.rawId(), ESStripGroupId(ieta) ); // define rings in eta
350  ical->setValue(anESId, 0);
351  } catch (cms::Exception& e) {
352  }
353  }
354  }
355  }
356  }
357  }
358 
359  return ical;
360 }
static const int IY_MAX
Definition: ESDetId.h:67
static const int ISTRIP_MAX
Definition: ESDetId.h:69
static const int IY_MIN
Definition: ESDetId.h:65
static const int IX_MAX
Definition: ESDetId.h:66
static const int ISTRIP_MIN
Definition: ESDetId.h:68
static const int IX_MIN
Definition: ESDetId.h:64

◆ produceESIntercalibConstants()

std::unique_ptr< ESIntercalibConstants > ESTrivialConditionRetriever::produceESIntercalibConstants ( const ESIntercalibConstantsRcd )
virtual

Definition at line 191 of file ESTrivialConditionRetriever.cc.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, ESDetId::ISTRIP_MAX, ESDetId::ISTRIP_MIN, ESDetId::IX_MAX, ESDetId::IX_MIN, ESDetId::IY_MAX, ESDetId::IY_MIN, alignCSCRings::r, and DetId::rawId().

Referenced by ESTrivialConditionRetriever().

192  {
193  auto ical = std::make_unique<ESIntercalibConstants>();
194  std::cout << "entring produce intercalib " << std::endl;
195 
196  for (int istrip = ESDetId::ISTRIP_MIN; istrip <= ESDetId::ISTRIP_MAX; istrip++) {
197  for (int ix = ESDetId::IX_MIN; ix <= ESDetId::IX_MAX; ix++) {
198  for (int iy = ESDetId::IY_MIN; iy <= ESDetId::IY_MAX; iy++) {
199  for (int iplane = 1; iplane <= 2; iplane++) {
200  for (int izeta = -1; izeta <= 1; ++izeta) {
201  if (izeta == 0)
202  continue;
203  try {
204  //ESDetId Plane iplane Zside izeta
205  ESDetId anESId(istrip, ix, iy, iplane, izeta);
206  double r = (double)std::rand() / (double(RAND_MAX) + double(1));
207  ical->setValue(anESId.rawId(), intercalibConstantMean_ + r * intercalibConstantSigma_);
208  } catch (cms::Exception& e) {
209  }
210  }
211  }
212  }
213  }
214  }
215  std::cout << "done produce intercalib" << std::endl;
216 
217  return ical;
218 }
static const int IY_MAX
Definition: ESDetId.h:67
static const int ISTRIP_MAX
Definition: ESDetId.h:69
static const int IY_MIN
Definition: ESDetId.h:65
static const int IX_MAX
Definition: ESDetId.h:66
static const int ISTRIP_MIN
Definition: ESDetId.h:68
static const int IX_MIN
Definition: ESDetId.h:64

◆ produceESPedestals()

std::unique_ptr< ESPedestals > ESTrivialConditionRetriever::produceESPedestals ( const ESPedestalsRcd )
virtual

Definition at line 132 of file ESTrivialConditionRetriever.cc.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, ESDetId::ISTRIP_MAX, ESDetId::ISTRIP_MIN, ESDetId::IX_MAX, ESDetId::IX_MIN, ESDetId::IY_MAX, ESDetId::IY_MIN, ESPedestal::mean, and DetId::rawId().

Referenced by ESTrivialConditionRetriever().

132  {
133  std::cout << " producing pedestals" << std::endl;
134  auto peds = std::make_unique<ESPedestals>();
135  ESPedestals::Item ESitem;
136  ESitem.mean = ESpedMean_;
137  ESitem.rms = ESpedRMS_;
138 
139  for (int istrip = ESDetId::ISTRIP_MIN; istrip <= ESDetId::ISTRIP_MAX; istrip++) {
140  for (int ix = ESDetId::IX_MIN; ix <= ESDetId::IX_MAX; ix++) {
141  for (int iy = ESDetId::IY_MIN; iy <= ESDetId::IY_MAX; iy++) {
142  for (int iplane = 1; iplane <= 2; iplane++) {
143  for (int izeta = -1; izeta <= 1; ++izeta) {
144  if (izeta == 0)
145  continue;
146  try {
147  //ESDetId Plane iplane Zside izeta
148  ESDetId aPositiveId(istrip, ix, iy, iplane, izeta);
149  peds->insert(std::make_pair(aPositiveId.rawId(), ESitem));
150  } catch (cms::Exception& e) {
151  }
152  }
153  }
154  }
155  }
156  }
157  //return std::unique_ptr<ESPedestals>( peds );
158  std::cout << " produced pedestals" << std::endl;
159  return peds;
160 }
static const int IY_MAX
Definition: ESDetId.h:67
static const int ISTRIP_MAX
Definition: ESDetId.h:69
float mean
Definition: ESPedestals.h:16
static const int IY_MIN
Definition: ESDetId.h:65
static const int IX_MAX
Definition: ESDetId.h:66
static const int ISTRIP_MIN
Definition: ESDetId.h:68
static const int IX_MIN
Definition: ESDetId.h:64

◆ produceESTBWeights()

std::unique_ptr< ESTBWeights > ESTrivialConditionRetriever::produceESTBWeights ( const ESTBWeightsRcd )
virtual

Definition at line 225 of file ESTrivialConditionRetriever.cc.

Referenced by ESTrivialConditionRetriever().

225  {
226  // create weights for the test-beam
227  auto tbwgt = std::make_unique<ESTBWeights>();
228 
229  int igrp = 1;
231  // ESWeightSet::ESWeightMatrix& mat1 = wgt.getWeights();
232 
233  tbwgt->setValue(igrp, wgt);
234 
235  return tbwgt;
236 }

◆ produceESWeightStripGroups()

std::unique_ptr< ESWeightStripGroups > ESTrivialConditionRetriever::produceESWeightStripGroups ( const ESWeightStripGroupsRcd )
virtual

Definition at line 162 of file ESTrivialConditionRetriever.cc.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, ESDetId::ISTRIP_MAX, ESDetId::ISTRIP_MIN, ESDetId::IX_MAX, ESDetId::IX_MIN, ESDetId::IY_MAX, ESDetId::IY_MIN, and DetId::rawId().

Referenced by ESTrivialConditionRetriever().

163  {
164  auto xtalGroups = std::make_unique<ESWeightStripGroups>();
165  ESStripGroupId defaultGroupId(1);
166  std::cout << "entering produce weight groups" << std::endl;
167  for (int istrip = ESDetId::ISTRIP_MIN; istrip <= ESDetId::ISTRIP_MAX; istrip++) {
168  for (int ix = ESDetId::IX_MIN; ix <= ESDetId::IX_MAX; ix++) {
169  for (int iy = ESDetId::IY_MIN; iy <= ESDetId::IY_MAX; iy++) {
170  for (int iplane = 1; iplane <= 2; iplane++) {
171  for (int izeta = -1; izeta <= 1; ++izeta) {
172  if (izeta == 0)
173  continue;
174  try {
175  //ESDetId Plane iplane Zside izeta
176  ESDetId anESId(istrip, ix, iy, iplane, izeta);
177  // xtalGroups->setValue(ebid.rawId(), ESStripGroupId(ieta) ); // define rings in eta
178  xtalGroups->setValue(anESId.rawId(), defaultGroupId); // define rings in eta
179  } catch (cms::Exception& e) {
180  }
181  }
182  }
183  }
184  }
185  }
186  std::cout << "done with produce weight groups" << std::endl;
187 
188  return xtalGroups;
189 }
static const int IY_MAX
Definition: ESDetId.h:67
static const int ISTRIP_MAX
Definition: ESDetId.h:69
static const int IY_MIN
Definition: ESDetId.h:65
static const int IX_MAX
Definition: ESDetId.h:66
static const int ISTRIP_MIN
Definition: ESDetId.h:68
static const int IX_MIN
Definition: ESDetId.h:64

◆ setIntervalFor()

void ESTrivialConditionRetriever::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey rk,
const edm::IOVSyncValue iTime,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 121 of file ESTrivialConditionRetriever.cc.

References edm::IOVSyncValue::beginOfTime(), gather_cfg::cout, edm::IOVSyncValue::endOfTime(), edm::eventsetup::EventSetupRecordKey::name(), edm::IOVSyncValue::time(), and edm::Timestamp::value().

123  {
124  if (verbose_ >= 1)
125  std::cout << "ESTrivialConditionRetriever::setIntervalFor(): record key = " << rk.name()
126  << "\ttime: " << iTime.time().value() << std::endl;
127  //For right now, we will just use an infinite interval of validity
129 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
TimeValue_t value() const
Definition: Timestamp.h:38
const Timestamp & time() const
Definition: IOVSyncValue.h:42

Member Data Documentation

◆ adcToGeVHighConstant_

double ESTrivialConditionRetriever::adcToGeVHighConstant_
private

Definition at line 73 of file ESTrivialConditionRetriever.h.

◆ adcToGeVLowConstant_

double ESTrivialConditionRetriever::adcToGeVLowConstant_
private

Definition at line 72 of file ESTrivialConditionRetriever.h.

◆ amplWeights_

ESWeightSet ESTrivialConditionRetriever::amplWeights_
private

Definition at line 84 of file ESTrivialConditionRetriever.h.

◆ amplWeightsFile_

std::string ESTrivialConditionRetriever::amplWeightsFile_
private

Definition at line 86 of file ESTrivialConditionRetriever.h.

◆ channelStatusFile_

std::string ESTrivialConditionRetriever::channelStatusFile_
private

Definition at line 88 of file ESTrivialConditionRetriever.h.

◆ ESpedMean_

double ESTrivialConditionRetriever::ESpedMean_
private

Definition at line 81 of file ESTrivialConditionRetriever.h.

◆ ESpedRMS_

double ESTrivialConditionRetriever::ESpedRMS_
private

Definition at line 82 of file ESTrivialConditionRetriever.h.

◆ getWeightsFromFile_

bool ESTrivialConditionRetriever::getWeightsFromFile_
private

Definition at line 90 of file ESTrivialConditionRetriever.h.

◆ intercalibConstantMean_

double ESTrivialConditionRetriever::intercalibConstantMean_
private

Definition at line 75 of file ESTrivialConditionRetriever.h.

◆ intercalibConstantsFile_

std::string ESTrivialConditionRetriever::intercalibConstantsFile_
private

Definition at line 87 of file ESTrivialConditionRetriever.h.

◆ intercalibConstantSigma_

double ESTrivialConditionRetriever::intercalibConstantSigma_
private

Definition at line 76 of file ESTrivialConditionRetriever.h.

◆ producedESADCToGeVConstant_

bool ESTrivialConditionRetriever::producedESADCToGeVConstant_
private

Definition at line 94 of file ESTrivialConditionRetriever.h.

◆ producedESChannelStatus_

bool ESTrivialConditionRetriever::producedESChannelStatus_
private

Definition at line 95 of file ESTrivialConditionRetriever.h.

◆ producedESIntercalibConstants_

bool ESTrivialConditionRetriever::producedESIntercalibConstants_
private

Definition at line 93 of file ESTrivialConditionRetriever.h.

◆ producedESPedestals_

bool ESTrivialConditionRetriever::producedESPedestals_
private

Definition at line 91 of file ESTrivialConditionRetriever.h.

◆ producedESWeights_

bool ESTrivialConditionRetriever::producedESWeights_
private

Definition at line 92 of file ESTrivialConditionRetriever.h.

◆ verbose_

int ESTrivialConditionRetriever::verbose_
private

Definition at line 97 of file ESTrivialConditionRetriever.h.