#include <CalibMuon/CSCCalibration/interface/CSCFakeCrosstalkConditions.h>
Public Types | |
typedef const CSCcrosstalk * | ReturnType |
Public Member Functions | |
CSCFakeCrosstalkConditions (const edm::ParameterSet &) | |
void | prefillCrosstalk () |
ReturnType | produceCrosstalk (const CSCcrosstalkRcd &) |
~CSCFakeCrosstalkConditions () | |
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 | |
CSCcrosstalk * | cncrosstalk |
Definition at line 19 of file CSCFakeCrosstalkConditions.h.
typedef const CSCcrosstalk* CSCFakeCrosstalkConditions::ReturnType |
Definition at line 29 of file CSCFakeCrosstalkConditions.h.
CSCFakeCrosstalkConditions::CSCFakeCrosstalkConditions | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 87 of file CSCFakeCrosstalkConditions.cc.
References prefillCrosstalk(), produceCrosstalk(), and edm::ESProducer::setWhatProduced().
00088 { 00089 //the following line is needed to tell the framework what 00090 // data is being produced 00091 prefillCrosstalk(); 00092 setWhatProduced(this,&CSCFakeCrosstalkConditions::produceCrosstalk); 00093 findingRecord<CSCcrosstalkRcd>(); 00094 //now do what ever other initialization is needed 00095 }
CSCFakeCrosstalkConditions::~CSCFakeCrosstalkConditions | ( | ) |
Definition at line 98 of file CSCFakeCrosstalkConditions.cc.
References cncrosstalk.
00099 { 00100 00101 // do anything here that needs to be done at desctruction time 00102 // (e.g. close files, deallocate resources etc.) 00103 delete cncrosstalk; 00104 }
void CSCFakeCrosstalkConditions::prefillCrosstalk | ( | ) |
Definition at line 5 of file CSCFakeCrosstalkConditions.cc.
References cncrosstalk, CSCcrosstalk::crosstalk, detId, M, CSCDetId::maxChamberId(), CSCDetId::maxEndcapId(), CSCDetId::maxLayerId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), mean, min, CSCDetId::minChamberId(), minchi, CSCDetId::minEndcapId(), CSCDetId::minLayerId(), CSCDetId::minRingId(), CSCDetId::minStationId(), and seed.
Referenced by CSCFakeCrosstalkConditions().
00005 { 00006 00007 const CSCDetId& detId = CSCDetId(); 00008 cncrosstalk = new CSCcrosstalk(); 00009 00010 int max_istrip,id_layer,max_ring,max_cham; 00011 seed = 10000; 00012 srand(seed); 00013 mean=-0.0009, min=0.035, minchi=1.5, M=1000; 00014 00015 //endcap=1 to 2,station=1 to 4, ring=1 to 4,chamber=1 to 36,layer=1 to 6 00016 for(int iendcap=detId.minEndcapId(); iendcap<=detId.maxEndcapId(); iendcap++){ 00017 for(int istation=detId.minStationId() ; istation<=detId.maxStationId(); istation++){ 00018 max_ring=detId.maxRingId(); 00019 //station 4 ring 4 not there(36 chambers*2 missing) 00020 //3 rings max this way of counting (ME1a & b) 00021 if(istation==1) max_ring=3; 00022 if(istation==2) max_ring=2; 00023 if(istation==3) max_ring=2; 00024 if(istation==4) max_ring=1; 00025 00026 for(int iring=detId.minRingId(); iring<=max_ring; iring++){ 00027 max_istrip=80; 00028 max_cham=detId.maxChamberId(); 00029 if(istation==1 && iring==1) max_cham=36; 00030 if(istation==1 && iring==2) max_cham=36; 00031 if(istation==1 && iring==3) max_cham=36; 00032 if(istation==2 && iring==1) max_cham=18; 00033 if(istation==2 && iring==2) max_cham=36; 00034 if(istation==3 && iring==1) max_cham=18; 00035 if(istation==3 && iring==2) max_cham=36; 00036 if(istation==4 && iring==1) max_cham=18; 00037 //station 1 ring 3 has 64 strips per layer instead of 80(minus & plus side!!!) 00038 00039 for(int ichamber=detId.minChamberId(); ichamber<=max_cham; ichamber++){ 00040 00041 for(int ilayer=detId.minLayerId(); ilayer<=detId.maxLayerId(); ilayer++){ 00042 //station 1 ring 3 has 64 strips per layer instead of 80 00043 if(istation==1 && iring==3) max_istrip=64; 00044 00045 std::vector<CSCcrosstalk::Item> itemvector; 00046 itemvector.resize(max_istrip); 00047 id_layer = 100000*iendcap + 10000*istation + 1000*iring + 10*ichamber + ilayer; 00048 00049 for(int istrip=0;istrip<max_istrip;istrip++){ 00050 //create fake values 00051 itemvector[istrip].xtalk_slope_right=-((double)rand()/((double)(RAND_MAX)+(double)(1)))/10000+mean; 00052 itemvector[istrip].xtalk_intercept_right=((double)rand()/((double)(RAND_MAX)+(double)(1)))/100+min; 00053 itemvector[istrip].xtalk_chi2_right=((double)rand()/((double)(RAND_MAX)+(double)(1)))+minchi; 00054 itemvector[istrip].xtalk_slope_left=-((double)rand()/((double)(RAND_MAX)+(double)(1)))/10000+mean; 00055 itemvector[istrip].xtalk_intercept_left=((double)rand()/((double)(RAND_MAX)+(double)(1)))/100+min; 00056 itemvector[istrip].xtalk_chi2_left=((double)rand()/((double)(RAND_MAX)+(double)(1)))+minchi; 00057 cncrosstalk->crosstalk[id_layer]=itemvector; 00058 00059 if(istrip==0){ 00060 itemvector[istrip].xtalk_slope_right=-((double)rand()/((double)(RAND_MAX)+(double)(1)))/10000+mean; 00061 itemvector[istrip].xtalk_intercept_right=((double)rand()/((double)(RAND_MAX)+(double)(1)))/100+min; 00062 itemvector[istrip].xtalk_chi2_right=((double)rand()/((double)(RAND_MAX)+(double)(1)))+minchi; 00063 itemvector[istrip].xtalk_slope_left=0.0; 00064 itemvector[istrip].xtalk_intercept_left=0.0; 00065 itemvector[istrip].xtalk_chi2_left=0.0; 00066 cncrosstalk->crosstalk[id_layer]=itemvector; 00067 } 00068 00069 if(istrip==79){ 00070 itemvector[istrip].xtalk_slope_right=0.0; 00071 itemvector[istrip].xtalk_intercept_right=0.0; 00072 itemvector[istrip].xtalk_chi2_right=0.0; 00073 itemvector[istrip].xtalk_slope_left=-((double)rand()/((double)(RAND_MAX)+(double)(1)))/10000+mean; 00074 itemvector[istrip].xtalk_intercept_left=((double)rand()/((double)(RAND_MAX)+(double)(1)))/100+min; 00075 itemvector[istrip].xtalk_chi2_left=((double)rand()/((double)(RAND_MAX)+(double)(1)))+minchi; 00076 cncrosstalk->crosstalk[id_layer]=itemvector; 00077 } 00078 } 00079 } 00080 } 00081 } 00082 } 00083 } 00084 }
CSCFakeCrosstalkConditions::ReturnType CSCFakeCrosstalkConditions::produceCrosstalk | ( | const CSCcrosstalkRcd & | iRecord | ) |
Definition at line 113 of file CSCFakeCrosstalkConditions.cc.
References cncrosstalk.
Referenced by CSCFakeCrosstalkConditions().
00114 { 00115 return cncrosstalk; 00116 }
void CSCFakeCrosstalkConditions::setIntervalFor | ( | const edm::eventsetup::EventSetupRecordKey & | , | |
const edm::IOVSyncValue & | , | |||
edm::ValidityInterval & | oValidity | |||
) | [private, virtual] |
Implements edm::EventSetupRecordIntervalFinder.
Definition at line 118 of file CSCFakeCrosstalkConditions.cc.
References edm::IOVSyncValue::beginOfTime(), and edm::IOVSyncValue::endOfTime().
00120 { 00121 oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(),edm::IOVSyncValue::endOfTime()); 00122 00123 }
Definition at line 36 of file CSCFakeCrosstalkConditions.h.
Referenced by prefillCrosstalk(), produceCrosstalk(), and ~CSCFakeCrosstalkConditions().