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)
 
virtual std::unique_ptr< ESChannelStatusgetChannelStatusFromConfiguration (const ESChannelStatusRcd &)
 
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 ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
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
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
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 >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Member Functions

 ESTrivialConditionRetriever (const ESTrivialConditionRetriever &)=delete
 
void getWeightsFromConfiguration (const edm::ParameterSet &ps)
 
const ESTrivialConditionRetrieveroperator= (const ESTrivialConditionRetriever &)=delete
 

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

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 40 of file ESTrivialConditionRetriever.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file ESTrivialConditionRetriever.cc.

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

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

Definition at line 120 of file ESTrivialConditionRetriever.cc.

121 {
122 }
ESTrivialConditionRetriever::ESTrivialConditionRetriever ( const ESTrivialConditionRetriever )
privatedelete

Member Function Documentation

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

Definition at line 301 of file ESTrivialConditionRetriever.cc.

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

Referenced by ESTrivialConditionRetriever().

302 {
303  auto ecalStatus = std::make_unique<ESChannelStatus>();
304 
305 
306  // start by setting all statuses to 0
307 
308 
309  for (int istrip=ESDetId::ISTRIP_MIN;istrip<=ESDetId::ISTRIP_MAX;istrip++) {
310  for (int ix=ESDetId::IX_MIN;ix<=ESDetId::IX_MAX;ix++){
311  for (int iy=ESDetId::IY_MIN;iy<=ESDetId::IY_MAX;iy++){
312  for ( int iplane=1; iplane<=2; iplane++){
313  for(int izeta=-1; izeta<=1 ;++izeta) {
314  if(izeta==0) continue;
315  try {
316  //ESDetId Plane iplane Zside izeta
317  ESDetId anESId(istrip,ix,iy,iplane,izeta);
318  // xtalGroups->setValue(ebid.rawId(), ESStripGroupId(ieta) ); // define rings in eta
319  ecalStatus->setValue( anESId, 0 );
320  }
321  catch ( cms::Exception &e )
322  {
323  }
324  }
325  }
326  }
327  }
328  }
329 
330  // overwrite the statuses which are in the file
331 
332  edm::LogInfo("ESTrivialConditionRetriever") << "Reading channel statuses from file " << edm::FileInPath(channelStatusFile_).fullPath().c_str() ;
333  std::ifstream statusFile(edm::FileInPath(channelStatusFile_).fullPath().c_str());
334  if ( !statusFile.good() ) {
335  edm::LogError ("ESTrivialConditionRetriever")
336  << "*** Problems opening file: " << channelStatusFile_ ;
337  throw cms::Exception ("Cannot open ECAL channel status file") ;
338  }
339 
340  std::string ESSubDet;
342  int hashIndex(0);
343  int status(0);
344 
345  while (!statusFile.eof())
346  {
347  statusFile >> ESSubDet;
348  if (ESSubDet!=std::string("ES") )
349  {
350  std::getline(statusFile,str);
351  continue;
352  }
353  else
354  {
355  statusFile>> hashIndex >> status;
356  }
357  // std::cout << ESSubDet << " " << hashIndex << " " << status;
358 
359  if(ESSubDet==std::string("ES"))
360  {
361  ESDetId esid = ESDetId::unhashIndex(hashIndex);
362  ecalStatus->setValue( esid, status );
363  }
364  else
365  {
366  edm::LogError ("ESTrivialConditionRetriever")
367  << " *** " << ESSubDet << " is not ES ";
368  }
369  }
370  // the file is supposed to be in the form
371  // ES hashed_index status
372  // ES 132332 1 --> higher than 0 means bad
373 
374  statusFile.close();
375  return ecalStatus;
376 }
static const int IY_MAX
Definition: ESDetId.h:74
static const int ISTRIP_MAX
Definition: ESDetId.h:76
static const int IY_MIN
Definition: ESDetId.h:72
static const int IX_MAX
Definition: ESDetId.h:73
std::string fullPath() const
Definition: FileInPath.cc:197
static ESDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: ESDetId.cc:62
static const int ISTRIP_MIN
Definition: ESDetId.h:75
static const int IX_MIN
Definition: ESDetId.h:71
void ESTrivialConditionRetriever::getWeightsFromConfiguration ( const edm::ParameterSet ps)
private

Definition at line 257 of file ESTrivialConditionRetriever.cc.

