CMS 3D CMS Logo

Public Member Functions | Public Attributes

RPCSimSetUp Class Reference

#include <RPCSimSetUp.h>

List of all members.

Public Member Functions

const std::vector< double > & getCls (uint32_t id)
const std::map< int,
std::vector< double > > & 
getClsMap ()
const std::vector< float > & getEff (uint32_t id)
const RPCGeometrygetGeometry ()
const std::vector< float > & getNoise (uint32_t id)
float getTime (uint32_t id)
 RPCSimSetUp (const edm::ParameterSet &ps)
void setGeometry (const RPCGeometry *geom)
 sets geometry
void setRPCSetUp (std::vector< RPCStripNoises::NoiseItem > vnoise, std::vector< RPCClusterSize::ClusterSizeItem > vClusterSize)
void setRPCSetUp (std::vector< RPCStripNoises::NoiseItem > vnoise, std::vector< float > vcls)
virtual ~RPCSimSetUp ()

Public Attributes

std::map< RPCDetId, float > _bxmap
std::map< int, std::vector
< double > > 
_clsMap
std::map< uint32_t,
std::vector< double > > 
_mapDetClsMap
std::map< uint32_t,
std::vector< float > > 
_mapDetIdEff
std::map< uint32_t,
std::vector< float > > 
_mapDetIdNoise
const RPCGeometrytheGeometry

Detailed Description

Definition at line 28 of file RPCSimSetUp.h.


Constructor & Destructor Documentation

RPCSimSetUp::RPCSimSetUp ( const edm::ParameterSet ps) [explicit]

Definition at line 37 of file RPCSimSetUp.cc.

                                                  {

  _mapDetIdNoise.clear();
  _mapDetIdEff.clear();
  _bxmap.clear();
  _clsMap.clear();

}
RPCSimSetUp::~RPCSimSetUp ( ) [virtual]

Definition at line 223 of file RPCSimSetUp.cc.

{}

Member Function Documentation

const std::vector< double > & RPCSimSetUp::getCls ( uint32_t  id)

Definition at line 208 of file RPCSimSetUp.cc.

References Exception.

Referenced by RPCSimAverageNoiseEffCls::getClSize().

{

  map<uint32_t,std::vector<double> >::iterator iter = _mapDetClsMap.find(id);
  if(iter == _mapDetClsMap.end()){
    throw cms::Exception("DataCorrupt") 
      << "Exception comming from RPCSimSetUp - no cluster size information for DetId\t"<<id<< std::endl;
  }
  if((iter->second).size() != 100){
    throw cms::Exception("DataCorrupt") 
      << "Exception comming from RPCSimSetUp - cluster size information in a wrong format for DetId\t"<<id<< std::endl;
  }
  return iter->second;
}
const std::map< int, std::vector< double > > & RPCSimSetUp::getClsMap ( )

Definition at line 197 of file RPCSimSetUp.cc.

References Exception.

Referenced by RPCSimAverageNoiseEff::getClSize(), RPCSimAverageNoiseEffCls::getClSize(), RPCSimAverageNoise::getClSize(), and RPCSimAverage::getClSize().

{
  if(_clsMap.size()!=5){
    throw cms::Exception("DataCorrupt") 
      << "Exception comming from RPCSimSetUp - cluster size - a wrong format "<< std::endl;
  }
  return _clsMap;
}
const std::vector< float > & RPCSimSetUp::getEff ( uint32_t  id)

Definition at line 172 of file RPCSimSetUp.cc.

References Exception.

{
  map<uint32_t,std::vector<float> >::iterator iter = _mapDetIdEff.find(id);
  if(iter == _mapDetIdEff.end()){
    throw cms::Exception("DataCorrupt") 
      << "Exception comming from RPCSimSetUp - no efficiency information for DetId\t"<<id<< std::endl;
  }
  if((iter->second).size() != 96){
    throw cms::Exception("DataCorrupt") 
      << "Exception comming from RPCSimSetUp - efficiency information in a wrong format for DetId\t"<<id<< std::endl;
  }
  return iter->second;
}
const RPCGeometry* RPCSimSetUp::getGeometry ( ) [inline]

Definition at line 48 of file RPCSimSetUp.h.

References theGeometry.

Referenced by RPCSynchronizer::getSimHitBx().

{ return theGeometry; }
const std::vector< float > & RPCSimSetUp::getNoise ( uint32_t  id)

Definition at line 162 of file RPCSimSetUp.cc.

References Exception.

{
  map<uint32_t,std::vector<float> >::iterator iter = _mapDetIdNoise.find(id);
  if(iter == _mapDetIdNoise.end()){
    throw cms::Exception("DataCorrupt") 
      << "Exception comming from RPCSimSetUp - no noise information for DetId\t"<<id<< std::endl;
  }
  return iter->second;
}
float RPCSimSetUp::getTime ( uint32_t  id)

Definition at line 186 of file RPCSimSetUp.cc.

References Exception, and DetId::rawId().

Referenced by RPCSynchronizer::getSimHitBx().

{
  RPCDetId rpcid(id);
  std::map<RPCDetId, float>::iterator iter = _bxmap.find(rpcid);
  if(iter == _bxmap.end()){
    throw cms::Exception("DataCorrupt") 
      << "Exception comming from RPCSimSetUp - no timing information for rpcid.rawId()\t"<<rpcid.rawId()<< std::endl;
  }
  return iter->second;
}
void RPCSimSetUp::setGeometry ( const RPCGeometry geom) [inline]

