CMS 3D CMS Logo

CSCFakePedestalsConditions Class Reference

#include <CalibMuon/CSCCalibration/interface/CSCFakePedestalsConditions.h>

Inheritance diagram for CSCFakePedestalsConditions:

edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Types

typedef const CSCPedestalsReturnType

Public Member Functions

 CSCFakePedestalsConditions (const edm::ParameterSet &)
void prefillPedestals ()
ReturnType producePedestals (const CSCPedestalsRcd &)
 ~CSCFakePedestalsConditions ()

Public Attributes

long int M
float meanped
float meanrms
int seed

Private Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)

Private Attributes

CSCPedestalscnpedestals


Detailed Description

Definition at line 20 of file CSCFakePedestalsConditions.h.


Member Typedef Documentation

typedef const CSCPedestals* CSCFakePedestalsConditions::ReturnType

Definition at line 30 of file CSCFakePedestalsConditions.h.


Constructor & Destructor Documentation

CSCFakePedestalsConditions::CSCFakePedestalsConditions ( const edm::ParameterSet iConfig  ) 

Definition at line 59 of file CSCFakePedestalsConditions.cc.

References prefillPedestals(), producePedestals(), and edm::ESProducer::setWhatProduced().

00060 {
00061   //the following line is needed to tell the framework what
00062   // data is being produced
00063   prefillPedestals();
00064   setWhatProduced(this,&CSCFakePedestalsConditions::producePedestals);
00065   findingRecord<CSCPedestalsRcd>();
00066   //now do what ever other initialization is needed
00067 }

CSCFakePedestalsConditions::~CSCFakePedestalsConditions (  ) 

Definition at line 70 of file CSCFakePedestalsConditions.cc.

References cnpedestals.

00071 {
00072  
00073    // do anything here that needs to be done at desctruction time
00074    // (e.g. close files, deallocate resources etc.)
00075   delete cnpedestals;
00076 }


Member Function Documentation

void CSCFakePedestalsConditions::prefillPedestals (  ) 

Definition at line 4 of file CSCFakePedestalsConditions.cc.

References cnpedestals, detId, M, CSCDetId::maxChamberId(), CSCDetId::maxEndcapId(), CSCDetId::maxLayerId(), CSCDetId::maxRingId(), CSCDetId::maxStationId(), meanped, meanrms, CSCDetId::minChamberId(), CSCDetId::minEndcapId(), CSCDetId::minLayerId(), CSCDetId::minRingId(), CSCDetId::minStationId(), CSCPedestals::pedestals, and seed.

Referenced by CSCFakePedestalsConditions().

00005 {
00006   const CSCDetId& detId = CSCDetId();
00007   cnpedestals = new CSCPedestals();
00008   
00009   int max_istrip,id_layer,max_ring,max_cham;
00010   seed = 10000; 
00011   srand(seed);
00012   meanped=600.0, meanrms=1.5, M=1000;
00013 
00014   //endcap=1 to 2,station=1 to 4, ring=1 to 4,chamber=1 to 36,layer=1 to 6 
00015   
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         
00038         for(int ichamber=detId.minChamberId(); ichamber<=max_cham; ichamber++){
00039           for(int ilayer=detId.minLayerId(); ilayer<=detId.maxLayerId(); ilayer++){
00040             //station 1 ring 3 has 64 strips per layer instead of 80 
00041             if(istation==1 && iring==3)   max_istrip=64;
00042             
00043             std::vector<CSCPedestals::Item> itemvector;
00044             itemvector.resize(max_istrip);
00045             id_layer = 100000*iendcap + 10000*istation + 1000*iring + 10*ichamber + ilayer;
00046             
00047             for(int istrip=0;istrip<max_istrip;istrip++){
00048               itemvector[istrip].ped=((double)rand()/((double)(RAND_MAX)+(double)(1)))*100+meanped;
00049               itemvector[istrip].rms=((double)rand()/((double)(RAND_MAX)+(double)(1)))+meanrms;
00050               cnpedestals->pedestals[id_layer]=itemvector;
00051             }
00052           }
00053         }
00054       }
00055     }
00056   }
00057 }  

CSCFakePedestalsConditions::ReturnType CSCFakePedestalsConditions::producePedestals ( const CSCPedestalsRcd iRecord  ) 

Definition at line 85 of file CSCFakePedestalsConditions.cc.

References cnpedestals.

Referenced by CSCFakePedestalsConditions().

00086 {
00087   return cnpedestals;
00088 }

void CSCFakePedestalsConditions::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
) [private, virtual]

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 90 of file CSCFakePedestalsConditions.cc.

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


Member Data Documentation

CSCPedestals* CSCFakePedestalsConditions::cnpedestals [private]

Definition at line 37 of file CSCFakePedestalsConditions.h.

Referenced by prefillPedestals(), producePedestals(), and ~CSCFakePedestalsConditions().

long int CSCFakePedestalsConditions::M

Definition at line 26 of file CSCFakePedestalsConditions.h.

Referenced by prefillPedestals().

float CSCFakePedestalsConditions::meanped

Definition at line 25 of file CSCFakePedestalsConditions.h.

Referenced by prefillPedestals().

float CSCFakePedestalsConditions::meanrms

Definition at line 25 of file CSCFakePedestalsConditions.h.

Referenced by prefillPedestals().

int CSCFakePedestalsConditions::seed

Definition at line 26 of file CSCFakePedestalsConditions.h.

Referenced by prefillPedestals().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:18 2009 for CMSSW by  doxygen 1.5.4