References Exception, edm::FileInPath::fullPath(), and gen::k.

258 {
259 
261 
262  if (!getWeightsFromFile_ )
263  {
264 
265  // vampl.set(1.);
266 
267  // amplwgtv[0]= ps.getUntrackedParameter< std::vector<double> >("amplWeights", vampl);
268  }
269  else if (getWeightsFromFile_)
270  {
271  edm::LogInfo("ESTrivialConditionRetriever") << "Reading amplitude weights from file " << edm::FileInPath(amplWeightsFile_).fullPath().c_str() ;
272  std::ifstream amplFile(edm::FileInPath(amplWeightsFile_).fullPath().c_str());
273  while (!amplFile.eof() )
274  {
275  for(int j = 0; j < 2; ++j) {
276  std::vector<float> vec(3) ;
277  for(int k = 0; k < 3; ++k) {
278  float ww;
279  amplFile >> ww;
280  vec[k]=ww;
281  }
282  // vampl.putRow(vec);
283  }
284  }
285  }
286  else
287  {
288  //Not supported
289  edm::LogError("ESTrivialConditionRetriever") << "Configuration not supported. Exception is raised ";
290  throw cms::Exception("WrongConfig");
291  }
292 
293 
294  amplWeights_=ESWeightSet(vampl);
295 
296 }
math::Matrix< 2, 3 >::type ESWeightMatrix
Definition: ESWeightSet.h:14
int k[5][pyjets_maxn]
std::string fullPath() const
Definition: FileInPath.cc:197
const ESTrivialConditionRetriever& ESTrivialConditionRetriever::operator= ( const ESTrivialConditionRetriever )
privatedelete
std::unique_ptr< ESADCToGeVConstant > ESTrivialConditionRetriever::produceESADCToGeVConstant ( const ESADCToGeVConstantRcd )
virtual

Definition at line 234 of file ESTrivialConditionRetriever.cc.

Referenced by ESTrivialConditionRetriever().

235 {
236  return std::make_unique<ESADCToGeVConstant>(adcToGeVLowConstant_,adcToGeVHighConstant_);
237 }
std::unique_ptr< ESChannelStatus > ESTrivialConditionRetriever::produceESChannelStatus ( const ESChannelStatusRcd )
virtual

Definition at line 381 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().

382 {
383 
384  auto ical = std::make_unique<ESChannelStatus>();
385  for (int istrip=ESDetId::ISTRIP_MIN;istrip<=ESDetId::ISTRIP_MAX;istrip++) {
386  for (int ix=ESDetId::IX_MIN;ix<=ESDetId::IX_MAX;ix++){
387  for (int iy=ESDetId::IY_MIN;iy<=ESDetId::IY_MAX;iy++){
388  for ( int iplane=1; iplane<=2; iplane++){
389  for(int izeta=-1; izeta<=1 ;++izeta) {
390  if(izeta==0) continue;
391  try {
392  //ESDetId Plane iplane Zside izeta
393  ESDetId anESId(istrip,ix,iy,iplane,izeta);
394  // xtalGroups->setValue(ebid.rawId(), ESStripGroupId(ieta) ); // define rings in eta
395  ical->setValue( anESId, 0 );
396  }
397  catch ( cms::Exception &e )
398  {
399  }
400  }
401  }
402  }
403  }
404  }
405 
406  return ical;
407 }
static const int IY_MAX
Definition: ESDetId.h:74
static const int ISTRIP_MAX
Definition: ESDetId.h:76
static const int IY_MIN
Definition: ESDetId.h:72
static const int IX_MAX
Definition: ESDetId.h:73
static const int ISTRIP_MIN
Definition: ESDetId.h:75
static const int IX_MIN
Definition: ESDetId.h:71
std::unique_ptr< ESIntercalibConstants > ESTrivialConditionRetriever::produceESIntercalibConstants ( const ESIntercalibConstantsRcd )
virtual

Definition at line 202 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, rand(), and DetId::rawId().

Referenced by ESTrivialConditionRetriever().

