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 | Public Attributes | Private Member Functions | Private Attributes
CSCFakeCrosstalkConditions Class Reference

#include <CSCFakeCrosstalkConditions.h>

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

Public Types

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

 CSCFakeCrosstalkConditions (const edm::ParameterSet &)
 
void prefillCrosstalk ()
 
ReturnType produceCrosstalk (const CSCcrosstalkRcd &)
 
 ~CSCFakeCrosstalkConditions ()
 
- 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 ()
 

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

Private Attributes

CSCcrosstalkcncrosstalk
 

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::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 19 of file CSCFakeCrosstalkConditions.h.

Member Typedef Documentation

Definition at line 29 of file CSCFakeCrosstalkConditions.h.

Constructor & Destructor Documentation

CSCFakeCrosstalkConditions::CSCFakeCrosstalkConditions ( const edm::ParameterSet iConfig)

Definition at line 87 of file CSCFakeCrosstalkConditions.cc.

References prefillCrosstalk(), produceCrosstalk(), and edm::ESProducer::setWhatProduced().

88 {
89  //the following line is needed to tell the framework what
90  // data is being produced
93  findingRecord<CSCcrosstalkRcd>();
94  //now do what ever other initialization is needed
95 }
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
ReturnType produceCrosstalk(const CSCcrosstalkRcd &)
CSCFakeCrosstalkConditions::~CSCFakeCrosstalkConditions ( )

Definition at line 98 of file CSCFakeCrosstalkConditions.cc.

References cncrosstalk.

99 {
100 
101  // do anything here that needs to be done at desctruction time
102  // (e.g. close files, deallocate resources etc.)
103  delete cncrosstalk;
104 }

Member Function Documentation

void CSCFakeCrosstalkConditions::prefillCrosstalk ( )

Definition at line 5 of file CSCFakeCrosstalkConditions.cc.

References cncrosstalk, CSCcrosstalk::crosstalk, CSCDetId, 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 CSCFakeCrosstalkConditions().

5  {
6 
7  const CSCDetId& detId = CSCDetId();
9 
10  int max_istrip,id_layer,max_ring,max_cham;
11  seed = 10000;
12  srand(seed);
13  mean=-0.0009, min=0.035, minchi=1.5, M=1000;
14 
15  //endcap=1 to 2,station=1 to 4, ring=1 to 4,chamber=1 to 36,layer=1 to 6
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  //station 1 ring 3 has 64 strips per layer instead of 80(minus & plus side!!!)
38 
39  for(int ichamber=detId.minChamberId(); ichamber<=max_cham; ichamber++){
40 
41  for(int ilayer=detId.minLayerId(); ilayer<=detId.maxLayerId(); ilayer++){
42  //station 1 ring 3 has 64 strips per layer instead of 80
43  if(istation==1 && iring==3) max_istrip=64;
44 
45  std::vector<CSCcrosstalk::Item> itemvector;
46  itemvector.resize(max_istrip);
47  id_layer = 100000*iendcap + 10000*istation + 1000*iring + 10*ichamber + ilayer;
48 
49  for(int istrip=0;istrip<max_istrip;istrip++){
50  //create fake values
51  itemvector[istrip].xtalk_slope_right=-((double)rand()/((double)(RAND_MAX)+(double)(1)))/10000+mean;
52  itemvector[istrip].xtalk_intercept_right=((double)rand()/((double)(RAND_MAX)+(double)(1)))/100+min;
53  itemvector[istrip].xtalk_chi2_right=((double)rand()/((double)(RAND_MAX)+(double)(1)))+minchi;
54  itemvector[istrip].xtalk_slope_left=-((double)rand()/((double)(RAND_MAX)+(double)(1)))/10000+mean;
55  itemvector[istrip].xtalk_intercept_left=((double)rand()/((double)(RAND_MAX)+(double)(1)))/100+min;
56  itemvector[istrip].xtalk_chi2_left=((double)rand()/((double)(RAND_MAX)+(double)(1)))+minchi;
57  cncrosstalk->crosstalk[id_layer]=itemvector;
58 
59  if(istrip==0){
60  itemvector[istrip].xtalk_slope_right=-((double)rand()/((double)(RAND_MAX)+(double)(1)))/10000+mean;
61  itemvector[istrip].xtalk_intercept_right=((double)rand()/((double)(RAND_MAX)+(double)(1)))/100+min;
62  itemvector[istrip].xtalk_chi2_right=((double)rand()/((double)(RAND_MAX)+(double)(1)))+minchi;
63  itemvector[istrip].xtalk_slope_left=0.0;
64  itemvector[istrip].xtalk_intercept_left=0.0;
65  itemvector[istrip].xtalk_chi2_left=0.0;
66  cncrosstalk->crosstalk[id_layer]=itemvector;
67  }
68 
69  if(istrip==79){
70  itemvector[istrip].xtalk_slope_right=0.0;
71  itemvector[istrip].xtalk_intercept_right=0.0;
72  itemvector[istrip].xtalk_chi2_right=0.0;
73  itemvector[istrip].xtalk_slope_left=-((double)rand()/((double)(RAND_MAX)+(double)(1)))/10000+mean;
74  itemvector[istrip].xtalk_intercept_left=((double)rand()/((double)(RAND_MAX)+(double)(1)))/100+min;
75  itemvector[istrip].xtalk_chi2_left=((double)rand()/((double)(RAND_MAX)+(double)(1)))+minchi;
76  cncrosstalk->crosstalk[id_layer]=itemvector;
77  }
78  }
79  }
80  }
81  }
82  }
83  }
84 }
static int minRingId()
Definition: CSCDetId.h:253
static int minEndcapId()
Definition: CSCDetId.h:249
static int maxStationId()
Definition: CSCDetId.h:252
static int maxRingId()
Definition: CSCDetId.h:254
CrosstalkMap crosstalk
Definition: CSCcrosstalk.h:30
static int minChamberId()
Definition: CSCDetId.h:255
static int minStationId()
Definition: CSCDetId.h:251
static int maxEndcapId()
Definition: CSCDetId.h:250
static int minLayerId()
Definition: CSCDetId.h:257
static int maxChamberId()
Definition: CSCDetId.h:256
Signal rand(Signal arg)
Definition: vlib.cc:442
static int maxLayerId()
Definition: CSCDetId.h:258
CSCFakeCrosstalkConditions::ReturnType CSCFakeCrosstalkConditions::produceCrosstalk ( const CSCcrosstalkRcd iRecord)

Definition at line 113 of file CSCFakeCrosstalkConditions.cc.

References cncrosstalk.

Referenced by CSCFakeCrosstalkConditions().

114 {
115  return cncrosstalk;
116 }
void CSCFakeCrosstalkConditions::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
)
privatevirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 118 of file CSCFakeCrosstalkConditions.cc.

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

120  {
122 
123  }
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

CSCcrosstalk* CSCFakeCrosstalkConditions::cncrosstalk
private
long int CSCFakeCrosstalkConditions::M

Definition at line 25 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().

float CSCFakeCrosstalkConditions::mean

Definition at line 24 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().

float CSCFakeCrosstalkConditions::min

Definition at line 24 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().

float CSCFakeCrosstalkConditions::minchi

Definition at line 24 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().

int CSCFakeCrosstalkConditions::seed

Definition at line 25 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().