1 #ifndef _CSCFAKEDBCROSSTALK_H
2 #define _CSCFAKEDBCROSSTALK_H
19 #include <boost/shared_ptr.hpp>
28 typedef boost::shared_ptr<CSCDBCrosstalk>
Pointer;
49 const int MAX_SIZE = 217728;
50 const int SLOPE_FACTOR=10000000;
51 const int INTERCEPT_FACTOR=100000;
54 cndbcrosstalk->
crosstalk.resize(MAX_SIZE);
58 mean=-0.0009, min=0.035;
59 ii=0,jj=0,iii=0,jjj=0;
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);
72 if(
i<34561 &&
i%80==0){
73 cndbcrosstalk->
crosstalk[
i].xtalk_slope_left=0;
74 cndbcrosstalk->
crosstalk[
i].xtalk_intercept_left=0;
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;
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;
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;
94 if(
i>48384 &&
i<143425){
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;
102 if(
i>48384 &&
i<143425){
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;
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;
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;
125 if(
i>157248 && iii%80==0){
126 cndbcrosstalk->
crosstalk[
i].xtalk_slope_left=0;
127 cndbcrosstalk->
crosstalk[
i].xtalk_intercept_left=0;
133 if(
i>157248 && (jjj+1)%80==0){
134 cndbcrosstalk->
crosstalk[
i].xtalk_slope_right=0;
135 cndbcrosstalk->
crosstalk[
i].xtalk_intercept_right=0;
139 return cndbcrosstalk;
static CSCDBCrosstalk * prefillDBCrosstalk()
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
boost::shared_ptr< CSCDBCrosstalk > Pointer
CSCFakeDBCrosstalk(const edm::ParameterSet &)
Pointer produceDBCrosstalk(const CSCDBCrosstalkRcd &)
CrosstalkContainer crosstalk