CMS 3D CMS Logo

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

#include <CSCFakeDBCrosstalk.h>

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

Public Types

typedef std::unique_ptr< CSCDBCrosstalkPointer
 
- 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

 CSCFakeDBCrosstalk (const edm::ParameterSet &)
 
Pointer produceDBCrosstalk (const CSCDBCrosstalkRcd &)
 
 ~CSCFakeDBCrosstalk () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~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)
 

Static Public Member Functions

static CSCDBCrosstalkprefillDBCrosstalk ()
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

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

Private Attributes

Pointer cndbCrosstalk
 

Additional Inherited Members

- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
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 >
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 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 CSCFakeDBCrosstalk.h.

Member Typedef Documentation

typedef std::unique_ptr<CSCDBCrosstalk> CSCFakeDBCrosstalk::Pointer

Definition at line 27 of file CSCFakeDBCrosstalk.h.

Constructor & Destructor Documentation

CSCFakeDBCrosstalk::CSCFakeDBCrosstalk ( const edm::ParameterSet iConfig)

Definition at line 6 of file CSCFakeDBCrosstalk.cc.

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

6  {
7  // the following line is needed to tell the framework what
8  // data is being produced
10  findingRecord<CSCDBCrosstalkRcd>();
11 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
Pointer produceDBCrosstalk(const CSCDBCrosstalkRcd &)
CSCFakeDBCrosstalk::~CSCFakeDBCrosstalk ( )
override

Definition at line 13 of file CSCFakeDBCrosstalk.cc.

13 {}

Member Function Documentation

CSCDBCrosstalk * CSCFakeDBCrosstalk::prefillDBCrosstalk ( )
inlinestatic

Definition at line 44 of file CSCFakeDBCrosstalk.h.

References CSCDBCrosstalk::crosstalk, CSCDBCrosstalk::factor_intercept, CSCDBCrosstalk::factor_slope, mps_fire::i, cuy::ii, createfilelist::int, findQualityFiles::jj, SiStripPI::mean, min(), rand(), and SurveyInfoScenario_cff::seed.

Referenced by produceDBCrosstalk().

44  {
45  int seed;
46  float mean, min;
47  int ii, jj, iii, jjj;
48  const int MAX_SIZE = 217728; // or 252288 for ME4/2 chambers
49  const int SLOPE_FACTOR = 10000000;
50  const int INTERCEPT_FACTOR = 100000;
51 
52  CSCDBCrosstalk *cndbcrosstalk = new CSCDBCrosstalk();
53  cndbcrosstalk->crosstalk.resize(MAX_SIZE);
54 
55  seed = 10000;
56  srand(seed);
57  mean = -0.0009, min = 0.035;
58  ii = 0, jj = 0, iii = 0, jjj = 0;
59 
60  cndbcrosstalk->factor_slope = int(SLOPE_FACTOR);
61  cndbcrosstalk->factor_intercept = int(INTERCEPT_FACTOR);
62 
63  for (int i = 0; i < MAX_SIZE; i++) {
64  cndbcrosstalk->crosstalk[i].xtalk_slope_right =
65  (short int)((-((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 10000 + mean) * SLOPE_FACTOR + 0.5);
66  cndbcrosstalk->crosstalk[i].xtalk_intercept_right =
67  (short int)((((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 100 + min) * INTERCEPT_FACTOR + 0.5);
68  cndbcrosstalk->crosstalk[i].xtalk_slope_left =
69  (short int)((-((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 10000 + mean) * SLOPE_FACTOR + 0.5);
70  cndbcrosstalk->crosstalk[i].xtalk_intercept_left =
71  (short int)((((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 100 + min) * INTERCEPT_FACTOR + 0.5);
72 
73  // 80 strips per chamber
74  if (i < 34561 && i % 80 == 0) {
75  cndbcrosstalk->crosstalk[i].xtalk_slope_left = 0;
76  cndbcrosstalk->crosstalk[i].xtalk_intercept_left = 0;
77  }
78 
79  if (i != 0 && i < 34561 && (i + 1) % 80 == 0) {
80  cndbcrosstalk->crosstalk[i].xtalk_slope_right = 0;
81  cndbcrosstalk->crosstalk[i].xtalk_intercept_right = 0;
82  }
83 
84  // 64 strips per chamber
85  if (i > 34560 && i < 48385 && i % 64 == 0) {
86  cndbcrosstalk->crosstalk[i].xtalk_slope_left = 0;
87  cndbcrosstalk->crosstalk[i].xtalk_intercept_left = 0;
88  }
89 
90  if (i > 34560 && i < 48385 && (i + 1) % 64 == 0) {
91  cndbcrosstalk->crosstalk[i].xtalk_slope_right = 0;
92  cndbcrosstalk->crosstalk[i].xtalk_intercept_right = 0;
93  }
94 
95  // 80 strips per chamber again
96  if (i > 48384 && i < 143425) {
97  ii++;
98  if (i > 48384 && i < 143425 && ii % 80 == 0) {
99  cndbcrosstalk->crosstalk[i].xtalk_slope_left = 0;
100  cndbcrosstalk->crosstalk[i].xtalk_intercept_left = 0;
101  }
102  }
103 
104  if (i > 48384 && i < 143425) {
105  jj++;
106  if (i > 48384 && i < 143425 && (jj + 1) % 80 == 0) {
107  cndbcrosstalk->crosstalk[i].xtalk_slope_right = 0;
108  cndbcrosstalk->crosstalk[i].xtalk_intercept_right = 0;
109  }
110  }
111 
112  // 64 strips per chamber again
113  if (i > 143424 && i < 157249 && i % 64 == 0) {
114  cndbcrosstalk->crosstalk[i].xtalk_slope_left = 0;
115  cndbcrosstalk->crosstalk[i].xtalk_intercept_left = 0;
116  }
117 
118  if (i > 143424 && i < 157249 && (i + 1) % 64 == 0) {
119  cndbcrosstalk->crosstalk[i].xtalk_slope_right = 0;
120  cndbcrosstalk->crosstalk[i].xtalk_intercept_right = 0;
121  }
122 
123  // 80 strips per chamber last time
124  if (i > 157248) {
125  iii++;
126  if (i > 157248 && iii % 80 == 0) {
127  cndbcrosstalk->crosstalk[i].xtalk_slope_left = 0;
128  cndbcrosstalk->crosstalk[i].xtalk_intercept_left = 0;
129  }
130  }
131 
132  if (i > 157248) {
133  jjj++;
134  if (i > 157248 && (jjj + 1) % 80 == 0) {
135  cndbcrosstalk->crosstalk[i].xtalk_slope_right = 0;
136  cndbcrosstalk->crosstalk[i].xtalk_intercept_right = 0;
137  }
138  }
139  }
140  return cndbcrosstalk;
141 }
T min(T a, T b)
Definition: MathUtil.h:58
ii
Definition: cuy.py:590
Signal rand(Signal arg)
Definition: vlib.cc:442
CrosstalkContainer crosstalk
CSCFakeDBCrosstalk::Pointer CSCFakeDBCrosstalk::produceDBCrosstalk ( const CSCDBCrosstalkRcd iRecord)

Definition at line 16 of file CSCFakeDBCrosstalk.cc.

References prefillDBCrosstalk().

Referenced by CSCFakeDBCrosstalk().

16  {
18 }
static CSCDBCrosstalk * prefillDBCrosstalk()
std::unique_ptr< CSCDBCrosstalk > Pointer
void CSCFakeDBCrosstalk::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
)
overrideprivatevirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 20 of file CSCFakeDBCrosstalk.cc.

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

22  {
24 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88

Member Data Documentation

Pointer CSCFakeDBCrosstalk::cndbCrosstalk
private

Definition at line 36 of file CSCFakeDBCrosstalk.h.