CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Private Member Functions
CSCFakeGainsConditions Class Reference

#include <CSCFakeGainsConditions.h>

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

Public Types

typedef std::unique_ptr< CSCGainsReturnType
 

Public Member Functions

 CSCFakeGainsConditions (const edm::ParameterSet &)
 
CSCGainsprefillGains ()
 
ReturnType produceGains (const CSCGainsRcd &)
 
 ~CSCFakeGainsConditions () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
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)
 

Public Attributes

long int M
 
float mean
 
float min
 
float minchi
 
int seed
 

Private Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 

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 > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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 >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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 &)
 

Detailed Description

Definition at line 20 of file CSCFakeGainsConditions.h.

Member Typedef Documentation

◆ ReturnType

typedef std::unique_ptr<CSCGains> CSCFakeGainsConditions::ReturnType

Definition at line 31 of file CSCFakeGainsConditions.h.

Constructor & Destructor Documentation

◆ CSCFakeGainsConditions()

CSCFakeGainsConditions::CSCFakeGainsConditions ( const edm::ParameterSet iConfig)

Definition at line 76 of file CSCFakeGainsConditions.cc.

76  {
77  // the following line is needed to tell the framework what
78  // data is being produced
80  findingRecord<CSCGainsRcd>();
81  // now do what ever other initialization is needed
82 }

References produceGains(), and edm::ESProducer::setWhatProduced().

◆ ~CSCFakeGainsConditions()

CSCFakeGainsConditions::~CSCFakeGainsConditions ( )
override

Definition at line 84 of file CSCFakeGainsConditions.cc.

84  {
85  // do anything here that needs to be done at desctruction time
86  // (e.g. close files, deallocate resources etc.)
87 }

Member Function Documentation

◆ prefillGains()

CSCGains * CSCFakeGainsConditions::prefillGains ( )

Definition at line 4 of file CSCFakeGainsConditions.cc.

4  {
5  CSCGains *cngains = new CSCGains();
6  const CSCDetId &detId = CSCDetId();
7 
8  int max_istrip, id_layer, max_ring, max_cham;
9  seed = 10000;
10  srand(seed);
11  mean = 6.8, min = -10.0, minchi = 1.0, M = 1000;
12 
13  // endcap=1 to 2,station=1 to 4, ring=1 to 4,chamber=1 to 36,layer=1 to 6
14 
15  for (int iendcap = detId.minEndcapId(); iendcap <= detId.maxEndcapId(); iendcap++) {
16  for (int istation = detId.minStationId(); istation <= detId.maxStationId(); istation++) {
17  max_ring = detId.maxRingId();
18  // station 4 ring 4 not there(36 chambers*2 missing)
19  // 3 rings max this way of counting (ME1a & b)
20  if (istation == 1)
21  max_ring = 3;
22  if (istation == 2)
23  max_ring = 2;
24  if (istation == 3)
25  max_ring = 2;
26  if (istation == 4)
27  max_ring = 1;
28 
29  for (int iring = detId.minRingId(); iring <= max_ring; iring++) {
30  max_istrip = 80;
31  max_cham = detId.maxChamberId();
32  if (istation == 1 && iring == 1)
33  max_cham = 36;
34  if (istation == 1 && iring == 2)
35  max_cham = 36;
36  if (istation == 1 && iring == 3)
37  max_cham = 36;
38  if (istation == 2 && iring == 1)
39  max_cham = 18;
40  if (istation == 2 && iring == 2)
41  max_cham = 36;
42  if (istation == 3 && iring == 1)
43  max_cham = 18;
44  if (istation == 3 && iring == 2)
45  max_cham = 36;
46  if (istation == 4 && iring == 1)
47  max_cham = 18;
48 
49  for (int ichamber = detId.minChamberId(); ichamber <= max_cham; ichamber++) {
50  for (int ilayer = detId.minLayerId(); ilayer <= detId.maxLayerId(); ilayer++) {
51  // station 1 ring 3 has 64 strips per layer instead of 80
52  if (istation == 1 && iring == 3)
53  max_istrip = 64;
54 
55  std::vector<CSCGains::Item> itemvector;
56  itemvector.resize(max_istrip);
57  id_layer = 100000 * iendcap + 10000 * istation + 1000 * iring + 10 * ichamber + ilayer;
58 
59  for (int istrip = 0; istrip < max_istrip; istrip++) {
60  // itemvector[istrip].gain_slope = 7.55;
61  // itemvector[istrip].gain_intercept= -10.00;
62  // itemvector[istrip].gain_chi2 = 2.00;
63  itemvector[istrip].gain_slope = ((double)rand() / ((double)(RAND_MAX) + (double)(1))) + mean;
64  itemvector[istrip].gain_intercept = ((double)rand() / ((double)(RAND_MAX) + (double)(1))) + min;
65  itemvector[istrip].gain_chi2 = ((double)rand() / ((double)(RAND_MAX) + (double)(1))) + minchi;
66  cngains->gains[id_layer] = itemvector;
67  }
68  }
69  }
70  }
71  }
72  }
73  return cngains;
74 }

