CMS 3D CMS Logo

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

CSCBadChambersConditions Class Reference

#include <CSCBadChambersConditions.h>

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

List of all members.

Public Types

typedef const CSCBadChambersReturnType

Public Member Functions

 CSCBadChambersConditions (const edm::ParameterSet &)
ReturnType produceBadChambers (const CSCBadChambersRcd &)
 ~CSCBadChambersConditions ()

Static Public Member Functions

static CSCBadChambersprefillBadChambers ()

Private Member Functions

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

Private Attributes

CSCBadChamberscndbBadChambers

Detailed Description

Definition at line 20 of file CSCBadChambersConditions.h.


Member Typedef Documentation

Definition at line 28 of file CSCBadChambersConditions.h.


Constructor & Destructor Documentation

CSCBadChambersConditions::CSCBadChambersConditions ( const edm::ParameterSet iConfig)

Definition at line 10 of file CSCBadChambersConditions.cc.

References cndbBadChambers, prefillBadChambers(), produceBadChambers(), and edm::ESProducer::setWhatProduced().

{
  //the following line is needed to tell the framework what
  // data is being produced
  cndbBadChambers = prefillBadChambers();
  setWhatProduced(this,&CSCBadChambersConditions::produceBadChambers);
  findingRecord<CSCBadChambersRcd>();
  //now do what ever other initialization is needed
}
CSCBadChambersConditions::~CSCBadChambersConditions ( )

Definition at line 21 of file CSCBadChambersConditions.cc.

References cndbBadChambers.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)
  delete cndbBadChambers;
}

Member Function Documentation

CSCBadChambers * CSCBadChambersConditions::prefillBadChambers ( ) [inline, static]

Definition at line 44 of file CSCBadChambersConditions.h.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, cmsRelvalreport::exit, and recoMuon::in.

Referenced by CSCBadChambersConditions().

{
  //  const int MAX_SIZE = 468;
  //cndbbadchambers = new CSCBadChambers();

  int new_chambers;
  std::vector<int> new_badchambers;
  int old_chamber = -1;
  int new_nrlines;
  new_nrlines=0;
 
  std::ifstream newdata;

  newdata.open("badchambers.dat",std::ios::in);
  if(!newdata) {
    std::cerr <<"Error: badchambers.dat -> no such file!"<< std::endl;
    exit(1);
  }

  while(!newdata.eof() ) {

    newdata >> new_chambers;
    if (new_chambers!=old_chamber){
    new_badchambers.push_back(new_chambers);
    std::cout<<new_chambers<<std::endl;  
    ++new_nrlines;
    }
    old_chamber = new_chambers;
  }
  newdata.close();

  CSCBadChambers * cndbbadchambers = new CSCBadChambers(new_nrlines, new_badchambers);  

  //std::cout <<"numberOfBadChambers "<<new_nrlines<<std::endl;

   return cndbbadchambers;
}
CSCBadChambersConditions::ReturnType CSCBadChambersConditions::produceBadChambers ( const CSCBadChambersRcd iRecord)

Definition at line 36 of file CSCBadChambersConditions.cc.

References cndbBadChambers.

Referenced by CSCBadChambersConditions().

{
  //need a new object so to not be deleted at exit
  CSCBadChambers* mydata=new CSCBadChambers( *cndbBadChambers );
  return mydata;
  
}
void CSCBadChambersConditions::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
) [private, virtual]

Member Data Documentation