203 {
204  auto ical = std::make_unique<ESIntercalibConstants>();
205  std::cout << "entring produce intercalib "<< std::endl;
206 
207  for (int istrip=ESDetId::ISTRIP_MIN;istrip<=ESDetId::ISTRIP_MAX;istrip++) {
208  for (int ix=ESDetId::IX_MIN;ix<=ESDetId::IX_MAX;ix++){
209  for (int iy=ESDetId::IY_MIN;iy<=ESDetId::IY_MAX;iy++){
210  for ( int iplane=1; iplane<=2; iplane++){
211  for(int izeta=-1; izeta<=1 ;++izeta) {
212  if(izeta==0) continue;
213  try {
214  //ESDetId Plane iplane Zside izeta
215  ESDetId anESId(istrip,ix,iy,iplane,izeta);
216  double r = (double)std::rand()/( double(RAND_MAX)+double(1) );
217  ical->setValue( anESId.rawId(), intercalibConstantMean_ + r*intercalibConstantSigma_ );
218  }
219  catch ( cms::Exception &e )
220  {
221  }
222  }
223  }
224  }
225  }
226  }
227  std::cout << "done produce intercalib"<< std::endl;
228 
229  return ical;
230 }
static const int IY_MAX
Definition: ESDetId.h:74
static const int ISTRIP_MAX
Definition: ESDetId.h:76
static const int IY_MIN
Definition: ESDetId.h:72
static const int IX_MAX
Definition: ESDetId.h:73
Signal rand(Signal arg)
Definition: vlib.cc:442
static const int ISTRIP_MIN
Definition: ESDetId.h:75
static const int IX_MIN
Definition: ESDetId.h:71
std::unique_ptr< ESPedestals > ESTrivialConditionRetriever::produceESPedestals ( const ESPedestalsRcd )
virtual

Definition at line 139 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().

139  {
140  std::cout<< " producing pedestals"<< std::endl;
141  auto peds = std::make_unique<ESPedestals>();
142  ESPedestals::Item ESitem;
143  ESitem.mean = ESpedMean_;
144  ESitem.rms = ESpedRMS_;
145 
146  for (int istrip=ESDetId::ISTRIP_MIN;istrip<=ESDetId::ISTRIP_MAX;istrip++) {
147  for (int ix=ESDetId::IX_MIN;ix<=ESDetId::IX_MAX;ix++){
148  for (int iy=ESDetId::IY_MIN;iy<=ESDetId::IY_MAX;iy++){
149  for ( int iplane=1; iplane<=2; iplane++){
150  for(int izeta=-1; izeta<=1 ;++izeta) {
151  if(izeta==0) continue;
152  try {
153  //ESDetId Plane iplane Zside izeta
154  ESDetId aPositiveId(istrip,ix,iy,iplane,izeta);
155  peds->insert(std::make_pair(aPositiveId.rawId(),ESitem));
156  }
157  catch ( cms::Exception &e )
158  {
159  }
160  }
161  }
162  }
163  }
164  }
165  //return std::unique_ptr<ESPedestals>( peds );
166  std::cout<< " produced pedestals"<< std::endl;
167  return peds;
168 }
static const int IY_MAX
Definition: ESDetId.h:74
static const int ISTRIP_MAX
Definition: ESDetId.h:76
float mean
Definition: ESPedestals.h:14
static const int IY_MIN
Definition: ESDetId.h:72
static const int IX_MAX
Definition: ESDetId.h:73
static const int ISTRIP_MIN
Definition: ESDetId.h:75
static const int IX_MIN
Definition: ESDetId.h:71
std::unique_ptr< ESTBWeights > ESTrivialConditionRetriever::produceESTBWeights ( const ESTBWeightsRcd )
virtual

Definition at line 240 of file ESTrivialConditionRetriever.cc.

Referenced by ESTrivialConditionRetriever().

241 {
242  // create weights for the test-beam
243  auto tbwgt = std::make_unique<ESTBWeights>();
244 
245  int igrp=1;
247  // ESWeightSet::ESWeightMatrix& mat1 = wgt.getWeights();
248 
249  tbwgt->setValue(igrp,wgt);
250 
251 
252  return tbwgt;
253 }
std::unique_ptr< ESWeightStripGroups > ESTrivialConditionRetriever::produceESWeightStripGroups ( const ESWeightStripGroupsRcd )
virtual

Definition at line 171 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().