sets geometry

Definition at line 46 of file RPCSimSetUp.h.

References relativeConstraints::geom, and theGeometry.

Referenced by RPCDigiProducer::beginRun().

void RPCSimSetUp::setRPCSetUp ( std::vector< RPCStripNoises::NoiseItem vnoise,
std::vector< RPCClusterSize::ClusterSizeItem vClusterSize 
)

Definition at line 105 of file RPCSimSetUp.cc.

References n, RPCDetId, and cond::rpcobtemp::temp.

                                                                                                                             {

  std::vector<RPCClusterSize::ClusterSizeItem>::iterator itCls;
  uint32_t  detId;
  int clsCounter(1);
  std::vector<double> clsVect;

  for(itCls = vClusterSize.begin(); itCls != vClusterSize.end(); ++itCls){
    clsVect.push_back(((double)(itCls->clusterSize)));
    if((!(clsCounter%100)) && (clsCounter!=0)){
      detId=itCls->dpid;
      _mapDetClsMap[detId]=clsVect;
      clsVect.clear();
      clsCounter=0;
    }
    ++clsCounter;
  }

  unsigned int n = 0; 
  uint32_t temp = 0; 
  std::vector<float> veff, vvnoise;
  veff.clear();
  vvnoise.clear();

  for(std::vector<RPCStripNoises::NoiseItem>::iterator it = vnoise.begin(); it != vnoise.end(); ++it){
    if(n%96 == 0) {
      if(n > 0 ){
        _mapDetIdNoise[temp]= vvnoise;
        _mapDetIdEff[temp] = veff;
        _bxmap[RPCDetId(it->dpid)] = it->time;
        
        veff.clear();
        vvnoise.clear();
        vvnoise.push_back((it->noise));
        veff.push_back((it->eff));
      }
      else if(n == 0 ){
        vvnoise.push_back((it->noise));
        veff.push_back((it->eff));
        _bxmap[RPCDetId(it->dpid)] = it->time;
      }
    } else if (n == vnoise.size()-1 ){
      temp = it->dpid;
      vvnoise.push_back((it->noise));
      veff.push_back((it->eff));
      _mapDetIdNoise[temp]= vvnoise;
      _mapDetIdEff[temp] = veff;
    } else {
      temp = it->dpid;
      vvnoise.push_back((it->noise));
      veff.push_back((it->eff));
    }
    n++;
  }
}
void RPCSimSetUp::setRPCSetUp ( std::vector< RPCStripNoises::NoiseItem vnoise,
std::vector< float >  vcls 
)

Definition at line 46 of file RPCSimSetUp.cc.

References n, RPCDetId, and cond::rpcobtemp::temp.

Referenced by RPCDigiProducer::beginRun().

                                                                                             {

  double sum = 0;
  unsigned int counter = 1;
  unsigned int row = 1;
  std::vector<double> sum_clsize;

  for(unsigned int n = 0; n < vcls.size(); ++n){

    sum_clsize.push_back(vcls[n]);

    if(counter == row*20) {

      _clsMap[row] = sum_clsize;
      row++;
      sum = 0;
      sum_clsize.clear();
    }
    counter++;
  }

  unsigned int n = 0; 
  uint32_t temp = 0; 
  std::vector<float> veff, vvnoise;
  veff.clear();
  vvnoise.clear();

  for(std::vector<RPCStripNoises::NoiseItem>::iterator it = vnoise.begin(); it != vnoise.end(); ++it){
    if(n%96 == 0) {
      if(n > 0 ){
        _mapDetIdNoise[temp]= vvnoise;
        _mapDetIdEff[temp] = veff;
        _bxmap[RPCDetId(it->dpid)] = it->time;
        
        veff.clear();
        vvnoise.clear();
        vvnoise.push_back((it->noise));
        veff.push_back((it->eff));
      }
      else if(n == 0 ){
        vvnoise.push_back((it->noise));
        veff.push_back((it->eff));
        _bxmap[RPCDetId(it->dpid)] = it->time;
      }
    } else if (n == vnoise.size()-1 ){
      temp = it->dpid;
      vvnoise.push_back((it->noise));
      veff.push_back((it->eff));
      _mapDetIdNoise[temp]= vvnoise;
      _mapDetIdEff[temp] = veff;
    } else {
      temp = it->dpid;
      vvnoise.push_back((it->noise));
      veff.push_back((it->eff));
    }
    n++;
  }
}

Member Data Documentation

std::map<RPCDetId, float> RPCSimSetUp::_bxmap

Definition at line 54 of file RPCSimSetUp.h.

std::map< int, std::vector<double> > RPCSimSetUp::_clsMap

Definition at line 55 of file RPCSimSetUp.h.

std::map<uint32_t, std::vector<double> > RPCSimSetUp::_mapDetClsMap

Definition at line 56 of file RPCSimSetUp.h.

std::map<uint32_t, std::vector<float> > RPCSimSetUp::_mapDetIdEff

Definition at line 53 of file RPCSimSetUp.h.

std::map<uint32_t, std::vector<float> > RPCSimSetUp::_mapDetIdNoise

Definition at line 52 of file RPCSimSetUp.h.

Definition at line 50 of file RPCSimSetUp.h.

Referenced by getGeometry(), and setGeometry().