![]() |
![]() |
#include <CalibMuon/CSCCalibration/interface/CSCBadWiresConditions.h>
Public Types | |
typedef const CSCBadWires * | ReturnType |
Public Member Functions | |
CSCBadWiresConditions (const edm::ParameterSet &) | |
ReturnType | produceBadWires (const CSCBadWiresRcd &) |
~CSCBadWiresConditions () | |
Static Public Member Functions | |
static CSCBadWires * | prefillBadWires () |
Private Member Functions | |
void | setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) |
Private Attributes | |
CSCBadWires * | cndbBadWires |
Definition at line 20 of file CSCBadWiresConditions.h.
typedef const CSCBadWires* CSCBadWiresConditions::ReturnType |
Definition at line 28 of file CSCBadWiresConditions.h.
CSCBadWiresConditions::CSCBadWiresConditions | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 10 of file CSCBadWiresConditions.cc.
References cndbBadWires, prefillBadWires(), produceBadWires(), and edm::ESProducer::setWhatProduced().
00011 { 00012 //the following line is needed to tell the framework what 00013 // data is being produced 00014 cndbBadWires = prefillBadWires(); 00015 setWhatProduced(this,&CSCBadWiresConditions::produceBadWires); 00016 findingRecord<CSCBadWiresRcd>(); 00017 //now do what ever other initialization is needed 00018 }
CSCBadWiresConditions::~CSCBadWiresConditions | ( | ) |
Definition at line 21 of file CSCBadWiresConditions.cc.
References cndbBadWires.
00022 { 00023 00024 // do anything here that needs to be done at desctruction time 00025 // (e.g. close files, deallocate resources etc.) 00026 delete cndbBadWires; 00027 }
CSCBadWires * CSCBadWiresConditions::prefillBadWires | ( | ) | [inline, static] |
Definition at line 44 of file CSCBadWiresConditions.h.
References TestMuL1L2Filter_cff::cerr, CSCBadWires::chambers, CSCBadWires::channels, lat::endl(), cmsRelvalreport::exit, i, in, and CSCBadWires::numberOfBadChannels.
Referenced by CSCBadWiresConditions().
00045 { 00046 CSCBadWires * cndbbadwires = new CSCBadWires(); 00047 bool bad=false; //use boolean to fill bad channels 00048 00049 int new_index; 00050 int new_layer,new_channel, new_flag1, new_cham,new_pointer; 00051 std::vector<int> new_index_id; 00052 std::vector<short int> new_layer_id; 00053 std::vector<short int> new_chan_id; 00054 std::vector<short int> new_flag_id; 00055 std::vector<int> new_cham_id; 00056 std::vector<int> new_point; 00057 00058 int new_nrlines=0; 00059 00060 std::ifstream newdata; 00061 newdata.open("badwires.dat",std::ios::in); 00062 if(!newdata) { 00063 std::cerr <<"Error: badwires.dat -> no such file!"<< std::endl; 00064 exit(1); 00065 } 00066 00067 while (!newdata.eof() ) { 00068 newdata >> new_index >> new_layer >> new_channel >> new_flag1 >> new_cham >> new_pointer; 00069 new_index_id.push_back(new_index); 00070 new_layer_id.push_back(new_layer); 00071 new_chan_id.push_back(new_channel); 00072 new_flag_id.push_back(new_flag1); 00073 new_cham_id.push_back(new_cham); 00074 new_point.push_back(new_pointer); 00075 new_nrlines++; 00076 } 00077 newdata.close(); 00078 00079 00080 CSCBadWires::BadChannelContainer & itemvector = cndbbadwires->channels; 00081 itemvector.resize(new_nrlines); 00082 CSCBadWires::BadChamberContainer & itemvector1 = cndbbadwires->chambers; 00083 itemvector1.resize(new_nrlines); 00084 cndbbadwires->numberOfBadChannels = new_nrlines; 00085 00086 if(new_index_id.empty()) bad=false; 00087 if(!new_index_id.empty()) bad=true; 00088 00089 for(unsigned int i=0; i<new_index_id.size();++i){ 00090 itemvector[i].layer = new_layer; 00091 itemvector[i].channel = new_channel; 00092 itemvector[i].flag1 = new_flag1; 00093 itemvector1[i].chamber_index = new_cham; 00094 itemvector1[i].pointer = new_pointer; 00095 itemvector1[i].bad_channels = new_index; 00096 } 00097 00098 return cndbbadwires; 00099 }
CSCBadWiresConditions::ReturnType CSCBadWiresConditions::produceBadWires | ( | const CSCBadWiresRcd & | iRecord | ) |
Definition at line 36 of file CSCBadWiresConditions.cc.
References cndbBadWires.
Referenced by CSCBadWiresConditions().
00037 { 00038 //need a new object so to not be deleted at exit 00039 CSCBadWires* mydata=new CSCBadWires( *cndbBadWires ); 00040 return mydata; 00041 00042 }
void CSCBadWiresConditions::setIntervalFor | ( | const edm::eventsetup::EventSetupRecordKey & | , | |
const edm::IOVSyncValue & | , | |||
edm::ValidityInterval & | oValidity | |||
) | [private, virtual] |
Implements edm::EventSetupRecordIntervalFinder.
Definition at line 44 of file CSCBadWiresConditions.cc.
References edm::IOVSyncValue::beginOfTime(), and edm::IOVSyncValue::endOfTime().
00046 { 00047 oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(),edm::IOVSyncValue::endOfTime()); 00048 00049 }
CSCBadWires* CSCBadWiresConditions::cndbBadWires [private] |
Definition at line 35 of file CSCBadWiresConditions.h.
Referenced by CSCBadWiresConditions(), produceBadWires(), and ~CSCBadWiresConditions().