CMS 3D CMS Logo

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

#include <CSCFakePedestalsConditions.h>

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

Public Types

typedef const CSCPedestalsReturnType
 
- 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
 

Public Member Functions

 CSCFakePedestalsConditions (const edm::ParameterSet &)
 
void prefillPedestals ()
 
ReturnType producePedestals (const CSCPedestalsRcd &)
 
 ~CSCFakePedestalsConditions () 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)
 

Public Attributes

long int M
 
float meanped
 
float meanrms
 
int seed
 

Private Member Functions

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

Private Attributes

CSCPedestalscnpedestals
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- 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 &)
 

Detailed Description

Definition at line 20 of file CSCFakePedestalsConditions.h.

Member Typedef Documentation

Definition at line 30 of file CSCFakePedestalsConditions.h.

Constructor & Destructor Documentation

CSCFakePedestalsConditions::CSCFakePedestalsConditions ( const edm::ParameterSet iConfig)

Definition at line 59 of file CSCFakePedestalsConditions.cc.

References prefillPedestals(), producePedestals(), and edm::ESProducer::setWhatProduced().

60 {
61  //the following line is needed to tell the framework what
62  // data is being produced
65  findingRecord<CSCPedestalsRcd>();
66  //now do what ever other initialization is needed
67 }
ReturnType producePedestals(const CSCPedestalsRcd &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
CSCFakePedestalsConditions::~CSCFakePedestalsConditions ( )
override

Definition at line 70 of file CSCFakePedestalsConditions.cc.

References cnpedestals.

71 {
72 
73  // do anything here that needs to be done at desctruction time
74  // (e.g. close files, deallocate resources etc.)
75  delete cnpedestals;
76 }

Member Function Documentation

void CSCFakePedestalsConditions::prefillPedestals ( )

Definition at line 4 of file CSCFakePedestalsConditions.cc.

References cnpedestals, M, CSCDetId::maxChamberId(), CSCDetId::maxEndcapId(), CSCDetId::maxLayerId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), meanped, meanrms, CSCDetId::minChamberId(), CSCDetId::minEndcapId(), CSCDetId::minLayerId(), CSCDetId::minRingId(), CSCDetId::minStationId(), CSCPedestals::pedestals, rand(), and seed.

Referenced by CSCFakePedestalsConditions().

5 {
6  const CSCDetId& detId = CSCDetId();
8 
9  int max_istrip,id_layer,max_ring,max_cham;
10  seed = 10000;
11  srand(seed);
12  meanped=600.0, meanrms=1.5, M=1000;
13 
14  //endcap=1 to 2,station=1 to 4, ring=1 to 4,chamber=1 to 36,layer=1 to 6
15 
16  for(int iendcap=detId.minEndcapId(); iendcap<=detId.maxEndcapId(); iendcap++){
17  for(int istation=detId.minStationId() ; istation<=detId.maxStationId(); istation++){
18  max_ring=detId.maxRingId();
19  //station 4 ring 4 not there(36 chambers*2 missing)
20  //3 rings max this way of counting (ME1a & b)
21  if(istation==1) max_ring=3;
22  if(istation==2) max_ring=2;
23  if(istation==3) max_ring=2;
24  if(istation==4) max_ring=1;
25 
26  for(int iring=detId.minRingId(); iring<=max_ring; iring++){
27  max_istrip=80;
28  max_cham=detId.maxChamberId();
29  if(istation==1 && iring==1) max_cham=36;
30  if(istation==1 && iring==2) max_cham=36;
31  if(istation==1 && iring==3) max_cham=36;
32  if(istation==2 && iring==1) max_cham=18;
33  if(istation==2 && iring==2) max_cham=36;
34  if(istation==3 && iring==1) max_cham=18;
35  if(istation==3 && iring==2) max_cham=36;
36  if(istation==4 && iring==1) max_cham=18;
37 
38  for(int ichamber=detId.minChamberId(); ichamber<=max_cham; ichamber++){
39  for(int ilayer=detId.minLayerId(); ilayer<=detId.maxLayerId(); ilayer++){
40  //station 1 ring 3 has 64 strips per layer instead of 80
41  if(istation==1 && iring==3) max_istrip=64;
42 
43  std::vector<CSCPedestals::Item> itemvector;
44  itemvector.resize(max_istrip);
45  id_layer = 100000*iendcap + 10000*istation + 1000*iring + 10*ichamber + ilayer;
46 
47  for(int istrip=0;istrip<max_istrip;istrip++){
48  itemvector[istrip].ped=((double)rand()/((double)(RAND_MAX)+(double)(1)))*100+meanped;
49  itemvector[istrip].rms=((double)rand()/((double)(RAND_MAX)+(double)(1)))+meanrms;
50  cnpedestals->pedestals[id_layer]=itemvector;
51  }
52  }
53  }
54  }
55  }
56  }
57 }
static int minRingId()
Definition: CSCDetId.h:240
static int minEndcapId()
Definition: CSCDetId.h:236
static int maxStationId()
Definition: CSCDetId.h:239
static int maxRingId()
Definition: CSCDetId.h:241
static int minChamberId()
Definition: CSCDetId.h:242
PedestalMap pedestals
Definition: CSCPedestals.h:25
static int minStationId()
Definition: CSCDetId.h:238
static int maxEndcapId()
Definition: CSCDetId.h:237
static int minLayerId()
Definition: CSCDetId.h:244
static int maxChamberId()
Definition: CSCDetId.h:243
Signal rand(Signal arg)
Definition: vlib.cc:442
static int maxLayerId()
Definition: CSCDetId.h:245
CSCFakePedestalsConditions::ReturnType CSCFakePedestalsConditions::producePedestals ( const CSCPedestalsRcd iRecord)

Definition at line 85 of file CSCFakePedestalsConditions.cc.

References cnpedestals.

Referenced by CSCFakePedestalsConditions().

86 {
87  return cnpedestals;
88 }
void CSCFakePedestalsConditions::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
)
overrideprivatevirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 90 of file CSCFakePedestalsConditions.cc.

References edm::IOVSyncValue::beginOfTime(), and edm::IOVSyncValue::endOfTime().

92  {
94 
95  }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
static const IOVSyncValue & beginOfTime()

Member Data Documentation

CSCPedestals* CSCFakePedestalsConditions::cnpedestals
private
long int CSCFakePedestalsConditions::M

Definition at line 26 of file CSCFakePedestalsConditions.h.

Referenced by prefillPedestals().

float CSCFakePedestalsConditions::meanped

Definition at line 25 of file CSCFakePedestalsConditions.h.

Referenced by prefillPedestals().

float CSCFakePedestalsConditions::meanrms

Definition at line 25 of file CSCFakePedestalsConditions.h.

Referenced by prefillPedestals().

int CSCFakePedestalsConditions::seed

Definition at line 26 of file CSCFakePedestalsConditions.h.

Referenced by prefillPedestals().