CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 boost::shared_ptr
< CSCDBCrosstalk
Pointer
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

 CSCFakeDBCrosstalk (const edm::ParameterSet &)
 
Pointer produceDBCrosstalk (const CSCDBCrosstalkRcd &)
 
 ~CSCFakeDBCrosstalk ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const
eventsetup::ComponentDescription
descriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set
< eventsetup::EventSetupRecordKey
findingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder ()
 

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 &)
 

Private Attributes

Pointer cndbCrosstalk
 

Additional Inherited Members

- 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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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 21 of file CSCFakeDBCrosstalk.h.

Member Typedef Documentation

typedef boost::shared_ptr<CSCDBCrosstalk> CSCFakeDBCrosstalk::Pointer

Definition at line 28 of file CSCFakeDBCrosstalk.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file CSCFakeDBCrosstalk.cc.

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

7 {
8  //the following line is needed to tell the framework what
9  // data is being produced
10  cndbCrosstalk = boost::shared_ptr<CSCDBCrosstalk> ( prefillDBCrosstalk() );
12  findingRecord<CSCDBCrosstalkRcd>();
13 }
static CSCDBCrosstalk * prefillDBCrosstalk()
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
Pointer produceDBCrosstalk(const CSCDBCrosstalkRcd &)
CSCFakeDBCrosstalk::~CSCFakeDBCrosstalk ( )

Definition at line 16 of file CSCFakeDBCrosstalk.cc.

17 {
18 }

Member Function Documentation

CSCDBCrosstalk * CSCFakeDBCrosstalk::prefillDBCrosstalk ( )
inlinestatic

Definition at line 44 of file CSCFakeDBCrosstalk.h.

References CSCDBCrosstalk::crosstalk, CSCDBCrosstalk::factor_intercept, CSCDBCrosstalk::factor_slope, i, cuy::ii, findQualityFiles::jj, timingPdfMaker::mean, bookConverter::min, and rand().

Referenced by CSCFakeDBCrosstalk().

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

Definition at line 23 of file CSCFakeDBCrosstalk.cc.

References cndbCrosstalk.

Referenced by CSCFakeDBCrosstalk().

24 {
25  return cndbCrosstalk;
26 }
void CSCFakeDBCrosstalk::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
)
privatevirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 28 of file CSCFakeDBCrosstalk.cc.

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

30  {
32 
33  }
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

Pointer CSCFakeDBCrosstalk::cndbCrosstalk
private

Definition at line 35 of file CSCFakeDBCrosstalk.h.

Referenced by CSCFakeDBCrosstalk(), and produceDBCrosstalk().