172 {
173  auto xtalGroups = std::make_unique<ESWeightStripGroups>();
174  ESStripGroupId defaultGroupId(1);
175  std::cout << "entering produce weight groups"<< std::endl;
176  for (int istrip=ESDetId::ISTRIP_MIN;istrip<=ESDetId::ISTRIP_MAX;istrip++) {
177  for (int ix=ESDetId::IX_MIN;ix<=ESDetId::IX_MAX;ix++){
178  for (int iy=ESDetId::IY_MIN;iy<=ESDetId::IY_MAX;iy++){
179  for ( int iplane=1; iplane<=2; iplane++){
180  for(int izeta=-1; izeta<=1 ;++izeta) {
181  if(izeta==0) continue;
182  try {
183  //ESDetId Plane iplane Zside izeta
184  ESDetId anESId(istrip,ix,iy,iplane,izeta);
185  // xtalGroups->setValue(ebid.rawId(), ESStripGroupId(ieta) ); // define rings in eta
186  xtalGroups->setValue(anESId.rawId(), defaultGroupId ); // define rings in eta
187  }
188  catch ( cms::Exception &e )
189  {
190  }
191  }
192  }
193  }
194  }
195  }
196  std::cout << "done with produce weight groups"<< std::endl;
197 
198  return xtalGroups;
199 }
static const int IY_MAX
Definition: ESDetId.h:74
static const int ISTRIP_MAX
Definition: ESDetId.h:76
static const int IY_MIN
Definition: ESDetId.h:72
static const int IX_MAX
Definition: ESDetId.h:73
static const int ISTRIP_MIN
Definition: ESDetId.h:75
static const int IX_MIN
Definition: ESDetId.h:71
void ESTrivialConditionRetriever::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey rk,
const edm::IOVSyncValue iTime,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 128 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().

131 {
132  if(verbose_>=1) std::cout << "ESTrivialConditionRetriever::setIntervalFor(): record key = " << rk.name() << "\ttime: " << iTime.time().value() << std::endl;
133  //For right now, we will just use an infinite interval of validity
135 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
static const IOVSyncValue & beginOfTime()
const Timestamp & time() const
Definition: IOVSyncValue.h:44
TimeValue_t value() const
Definition: Timestamp.h:56

Member Data Documentation

double ESTrivialConditionRetriever::adcToGeVHighConstant_
private

Definition at line 76 of file ESTrivialConditionRetriever.h.

double ESTrivialConditionRetriever::adcToGeVLowConstant_
private

Definition at line 75 of file ESTrivialConditionRetriever.h.

ESWeightSet ESTrivialConditionRetriever::amplWeights_
private

Definition at line 87 of file ESTrivialConditionRetriever.h.

std::string ESTrivialConditionRetriever::amplWeightsFile_
private

Definition at line 89 of file ESTrivialConditionRetriever.h.

std::string ESTrivialConditionRetriever::channelStatusFile_
private

Definition at line 91 of file ESTrivialConditionRetriever.h.

double ESTrivialConditionRetriever::ESpedMean_
private

Definition at line 84 of file ESTrivialConditionRetriever.h.

double ESTrivialConditionRetriever::ESpedRMS_
private

Definition at line 85 of file ESTrivialConditionRetriever.h.

bool ESTrivialConditionRetriever::getWeightsFromFile_
private

Definition at line 93 of file ESTrivialConditionRetriever.h.

double ESTrivialConditionRetriever::intercalibConstantMean_
private

Definition at line 78 of file ESTrivialConditionRetriever.h.

std::string ESTrivialConditionRetriever::intercalibConstantsFile_
private

Definition at line 90 of file ESTrivialConditionRetriever.h.

double ESTrivialConditionRetriever::intercalibConstantSigma_
private

Definition at line 79 of file ESTrivialConditionRetriever.h.

bool ESTrivialConditionRetriever::producedESADCToGeVConstant_
private

Definition at line 97 of file ESTrivialConditionRetriever.h.

bool ESTrivialConditionRetriever::producedESChannelStatus_
private

Definition at line 98 of file ESTrivialConditionRetriever.h.

bool ESTrivialConditionRetriever::producedESIntercalibConstants_
private

Definition at line 96 of file ESTrivialConditionRetriever.h.

bool ESTrivialConditionRetriever::producedESPedestals_
private

Definition at line 94 of file ESTrivialConditionRetriever.h.

bool ESTrivialConditionRetriever::producedESWeights_
private

Definition at line 95 of file ESTrivialConditionRetriever.h.

int ESTrivialConditionRetriever::verbose_
private

Definition at line 100 of file ESTrivialConditionRetriever.h.