#include <DQM/SiPixelMonitorRawData/interface/SiPixelRawDataErrorSource.h>
Public Types | |
typedef edm::DetSet < SiPixelRawDataError > ::const_iterator | ErrorIterator |
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (edm::EventSetup const &) |
virtual void | bookMEs () |
virtual void | buildStructure (edm::EventSetup const &) |
virtual void | endJob () |
SiPixelRawDataErrorSource (const edm::ParameterSet &conf) | |
~SiPixelRawDataErrorSource () | |
Private Attributes | |
bool | bladeOn |
edm::ParameterSet | conf_ |
bool | diskOn |
int | eventNo |
bool | isPIB |
bool | ladOn |
bool | layOn |
bool | modOn |
bool | phiOn |
bool | reducedSet |
bool | ringOn |
bool | saveFile |
bool | slowDown |
edm::InputTag | src_ |
DQMStore * | theDMBE |
std::map< uint32_t, SiPixelRawDataErrorModule * > | theFEDStructure |
std::map< uint32_t, SiPixelRawDataErrorModule * > | thePixelStructure |
Usage: Takes a DetSetVector<SiPixelRawDataError> as input, and uses it to populate a folder hierarchy (organized by detId) with histograms containing information about the errors. Uses SiPixelRawDataErrorModule class to book and fill individual folders. Note that this source is different than other DQM sources in the creation of an unphysical detId folder (detId=0xffffffff) to hold information about errors for which there is no detId available (except the dummy detId given to it at raw2digi).
Definition at line 53 of file SiPixelRawDataErrorSource.h.
typedef edm::DetSet<SiPixelRawDataError>::const_iterator SiPixelRawDataErrorSource::ErrorIterator |
Definition at line 58 of file SiPixelRawDataErrorSource.h.
SiPixelRawDataErrorSource::SiPixelRawDataErrorSource | ( | const edm::ParameterSet & | conf | ) | [explicit] |
Definition at line 49 of file SiPixelRawDataErrorSource.cc.
References lat::endl(), and theDMBE.
00049 : 00050 conf_(iConfig), 00051 src_( conf_.getParameter<edm::InputTag>( "src" ) ), 00052 isPIB( conf_.getUntrackedParameter<bool>("isPIB",false) ), 00053 saveFile( conf_.getUntrackedParameter<bool>("saveFile",false) ), 00054 slowDown( conf_.getUntrackedParameter<bool>("slowDown",false) ), 00055 reducedSet( conf_.getUntrackedParameter<bool>("reducedSet",false) ), 00056 modOn( conf_.getUntrackedParameter<bool>("modOn",true) ), 00057 ladOn( conf_.getUntrackedParameter<bool>("ladOn",false) ), 00058 layOn( conf_.getUntrackedParameter<bool>("layOn",false) ), 00059 phiOn( conf_.getUntrackedParameter<bool>("phiOn",false) ), 00060 ringOn( conf_.getUntrackedParameter<bool>("ringOn",false) ), 00061 bladeOn( conf_.getUntrackedParameter<bool>("bladeOn",false) ), 00062 diskOn( conf_.getUntrackedParameter<bool>("diskOn",false) ) 00063 { 00064 theDMBE = edm::Service<DQMStore>().operator->(); 00065 LogInfo ("PixelDQM") << "SiPixelRawDataErrorSource::SiPixelRawDataErrorSource: Got DQM BackEnd interface"<<endl; 00066 }
SiPixelRawDataErrorSource::~SiPixelRawDataErrorSource | ( | ) |
Definition at line 69 of file SiPixelRawDataErrorSource.cc.
References lat::endl().
00070 { 00071 // do anything here that needs to be done at desctruction time 00072 // (e.g. close files, deallocate resources etc.) 00073 LogInfo ("PixelDQM") << "SiPixelRawDataErrorSource::~SiPixelRawDataErrorSource: Destructor"<<endl; 00074 }
void SiPixelRawDataErrorSource::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 108 of file SiPixelRawDataErrorSource.cc.
References bladeOn, diskOn, eventNo, edm::Event::getByLabel(), iggi_31X_cfg::input, edm::Handle< T >::isValid(), ladOn, layOn, modOn, phiOn, reducedSet, ringOn, slowDown, src_, theFEDStructure, and thePixelStructure.
00109 { 00110 eventNo++; 00111 00112 // get input data 00113 edm::Handle< edm::DetSetVector<SiPixelRawDataError> > input; 00114 iEvent.getByLabel( src_, input ); 00115 if (!input.isValid()) return; 00116 00117 00118 std::map<uint32_t,SiPixelRawDataErrorModule*>::iterator struct_iter; 00119 std::map<uint32_t,SiPixelRawDataErrorModule*>::iterator struct_iter2; 00120 00121 for (struct_iter = thePixelStructure.begin() ; struct_iter != thePixelStructure.end() ; struct_iter++) { 00122 00123 (*struct_iter).second->fill(*input, reducedSet, modOn, ladOn, layOn, phiOn, bladeOn, diskOn, ringOn); 00124 00125 } 00126 00127 for (struct_iter2 = theFEDStructure.begin() ; struct_iter2 != theFEDStructure.end() ; struct_iter2++) { 00128 00129 (*struct_iter2).second->fillFED(*input); 00130 00131 } 00132 00133 // slow down... 00134 if(slowDown) usleep(100000); 00135 00136 }
void SiPixelRawDataErrorSource::beginJob | ( | edm::EventSetup const & | iSetup | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 77 of file SiPixelRawDataErrorSource.cc.
References bladeOn, bookMEs(), buildStructure(), diskOn, lat::endl(), eventNo, ladOn, layOn, modOn, phiOn, and ringOn.
00077 { 00078 00079 LogInfo ("PixelDQM") << " SiPixelRawDataErrorSource::beginJob - Initialisation ... " << std::endl; 00080 LogInfo ("PixelDQM") << "Mod/Lad/Lay/Phi " << modOn << "/" << ladOn << "/" 00081 << layOn << "/" << phiOn << std::endl; 00082 LogInfo ("PixelDQM") << "Blade/Disk/Ring" << bladeOn << "/" << diskOn << "/" 00083 << ringOn << std::endl; 00084 00085 eventNo = 0; 00086 // Build map 00087 buildStructure(iSetup); 00088 // Book Monitoring Elements 00089 bookMEs(); 00090 00091 }
void SiPixelRawDataErrorSource::bookMEs | ( | ) | [virtual] |
Create folder tree and book histograms
Create folder tree for errors without detId and book histograms
Definition at line 214 of file SiPixelRawDataErrorSource.cc.
References bladeOn, conf_, diskOn, Exception, isPIB, ladOn, layOn, LogDebug, modOn, phiOn, reducedSet, ringOn, SiPixelFolderOrganizer::setFedFolder(), SiPixelFolderOrganizer::setModuleFolder(), DQMStore::setVerbose(), theDMBE, theFEDStructure, and thePixelStructure.
Referenced by beginJob().
00214 { 00215 00216 std::map<uint32_t,SiPixelRawDataErrorModule*>::iterator struct_iter; 00217 std::map<uint32_t,SiPixelRawDataErrorModule*>::iterator struct_iter2; 00218 theDMBE->setVerbose(0); 00219 00220 SiPixelFolderOrganizer theSiPixelFolder; 00221 00222 for(struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++){ 00224 00225 if(modOn){ 00226 if(theSiPixelFolder.setModuleFolder((*struct_iter).first)) { 00227 (*struct_iter).second->book( conf_, reducedSet, 0 ); 00228 } 00229 else { 00230 //std::cout<<"PIB! not booking histograms for non-PIB modules!"<<std::endl; 00231 if(!isPIB) throw cms::Exception("LogicError") 00232 << "[SiPixelRawDataErrorSource::bookMEs] Creation of DQM folder failed"; 00233 } 00234 } 00235 00236 if(ladOn){ 00237 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,1)) { 00238 (*struct_iter).second->book( conf_, reducedSet, 1 ); 00239 } 00240 else { 00241 LogDebug ("PixelDQM") << "PROBLEM WITH LADDER-FOLDER\n"; 00242 } 00243 } 00244 00245 if(layOn){ 00246 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,2)) { 00247 (*struct_iter).second->book( conf_, reducedSet, 2 ); 00248 } 00249 else { 00250 LogDebug ("PixelDQM") << "PROBLEM WITH LAYER-FOLDER\n"; 00251 } 00252 } 00253 00254 if(phiOn){ 00255 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,3)) { 00256 (*struct_iter).second->book( conf_, reducedSet, 3 ); 00257 } 00258 else { 00259 LogDebug ("PixelDQM") << "PROBLEM WITH PHI-FOLDER\n"; 00260 } 00261 } 00262 00263 if(bladeOn){ 00264 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,4)) { 00265 (*struct_iter).second->book( conf_, reducedSet, 4 ); 00266 } 00267 else { 00268 LogDebug ("PixelDQM") << "PROBLEM WITH BLADE-FOLDER\n"; 00269 } 00270 } 00271 00272 if(diskOn){ 00273 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,5)) { 00274 (*struct_iter).second->book( conf_, reducedSet, 5 ); 00275 } 00276 else { 00277 LogDebug ("PixelDQM") << "PROBLEM WITH DISK-FOLDER\n"; 00278 } 00279 } 00280 00281 if(ringOn){ 00282 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,6)) { 00283 (*struct_iter).second->book( conf_, reducedSet, 6 ); 00284 } 00285 else { 00286 LogDebug ("PixelDQM") << "PROBLEM WITH RING-FOLDER\n"; 00287 } 00288 } 00289 00290 }//for loop 00291 00292 for(struct_iter2 = theFEDStructure.begin(); struct_iter2 != theFEDStructure.end(); struct_iter2++){ 00294 if(theSiPixelFolder.setFedFolder((*struct_iter2).first)) { 00295 (*struct_iter2).second->bookFED( conf_ ); 00296 } 00297 else { 00298 throw cms::Exception("LogicError") 00299 << "[SiPixelRawDataErrorSource::bookMEs] Creation of DQM folder failed"; 00300 } 00301 00302 } 00303 00304 }
void SiPixelRawDataErrorSource::buildStructure | ( | edm::EventSetup const & | iSetup | ) | [virtual] |
Definition at line 141 of file SiPixelRawDataErrorSource.cc.
References DetId::DetId(), detId, muonGeometry::disk, lat::endl(), edm::EventSetup::get(), FEDNumbering::getSiPixelFEDIds(), isPIB, it, LogDebug, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapName::PixelEndcapName(), DetId::rawId(), PixelGeomDetUnit::specificTopology(), DetId::subdetId(), theFEDStructure, and thePixelStructure.
Referenced by beginJob().
00141 { 00142 00143 LogInfo ("PixelDQM") <<" SiPixelRawDataErrorSource::buildStructure" ; 00144 edm::ESHandle<TrackerGeometry> pDD; 00145 iSetup.get<TrackerDigiGeometryRecord>().get( pDD ); 00146 00147 LogVerbatim ("PixelDQM") << " *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl; 00148 LogVerbatim ("PixelDQM") << " *** I have " << pDD->dets().size() <<" detectors"<<std::endl; 00149 LogVerbatim ("PixelDQM") << " *** I have " << pDD->detTypes().size() <<" types"<<std::endl; 00150 00151 for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){ 00152 00153 if(dynamic_cast<PixelGeomDetUnit*>((*it))!=0){ 00154 00155 DetId detId = (*it)->geographicalId(); 00156 const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId ); 00157 const PixelGeomDetUnit * pixDet = dynamic_cast<const PixelGeomDetUnit*>(geoUnit); 00158 int nrows = (pixDet->specificTopology()).nrows(); 00159 int ncols = (pixDet->specificTopology()).ncolumns(); 00160 00161 if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) { 00162 if(isPIB) continue; 00163 LogDebug ("PixelDQM") << " ---> Adding Barrel Module " << detId.rawId() << endl; 00164 uint32_t id = detId(); 00165 SiPixelRawDataErrorModule* theModule = new SiPixelRawDataErrorModule(id, ncols, nrows); 00166 thePixelStructure.insert(pair<uint32_t,SiPixelRawDataErrorModule*> (id,theModule)); 00167 00168 } else if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) { 00169 LogDebug ("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl; 00170 uint32_t id = detId(); 00171 SiPixelRawDataErrorModule* theModule = new SiPixelRawDataErrorModule(id, ncols, nrows); 00172 00173 PixelEndcapName::HalfCylinder side = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).halfCylinder(); 00174 int disk = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).diskName(); 00175 int blade = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).bladeName(); 00176 int panel = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).pannelName(); 00177 int module = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).plaquetteName(); 00178 00179 char sside[80]; sprintf(sside, "HalfCylinder_%i",side); 00180 char sdisk[80]; sprintf(sdisk, "Disk_%i",disk); 00181 char sblade[80]; sprintf(sblade, "Blade_%02i",blade); 00182 char spanel[80]; sprintf(spanel, "Panel_%i",panel); 00183 char smodule[80];sprintf(smodule,"Module_%i",module); 00184 std::string side_str = sside; 00185 std::string disk_str = sdisk; 00186 bool mask = side_str.find("HalfCylinder_1")!=string::npos|| 00187 side_str.find("HalfCylinder_2")!=string::npos|| 00188 side_str.find("HalfCylinder_4")!=string::npos|| 00189 disk_str.find("Disk_2")!=string::npos; 00190 // clutch to take all of FPIX, but no BPIX: 00191 mask = false; 00192 if(isPIB && mask) continue; 00193 00194 thePixelStructure.insert(pair<uint32_t,SiPixelRawDataErrorModule*> (id,theModule)); 00195 } 00196 } 00197 } 00198 LogDebug ("PixelDQM") << " ---> Adding Module for Additional Errors " << endl; 00199 FEDNumbering fednum; 00200 pair<int,int> fedIds = fednum.getSiPixelFEDIds(); 00201 fedIds.first = 0; 00202 fedIds.second = 39; 00203 for (int fedId = fedIds.first; fedId <= fedIds.second; fedId++) { 00204 uint32_t id = static_cast<uint32_t> (fedId); 00205 SiPixelRawDataErrorModule* theModule = new SiPixelRawDataErrorModule(id); 00206 theFEDStructure.insert(pair<uint32_t,SiPixelRawDataErrorModule*> (id,theModule)); 00207 } 00208 00209 LogInfo ("PixelDQM") << " *** Pixel Structure Size " << thePixelStructure.size() << endl; 00210 }
Reimplemented from edm::EDAnalyzer.
Definition at line 94 of file SiPixelRawDataErrorSource.cc.
References conf_, lat::endl(), edm::ParameterSet::getParameter(), DQMStore::save(), saveFile, and theDMBE.
00094 { 00095 00096 if(saveFile) { 00097 LogInfo ("PixelDQM") << " SiPixelRawDataErrorSource::endJob - Saving Root File " << std::endl; 00098 std::string outputFile = conf_.getParameter<std::string>("outputFile"); 00099 theDMBE->save( outputFile.c_str() ); 00100 } 00101 00102 }
bool SiPixelRawDataErrorSource::bladeOn [private] |
Definition at line 78 of file SiPixelRawDataErrorSource.h.
Referenced by analyze(), beginJob(), and bookMEs().
bool SiPixelRawDataErrorSource::diskOn [private] |
Definition at line 78 of file SiPixelRawDataErrorSource.h.
Referenced by analyze(), beginJob(), and bookMEs().
int SiPixelRawDataErrorSource::eventNo [private] |
bool SiPixelRawDataErrorSource::isPIB [private] |
Definition at line 71 of file SiPixelRawDataErrorSource.h.
Referenced by bookMEs(), and buildStructure().
bool SiPixelRawDataErrorSource::ladOn [private] |
Definition at line 76 of file SiPixelRawDataErrorSource.h.
Referenced by analyze(), beginJob(), and bookMEs().
bool SiPixelRawDataErrorSource::layOn [private] |
Definition at line 76 of file SiPixelRawDataErrorSource.h.
Referenced by analyze(), beginJob(), and bookMEs().
bool SiPixelRawDataErrorSource::modOn [private] |
Definition at line 74 of file SiPixelRawDataErrorSource.h.
Referenced by analyze(), beginJob(), and bookMEs().
bool SiPixelRawDataErrorSource::phiOn [private] |
Definition at line 76 of file SiPixelRawDataErrorSource.h.
Referenced by analyze(), beginJob(), and bookMEs().
bool SiPixelRawDataErrorSource::reducedSet [private] |
bool SiPixelRawDataErrorSource::ringOn [private] |
Definition at line 78 of file SiPixelRawDataErrorSource.h.
Referenced by analyze(), beginJob(), and bookMEs().
bool SiPixelRawDataErrorSource::saveFile [private] |
bool SiPixelRawDataErrorSource::slowDown [private] |
edm::InputTag SiPixelRawDataErrorSource::src_ [private] |
DQMStore* SiPixelRawDataErrorSource::theDMBE [private] |
Definition at line 80 of file SiPixelRawDataErrorSource.h.
Referenced by bookMEs(), endJob(), and SiPixelRawDataErrorSource().
std::map<uint32_t,SiPixelRawDataErrorModule*> SiPixelRawDataErrorSource::theFEDStructure [private] |
Definition at line 82 of file SiPixelRawDataErrorSource.h.
Referenced by analyze(), bookMEs(), and buildStructure().
std::map<uint32_t,SiPixelRawDataErrorModule*> SiPixelRawDataErrorSource::thePixelStructure [private] |
Definition at line 81 of file SiPixelRawDataErrorSource.h.
Referenced by analyze(), bookMEs(), and buildStructure().