1 #ifndef _CSCFAKEDBCROSSTALK_H 2 #define _CSCFAKEDBCROSSTALK_H 27 typedef std::unique_ptr<CSCDBCrosstalk>
Pointer;
49 const int SLOPE_FACTOR = 10000000;
50 const int INTERCEPT_FACTOR = 100000;
58 ii = 0,
jj = 0, iii = 0, jjj = 0;
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);
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);
74 if (
i < 34561 &&
i % 80 == 0) {
75 cndbcrosstalk->
crosstalk[
i].xtalk_slope_left = 0;
76 cndbcrosstalk->
crosstalk[
i].xtalk_intercept_left = 0;
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;
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;
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;
96 if (
i > 48384 &&
i < 143425) {
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;
104 if (
i > 48384 &&
i < 143425) {
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;
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;
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;
126 if (
i > 157248 && iii % 80 == 0) {
127 cndbcrosstalk->
crosstalk[
i].xtalk_slope_left = 0;
128 cndbcrosstalk->
crosstalk[
i].xtalk_intercept_left = 0;
134 if (
i > 157248 && (jjj + 1) % 80 == 0) {
135 cndbcrosstalk->
crosstalk[
i].xtalk_slope_right = 0;
136 cndbcrosstalk->
crosstalk[
i].xtalk_intercept_right = 0;
140 return cndbcrosstalk;
~CSCFakeDBCrosstalk() override
static CSCDBCrosstalk * prefillDBCrosstalk()
CSCFakeDBCrosstalk(const edm::ParameterSet &)
Pointer produceDBCrosstalk(const CSCDBCrosstalkRcd &)
constexpr unsigned int MAX_SIZE
CrosstalkContainer crosstalk
std::unique_ptr< CSCDBCrosstalk > Pointer
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override