References CSCGains::gains, M, CSCDetId::maxChamberId(), CSCDetId::maxEndcapId(), CSCDetId::maxLayerId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), mean, min, CSCDetId::minChamberId(), minchi, CSCDetId::minEndcapId(), CSCDetId::minLayerId(), CSCDetId::minRingId(), CSCDetId::minStationId(), rand(), and seed.

Referenced by produceGains().

◆ produceGains()

CSCFakeGainsConditions::ReturnType CSCFakeGainsConditions::produceGains ( const CSCGainsRcd iRecord)

Definition at line 94 of file CSCFakeGainsConditions.cc.

94  {
96 }

References prefillGains().

Referenced by CSCFakeGainsConditions().

◆ setIntervalFor()

void CSCFakeGainsConditions::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
)
overrideprivatevirtual

Member Data Documentation

◆ M

long int CSCFakeGainsConditions::M

Definition at line 27 of file CSCFakeGainsConditions.h.

Referenced by prefillGains().

◆ mean

float CSCFakeGainsConditions::mean

Definition at line 25 of file CSCFakeGainsConditions.h.

Referenced by prefillGains().

◆ min

float CSCFakeGainsConditions::min

Definition at line 25 of file CSCFakeGainsConditions.h.

Referenced by prefillGains().

◆ minchi

float CSCFakeGainsConditions::minchi

Definition at line 25 of file CSCFakeGainsConditions.h.

Referenced by prefillGains().

◆ seed

int CSCFakeGainsConditions::seed

Definition at line 26 of file CSCFakeGainsConditions.h.

Referenced by prefillGains().

CSCDetId::maxStationId
static int maxStationId()
Definition: CSCDetId.h:222
CSCFakeGainsConditions::min
float min
Definition: CSCFakeGainsConditions.h:25
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
CSCDetId::minChamberId
static int minChamberId()
Definition: CSCDetId.h:225
CSCFakeGainsConditions::seed
int seed
Definition: CSCFakeGainsConditions.h:26
CSCGains::gains
GainsMap gains
Definition: CSCGains.h:26
CSCDetId::minStationId
static int minStationId()
Definition: CSCDetId.h:221
CSCFakeGainsConditions::minchi
float minchi
Definition: CSCFakeGainsConditions.h:25
CSCDetId::minEndcapId
static int minEndcapId()
Definition: CSCDetId.h:219
CSCFakeGainsConditions::M
long int M
Definition: CSCFakeGainsConditions.h:27
CSCDetId::maxRingId
static int maxRingId()
Definition: CSCDetId.h:224
CSCGains
Definition: CSCGains.h:10
CSCDetId::minLayerId
static int minLayerId()
Definition: CSCDetId.h:227
CSCFakeGainsConditions::mean
float mean
Definition: CSCFakeGainsConditions.h:25
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
CSCDetId
Definition: CSCDetId.h:26
CSCDetId::maxChamberId
static int maxChamberId()
Definition: CSCDetId.h:226
rand
Signal rand(Signal arg)
Definition: vlib.cc:379
CSCDetId::maxEndcapId
static int maxEndcapId()
Definition: CSCDetId.h:220
CSCFakeGainsConditions::prefillGains
CSCGains * prefillGains()
Definition: CSCFakeGainsConditions.cc:4
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
CSCDetId::maxLayerId
static int maxLayerId()
Definition: CSCDetId.h:228
CSCFakeGainsConditions::produceGains
ReturnType produceGains(const CSCGainsRcd &)
Definition: CSCFakeGainsConditions.cc:94
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
CSCFakeGainsConditions::ReturnType
std::unique_ptr< CSCGains > ReturnType
Definition: CSCFakeGainsConditions.h:31
CSCDetId::minRingId
static int minRingId()
Definition: CSCDetId.h:223