CMS 3D CMS Logo

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

#include <CSCFakeCrosstalkConditions.h>

Inheritance diagram for CSCFakeCrosstalkConditions:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Types

typedef std::unique_ptr< CSCcrosstalkReturnType
 

Public Member Functions

 CSCFakeCrosstalkConditions (const edm::ParameterSet &)
 
CSCcrosstalkprefillCrosstalk ()
 
ReturnType produceCrosstalk (const CSCcrosstalkRcd &)
 
 ~CSCFakeCrosstalkConditions () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () 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::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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 19 of file CSCFakeCrosstalkConditions.h.

Member Typedef Documentation

◆ ReturnType

Definition at line 30 of file CSCFakeCrosstalkConditions.h.

Constructor & Destructor Documentation

◆ CSCFakeCrosstalkConditions()

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

Definition at line 107 of file CSCFakeCrosstalkConditions.cc.

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

107  {
108  // the following line is needed to tell the framework what
109  // data is being produced
111  findingRecord<CSCcrosstalkRcd>();
112  // now do what ever other initialization is needed
113 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
ReturnType produceCrosstalk(const CSCcrosstalkRcd &)

◆ ~CSCFakeCrosstalkConditions()

CSCFakeCrosstalkConditions::~CSCFakeCrosstalkConditions ( )
override

Definition at line 115 of file CSCFakeCrosstalkConditions.cc.

115  {
116  // do anything here that needs to be done at desctruction time
117  // (e.g. close files, deallocate resources etc.)
118 }

Member Function Documentation

◆ prefillCrosstalk()

CSCcrosstalk * CSCFakeCrosstalkConditions::prefillCrosstalk ( )

Definition at line 5 of file CSCFakeCrosstalkConditions.cc.

References CSCcrosstalk::crosstalk, hcalRecHitTable_cff::detId, M, mean, min, minchi, and seed.

Referenced by produceCrosstalk().

5  {
6  const CSCDetId &detId = CSCDetId();
7  CSCcrosstalk *cncrosstalk = new CSCcrosstalk();
8 
9  int max_istrip, id_layer, max_ring, max_cham;
10  seed = 10000;
11  srand(seed);
12  mean = -0.0009, min = 0.035, minchi = 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  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  // station 1 ring 3 has 64 strips per layer instead of 80(minus & plus
49  // side!!!)
50 
51  for (int ichamber = detId.minChamberId(); ichamber <= max_cham; ichamber++) {
52  for (int ilayer = detId.minLayerId(); ilayer <= detId.maxLayerId(); ilayer++) {
53  // station 1 ring 3 has 64 strips per layer instead of 80
54  if (istation == 1 && iring == 3)
55  max_istrip = 64;
56 
57  std::vector<CSCcrosstalk::Item> itemvector;
58  itemvector.resize(max_istrip);
59  id_layer = 100000 * iendcap + 10000 * istation + 1000 * iring + 10 * ichamber + ilayer;
60 
61  for (int istrip = 0; istrip < max_istrip; istrip++) {
62  // create fake values
63  itemvector[istrip].xtalk_slope_right =
64  -((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 10000 + mean;
65  itemvector[istrip].xtalk_intercept_right =
66  ((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 100 + min;
67  itemvector[istrip].xtalk_chi2_right = ((double)rand() / ((double)(RAND_MAX) + (double)(1))) + minchi;
68  itemvector[istrip].xtalk_slope_left =
69  -((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 10000 + mean;
70  itemvector[istrip].xtalk_intercept_left =
71  ((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 100 + min;
72  itemvector[istrip].xtalk_chi2_left = ((double)rand() / ((double)(RAND_MAX) + (double)(1))) + minchi;
73  cncrosstalk->crosstalk[id_layer] = itemvector;
74 
75  if (istrip == 0) {
76  itemvector[istrip].xtalk_slope_right =
77  -((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 10000 + mean;
78  itemvector[istrip].xtalk_intercept_right =
79  ((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 100 + min;
80  itemvector[istrip].xtalk_chi2_right = ((double)rand() / ((double)(RAND_MAX) + (double)(1))) + minchi;
81  itemvector[istrip].xtalk_slope_left = 0.0;
82  itemvector[istrip].xtalk_intercept_left = 0.0;
83  itemvector[istrip].xtalk_chi2_left = 0.0;
84  cncrosstalk->crosstalk[id_layer] = itemvector;
85  }
86 
87  if (istrip == 79) {
88  itemvector[istrip].xtalk_slope_right = 0.0;
89  itemvector[istrip].xtalk_intercept_right = 0.0;
90  itemvector[istrip].xtalk_chi2_right = 0.0;
91  itemvector[istrip].xtalk_slope_left =
92  -((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 10000 + mean;
93  itemvector[istrip].xtalk_intercept_left =
94  ((double)rand() / ((double)(RAND_MAX) + (double)(1))) / 100 + min;
95  itemvector[istrip].xtalk_chi2_left = ((double)rand() / ((double)(RAND_MAX) + (double)(1))) + minchi;
96  cncrosstalk->crosstalk[id_layer] = itemvector;
97  }
98  }
99  }
100  }
101  }
102  }
103  }
104  return cncrosstalk;
105 }
CrosstalkMap crosstalk
Definition: CSCcrosstalk.h:29

◆ produceCrosstalk()

CSCFakeCrosstalkConditions::ReturnType CSCFakeCrosstalkConditions::produceCrosstalk ( const CSCcrosstalkRcd iRecord)

Definition at line 125 of file CSCFakeCrosstalkConditions.cc.

References prefillCrosstalk().

Referenced by CSCFakeCrosstalkConditions().

125  {
127 }
std::unique_ptr< CSCcrosstalk > ReturnType

◆ setIntervalFor()

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

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 129 of file CSCFakeCrosstalkConditions.cc.

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

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

Member Data Documentation

◆ M

long int CSCFakeCrosstalkConditions::M

Definition at line 26 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().

◆ mean

float CSCFakeCrosstalkConditions::mean

Definition at line 24 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().

◆ min

float CSCFakeCrosstalkConditions::min

Definition at line 24 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().

◆ minchi

float CSCFakeCrosstalkConditions::minchi

Definition at line 24 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().

◆ seed

int CSCFakeCrosstalkConditions::seed

Definition at line 25 of file CSCFakeCrosstalkConditions.h.

Referenced by prefillCrosstalk().