#include <CalibMuon/CSCCalibration/interface/CSCFakeGainsConditions.h>
Public Types | |
typedef const CSCGains * | ReturnType |
Public Member Functions | |
CSCFakeGainsConditions (const edm::ParameterSet &) | |
void | prefillGains () |
ReturnType | produceGains (const CSCGainsRcd &) |
~CSCFakeGainsConditions () | |
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 | |
CSCGains * | cngains |
Definition at line 20 of file CSCFakeGainsConditions.h.
typedef const CSCGains* CSCFakeGainsConditions::ReturnType |
Definition at line 30 of file CSCFakeGainsConditions.h.
CSCFakeGainsConditions::CSCFakeGainsConditions | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 64 of file CSCFakeGainsConditions.cc.
References prefillGains(), produceGains(), and edm::ESProducer::setWhatProduced().
00065 { 00066 //the following line is needed to tell the framework what 00067 // data is being produced 00068 prefillGains(); 00069 setWhatProduced(this,&CSCFakeGainsConditions::produceGains); 00070 findingRecord<CSCGainsRcd>(); 00071 //now do what ever other initialization is needed 00072 }
CSCFakeGainsConditions::~CSCFakeGainsConditions | ( | ) |
Definition at line 75 of file CSCFakeGainsConditions.cc.
References cngains.
00076 { 00077 00078 // do anything here that needs to be done at desctruction time 00079 // (e.g. close files, deallocate resources etc.) 00080 delete cngains; 00081 }
void CSCFakeGainsConditions::prefillGains | ( | ) |
Definition at line 4 of file CSCFakeGainsConditions.cc.
References cngains, detId, CSCGains::gains, 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 CSCFakeGainsConditions().
00005 { 00006 cngains = new CSCGains(); 00007 const CSCDetId& detId = CSCDetId(); 00008 00009 int max_istrip,id_layer,max_ring,max_cham; 00010 seed = 10000; 00011 srand(seed); 00012 mean=6.8, min=-10.0, minchi=1.0, M=1000; 00013 00014 00015 //endcap=1 to 2,station=1 to 4, ring=1 to 4,chamber=1 to 36,layer=1 to 6 00016 00017 for(int iendcap=detId.minEndcapId(); iendcap<=detId.maxEndcapId(); iendcap++){ 00018 for(int istation=detId.minStationId() ; istation<=detId.maxStationId(); istation++){ 00019 max_ring=detId.maxRingId(); 00020 //station 4 ring 4 not there(36 chambers*2 missing) 00021 //3 rings max this way of counting (ME1a & b) 00022 if(istation==1) max_ring=3; 00023 if(istation==2) max_ring=2; 00024 if(istation==3) max_ring=2; 00025 if(istation==4) max_ring=1; 00026 00027 for(int iring=detId.minRingId(); iring<=max_ring; iring++){ 00028 max_istrip=80; 00029 max_cham=detId.maxChamberId(); 00030 if(istation==1 && iring==1) max_cham=36; 00031 if(istation==1 && iring==2) max_cham=36; 00032 if(istation==1 && iring==3) max_cham=36; 00033 if(istation==2 && iring==1) max_cham=18; 00034 if(istation==2 && iring==2) max_cham=36; 00035 if(istation==3 && iring==1) max_cham=18; 00036 if(istation==3 && iring==2) max_cham=36; 00037 if(istation==4 && iring==1) max_cham=18; 00038 00039 for(int ichamber=detId.minChamberId(); ichamber<=max_cham; ichamber++){ 00040 for(int ilayer=detId.minLayerId(); ilayer<=detId.maxLayerId(); ilayer++){ 00041 //station 1 ring 3 has 64 strips per layer instead of 80 00042 if(istation==1 && iring==3) max_istrip=64; 00043 00044 std::vector<CSCGains::Item> itemvector; 00045 itemvector.resize(max_istrip); 00046 id_layer = 100000*iendcap + 10000*istation + 1000*iring + 10*ichamber + ilayer; 00047 00048 for(int istrip=0;istrip<max_istrip;istrip++){ 00049 //itemvector[istrip].gain_slope = 7.55; 00050 //itemvector[istrip].gain_intercept= -10.00; 00051 //itemvector[istrip].gain_chi2 = 2.00; 00052 itemvector[istrip].gain_slope=((double)rand()/((double)(RAND_MAX)+(double)(1)))+mean; 00053 itemvector[istrip].gain_intercept=((double)rand()/((double)(RAND_MAX)+(double)(1)))+min; 00054 itemvector[istrip].gain_chi2=((double)rand()/((double)(RAND_MAX)+(double)(1)))+minchi; 00055 cngains->gains[id_layer]=itemvector; 00056 } 00057 } 00058 } 00059 } 00060 } 00061 } 00062 }
CSCFakeGainsConditions::ReturnType CSCFakeGainsConditions::produceGains | ( | const CSCGainsRcd & | iRecord | ) |
Definition at line 90 of file CSCFakeGainsConditions.cc.
References cngains.
Referenced by CSCFakeGainsConditions().
00091 { 00092 return cngains; 00093 }
void CSCFakeGainsConditions::setIntervalFor | ( | const edm::eventsetup::EventSetupRecordKey & | , | |
const edm::IOVSyncValue & | , | |||
edm::ValidityInterval & | oValidity | |||
) | [private, virtual] |
Implements edm::EventSetupRecordIntervalFinder.
Definition at line 95 of file CSCFakeGainsConditions.cc.
References edm::IOVSyncValue::beginOfTime(), and edm::IOVSyncValue::endOfTime().
00097 { 00098 oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(),edm::IOVSyncValue::endOfTime()); 00099 00100 }
CSCGains* CSCFakeGainsConditions::cngains [private] |
Definition at line 37 of file CSCFakeGainsConditions.h.
Referenced by prefillGains(), produceGains(), and ~CSCFakeGainsConditions().