CMS 3D CMS Logo

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

CSCFakeDBGains Class Reference

#include <CSCFakeDBGains.h>

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

List of all members.

Public Types

typedef boost::shared_ptr
< CSCDBGains
Pointer

Public Member Functions

 CSCFakeDBGains (const edm::ParameterSet &)
Pointer produceDBGains (const CSCDBGainsRcd &)
 ~CSCFakeDBGains ()

Static Public Member Functions

static CSCDBGainsprefillDBGains ()

Private Member Functions

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

Private Attributes

Pointer cndbGains

Detailed Description

Definition at line 22 of file CSCFakeDBGains.h.


Member Typedef Documentation

typedef boost::shared_ptr<CSCDBGains> CSCFakeDBGains::Pointer

Definition at line 29 of file CSCFakeDBGains.h.


Constructor & Destructor Documentation

CSCFakeDBGains::CSCFakeDBGains ( const edm::ParameterSet iConfig)

Definition at line 6 of file CSCFakeDBGains.cc.

References cndbGains, prefillDBGains(), produceDBGains(), and edm::ESProducer::setWhatProduced().

{
  cndbGains = boost::shared_ptr<CSCDBGains>( prefillDBGains() );

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

Definition at line 17 of file CSCFakeDBGains.cc.

{
}

Member Function Documentation

CSCDBGains * CSCFakeDBGains::prefillDBGains ( ) [inline, static]

Definition at line 45 of file CSCFakeDBGains.h.

References CSCDBGains::factor_gain, CSCDBGains::gains, i, timingPdfMaker::mean, and min.

Referenced by CSCFakeDBGains().

{
  int seed;
  long int M;
  float mean,min, minchi;
  const int MAX_SIZE = 217728; //or 252288 for ME4/2 chambers
  const int FACTOR=1000;
  
  CSCDBGains* cndbgains = new CSCDBGains();
  cndbgains->gains.resize(MAX_SIZE);

  seed = 10000; 
  srand(seed);
  mean=6.8, min=-10.0, minchi=1.0, M=1000;
  cndbgains->factor_gain = int (FACTOR);
  
  for(int i=0; i<MAX_SIZE;i++){
    cndbgains->gains[i].gain_slope= (short int) (((double)rand()/((double)(RAND_MAX)+(double)(1)))+mean*FACTOR+0.5);
  }
  return cndbgains;
}  
CSCFakeDBGains::Pointer CSCFakeDBGains::produceDBGains ( const CSCDBGainsRcd iRecord)

Definition at line 23 of file CSCFakeDBGains.cc.

References cndbGains.

Referenced by CSCFakeDBGains().

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

Member Data Documentation

Definition at line 36 of file CSCFakeDBGains.h.

Referenced by CSCFakeDBGains(), and produceDBGains().