CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

CSCFakeDBPedestals Class Reference

#include <CSCFakeDBPedestals.h>

Inheritance diagram for CSCFakeDBPedestals:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Types

typedef boost::shared_ptr
< CSCDBPedestals
Pointer

Public Member Functions

 CSCFakeDBPedestals (const edm::ParameterSet &)
Pointer produceDBPedestals (const CSCDBPedestalsRcd &)
 ~CSCFakeDBPedestals ()

Static Public Member Functions

static CSCDBPedestalsprefillDBPedestals ()

Private Member Functions

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

Private Attributes

Pointer cndbPedestals

Detailed Description

Definition at line 21 of file CSCFakeDBPedestals.h.


Member Typedef Documentation

typedef boost::shared_ptr<CSCDBPedestals> CSCFakeDBPedestals::Pointer

Definition at line 28 of file CSCFakeDBPedestals.h.


Constructor & Destructor Documentation

CSCFakeDBPedestals::CSCFakeDBPedestals ( const edm::ParameterSet iConfig)

Definition at line 6 of file CSCFakeDBPedestals.cc.

References cndbPedestals, prefillDBPedestals(), produceDBPedestals(), and edm::ESProducer::setWhatProduced().

{
  cndbPedestals = boost::shared_ptr<CSCDBPedestals> ( prefillDBPedestals() );

  //the following line is needed to tell the framework what
  // data is being produced
  setWhatProduced(this,&CSCFakeDBPedestals::produceDBPedestals);
  findingRecord<CSCDBPedestalsRcd>();
}
CSCFakeDBPedestals::~CSCFakeDBPedestals ( )

Definition at line 17 of file CSCFakeDBPedestals.cc.

{
}

Member Function Documentation

CSCDBPedestals * CSCFakeDBPedestals::prefillDBPedestals ( ) [inline, static]

Definition at line 44 of file CSCFakeDBPedestals.h.

References CSCDBPedestals::factor_ped, CSCDBPedestals::factor_rms, i, and CSCDBPedestals::pedestals.

Referenced by CSCFakeDBPedestals().

{
  int seed;
  long int M;
  float meanped,meanrms;
  const int MAX_SIZE = 217728; //or 252288 for ME4/2 chambers
  const int PED_FACTOR=10;
  const int RMS_FACTOR=1000;
 
  CSCDBPedestals * cndbpedestals = new CSCDBPedestals();
  cndbpedestals->pedestals.resize(MAX_SIZE);

  seed = 10000; 
  srand(seed);
  meanped=600.0, meanrms=1.5, M=1000;
  cndbpedestals->factor_ped = int (PED_FACTOR);
  cndbpedestals->factor_rms = int (RMS_FACTOR);
 
  for(int i=0; i<MAX_SIZE;i++){
    cndbpedestals->pedestals[i].ped=(short int) (((double)rand()/((double)(RAND_MAX)+(double)(1)))*100+meanped*PED_FACTOR+0.5);
    cndbpedestals->pedestals[i].rms= (short int) (((double)rand()/((double)(RAND_MAX)+(double)(1)))+meanrms*RMS_FACTOR+0.5);
  }
  return cndbpedestals;
}  
CSCFakeDBPedestals::Pointer CSCFakeDBPedestals::produceDBPedestals ( const CSCDBPedestalsRcd iRecord)

Definition at line 23 of file CSCFakeDBPedestals.cc.

References cndbPedestals.

Referenced by CSCFakeDBPedestals().

{
  return cndbPedestals;
}
void CSCFakeDBPedestals::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
) [private, virtual]

Member Data Documentation

Definition at line 36 of file CSCFakeDBPedestals.h.

Referenced by CSCFakeDBPedestals(), and produceDBPedestals().