CMS 3D CMS Logo

SiPixelDigiSource Class Reference

Description: <one line="" class="" summary>="">. More...

#include <DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h>

Inheritance diagram for SiPixelDigiSource:

edm::EDAnalyzer

List of all members.

Public Types

typedef edm::DetSet< PixelDigi >
::const_iterator 
DigiIterator

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 ()
 SiPixelDigiSource (const edm::ParameterSet &conf)
 ~SiPixelDigiSource ()

Private Attributes

bool bladeOn
edm::ParameterSet conf_
bool diskOn
int eventNo
bool hiRes
bool isPIB
bool ladOn
bool layOn
bool modOn
bool phiOn
bool ringOn
bool saveFile
bool slowDown
edm::InputTag src_
DQMStoretheDMBE
std::map< uint32_t,
SiPixelDigiModule * > 
thePixelStructure
bool twoDimOn


Detailed Description

Description: <one line="" class="" summary>="">.

Usage: <usage>

Definition at line 49 of file SiPixelDigiSource.h.


Member Typedef Documentation

typedef edm::DetSet<PixelDigi>::const_iterator SiPixelDigiSource::DigiIterator

Definition at line 54 of file SiPixelDigiSource.h.


Constructor & Destructor Documentation

SiPixelDigiSource::SiPixelDigiSource ( const edm::ParameterSet conf  )  [explicit]

Definition at line 43 of file SiPixelDigiSource.cc.

References lat::endl(), and theDMBE.

00043                                                                    :
00044   conf_(iConfig),
00045   src_( conf_.getParameter<edm::InputTag>( "src" ) ),
00046   saveFile( conf_.getUntrackedParameter<bool>("saveFile",false) ),
00047   isPIB( conf_.getUntrackedParameter<bool>("isPIB",false) ),
00048   slowDown( conf_.getUntrackedParameter<bool>("slowDown",false) ),
00049   modOn( conf_.getUntrackedParameter<bool>("modOn",true) ),
00050   twoDimOn( conf_.getUntrackedParameter<bool>("twoDimOn",true) ),
00051   hiRes( conf_.getUntrackedParameter<bool>("hiRes",false) ),
00052   ladOn( conf_.getUntrackedParameter<bool>("ladOn",false) ), 
00053   layOn( conf_.getUntrackedParameter<bool>("layOn",false) ), 
00054   phiOn( conf_.getUntrackedParameter<bool>("phiOn",false) ), 
00055   ringOn( conf_.getUntrackedParameter<bool>("ringOn",false) ), 
00056   bladeOn( conf_.getUntrackedParameter<bool>("bladeOn",false) ), 
00057   diskOn( conf_.getUntrackedParameter<bool>("diskOn",false) )
00058 {
00059    theDMBE = edm::Service<DQMStore>().operator->();
00060    LogInfo ("PixelDQM") << "SiPixelDigiSource::SiPixelDigiSource: Got DQM BackEnd interface"<<endl;
00061 }

SiPixelDigiSource::~SiPixelDigiSource (  ) 

Definition at line 64 of file SiPixelDigiSource.cc.

References lat::endl().

00065 {
00066    // do anything here that needs to be done at desctruction time
00067    // (e.g. close files, deallocate resources etc.)
00068   LogInfo ("PixelDQM") << "SiPixelDigiSource::~SiPixelDigiSource: Destructor"<<endl;
00069 }


Member Function Documentation

void SiPixelDigiSource::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 105 of file SiPixelDigiSource.cc.

References bladeOn, diskOn, eventNo, edm::Event::getByLabel(), iggi_31X_cfg::input, edm::Handle< T >::isValid(), ladOn, layOn, modOn, phiOn, ringOn, slowDown, src_, thePixelStructure, and twoDimOn.

00106 {
00107   eventNo++;
00108 
00109   // get input data
00110   edm::Handle< edm::DetSetVector<PixelDigi> >  input;
00111   iEvent.getByLabel( src_, input );
00112   if (!input.isValid()) return; 
00113    
00114   std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
00115   for (struct_iter = thePixelStructure.begin() ; struct_iter != thePixelStructure.end() ; struct_iter++) {
00116     
00117     (*struct_iter).second->fill(*input, modOn, ladOn, layOn, phiOn, bladeOn, diskOn, ringOn,twoDimOn);
00118     
00119   }
00120 
00121   // slow down...
00122   if(slowDown) usleep(10000);
00123   
00124 }

void SiPixelDigiSource::beginJob ( edm::EventSetup const &  iSetup  )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file SiPixelDigiSource.cc.

References bladeOn, bookMEs(), buildStructure(), diskOn, lat::endl(), eventNo, hiRes, ladOn, layOn, modOn, phiOn, ringOn, and twoDimOn.

00072                                                            {
00073   
00074   LogInfo ("PixelDQM") << " SiPixelDigiSource::beginJob - Initialisation ... " << std::endl;
00075   LogInfo ("PixelDQM") << "Mod/Lad/Lay/Phi " << modOn << "/" << ladOn << "/" 
00076                        << layOn << "/" << phiOn << std::endl;
00077   LogInfo ("PixelDQM") << "Blade/Disk/Ring" << bladeOn << "/" << diskOn << "/" 
00078                        << ringOn << std::endl;
00079   
00080   LogInfo ("PixelDQM") << "2DIM IS " << twoDimOn << " and set to high resolution? " << hiRes << "\n";
00081 
00082   eventNo = 0;
00083   // Build map
00084   buildStructure(iSetup);
00085   // Book Monitoring Elements
00086   bookMEs();
00087 
00088 }

void SiPixelDigiSource::bookMEs (  )  [virtual]

Create folder tree and book histograms

Definition at line 192 of file SiPixelDigiSource.cc.

References bladeOn, conf_, diskOn, Exception, hiRes, isPIB, ladOn, layOn, LogDebug, modOn, phiOn, ringOn, SiPixelFolderOrganizer::setModuleFolder(), DQMStore::setVerbose(), theDMBE, thePixelStructure, and twoDimOn.

Referenced by beginJob().

00192                                {
00193   
00194   std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
00195   theDMBE->setVerbose(0);
00196  
00197   SiPixelFolderOrganizer theSiPixelFolder;
00198 
00199   for(struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++){
00200  
00202     if(modOn){
00203       if(theSiPixelFolder.setModuleFolder((*struct_iter).first)){
00204         (*struct_iter).second->book( conf_,0,twoDimOn,hiRes);
00205       } else {
00206 
00207         if(!isPIB) throw cms::Exception("LogicError")
00208           << "[SiPixelDigiSource::bookMEs] Creation of DQM folder failed";
00209       }
00210     }
00211     if(ladOn){
00212       if(theSiPixelFolder.setModuleFolder((*struct_iter).first,1)){
00213         (*struct_iter).second->book( conf_,1,twoDimOn,hiRes);
00214         } else {
00215         LogDebug ("PixelDQM") << "PROBLEM WITH LADDER-FOLDER\n";
00216       }
00217    
00218     }
00219     if(layOn){
00220       if(theSiPixelFolder.setModuleFolder((*struct_iter).first,2)){
00221         (*struct_iter).second->book( conf_,2,twoDimOn,hiRes);
00222         } else {
00223         LogDebug ("PixelDQM") << "PROBLEM WITH LAYER-FOLDER\n";
00224       }
00225     }
00226 
00227     if(phiOn){
00228       if(theSiPixelFolder.setModuleFolder((*struct_iter).first,3)){
00229         (*struct_iter).second->book( conf_,3,twoDimOn,hiRes);
00230         } else {
00231         LogDebug ("PixelDQM") << "PROBLEM WITH PHI-FOLDER\n";
00232       }
00233     }
00234     if(bladeOn){
00235       if(theSiPixelFolder.setModuleFolder((*struct_iter).first,4)){
00236         (*struct_iter).second->book( conf_,4,twoDimOn,hiRes);
00237         } else {
00238         LogDebug ("PixelDQM") << "PROBLEM WITH BLADE-FOLDER\n";
00239       }
00240     }
00241     if(diskOn){
00242       if(theSiPixelFolder.setModuleFolder((*struct_iter).first,5)){
00243         (*struct_iter).second->book( conf_,5,twoDimOn,hiRes);
00244       } else {
00245         LogDebug ("PixelDQM") << "PROBLEM WITH DISK-FOLDER\n";
00246       }
00247     }
00248     if(ringOn){
00249       if(theSiPixelFolder.setModuleFolder((*struct_iter).first,6)){
00250         (*struct_iter).second->book( conf_,6,twoDimOn,hiRes);
00251       } else {
00252         LogDebug ("PixelDQM") << "PROBLEM WITH RING-FOLDER\n";
00253       }
00254     }
00255   }
00256 
00257 }

void SiPixelDigiSource::buildStructure ( edm::EventSetup const &  iSetup  )  [virtual]

Definition at line 129 of file SiPixelDigiSource.cc.

References DetId::DetId(), detId, muonGeometry::disk, lat::endl(), edm::EventSetup::get(), isPIB, it, LogDebug, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapName::PixelEndcapName(), DetId::rawId(), PixelGeomDetUnit::specificTopology(), DetId::subdetId(), and thePixelStructure.

Referenced by beginJob().

00129                                                                  {
00130 
00131   LogInfo ("PixelDQM") <<" SiPixelDigiSource::buildStructure" ;
00132   edm::ESHandle<TrackerGeometry> pDD;
00133   iSetup.get<TrackerDigiGeometryRecord>().get( pDD );
00134 
00135   LogVerbatim ("PixelDQM") << " *** Geometry node for TrackerGeom is  "<<&(*pDD)<<std::endl;
00136   LogVerbatim ("PixelDQM") << " *** I have " << pDD->dets().size() <<" detectors"<<std::endl;
00137   LogVerbatim ("PixelDQM") << " *** I have " << pDD->detTypes().size() <<" types"<<std::endl;
00138   
00139   for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
00140     
00141     if(dynamic_cast<PixelGeomDetUnit*>((*it))!=0){
00142 
00143       DetId detId = (*it)->geographicalId();
00144       const GeomDetUnit      * geoUnit = pDD->idToDetUnit( detId );
00145       const PixelGeomDetUnit * pixDet  = dynamic_cast<const PixelGeomDetUnit*>(geoUnit);
00146       int nrows = (pixDet->specificTopology()).nrows();
00147       int ncols = (pixDet->specificTopology()).ncolumns();
00148 
00149       if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
00150         if(isPIB) continue;
00151         LogDebug ("PixelDQM") << " ---> Adding Barrel Module " <<  detId.rawId() << endl;
00152         uint32_t id = detId();
00153         SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
00154         thePixelStructure.insert(pair<uint32_t,SiPixelDigiModule*> (id,theModule));
00155 
00156       } else if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
00157         LogDebug ("PixelDQM") << " ---> Adding Endcap Module " <<  detId.rawId() << endl;
00158         uint32_t id = detId();
00159         SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
00160        
00161         PixelEndcapName::HalfCylinder side = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).halfCylinder();
00162         int disk   = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).diskName();
00163         int blade  = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).bladeName();
00164         int panel  = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).pannelName();
00165         int module = PixelEndcapName::PixelEndcapName(DetId::DetId(id)).plaquetteName();
00166 
00167         char sside[80];  sprintf(sside,  "HalfCylinder_%i",side);
00168         char sdisk[80];  sprintf(sdisk,  "Disk_%i",disk);
00169         char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
00170         char spanel[80]; sprintf(spanel, "Panel_%i",panel);
00171         char smodule[80];sprintf(smodule,"Module_%i",module);
00172         std::string side_str = sside;
00173         std::string disk_str = sdisk;
00174         bool mask = side_str.find("HalfCylinder_1")!=string::npos||
00175                     side_str.find("HalfCylinder_2")!=string::npos||
00176                     side_str.find("HalfCylinder_4")!=string::npos||
00177                     disk_str.find("Disk_2")!=string::npos;
00178         // clutch to take all of FPIX, but no BPIX:
00179         mask = false;
00180         if(isPIB && mask) continue;
00181         
00182         thePixelStructure.insert(pair<uint32_t,SiPixelDigiModule*> (id,theModule));
00183       }
00184 
00185     }
00186   }
00187   LogInfo ("PixelDQM") << " *** Pixel Structure Size " << thePixelStructure.size() << endl;
00188 }

void SiPixelDigiSource::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file SiPixelDigiSource.cc.

References conf_, lat::endl(), edm::ParameterSet::getParameter(), DQMStore::save(), saveFile, and theDMBE.

00091                                   {
00092 
00093   if(saveFile) {
00094     LogInfo ("PixelDQM") << " SiPixelDigiSource::endJob - Saving Root File " << std::endl;
00095     std::string outputFile = conf_.getParameter<std::string>("outputFile");
00096     theDMBE->save( outputFile.c_str() );
00097   }
00098 
00099 }


Member Data Documentation

bool SiPixelDigiSource::bladeOn [private]

Definition at line 75 of file SiPixelDigiSource.h.

Referenced by analyze(), beginJob(), and bookMEs().

edm::ParameterSet SiPixelDigiSource::conf_ [private]

Definition at line 64 of file SiPixelDigiSource.h.

Referenced by bookMEs(), and endJob().

bool SiPixelDigiSource::diskOn [private]

Definition at line 75 of file SiPixelDigiSource.h.

Referenced by analyze(), beginJob(), and bookMEs().

int SiPixelDigiSource::eventNo [private]

Definition at line 76 of file SiPixelDigiSource.h.

Referenced by analyze(), and beginJob().

bool SiPixelDigiSource::hiRes [private]

Definition at line 71 of file SiPixelDigiSource.h.

Referenced by beginJob(), and bookMEs().

bool SiPixelDigiSource::isPIB [private]

Definition at line 67 of file SiPixelDigiSource.h.

Referenced by bookMEs(), and buildStructure().

bool SiPixelDigiSource::ladOn [private]

Definition at line 73 of file SiPixelDigiSource.h.

Referenced by analyze(), beginJob(), and bookMEs().

bool SiPixelDigiSource::layOn [private]

Definition at line 73 of file SiPixelDigiSource.h.

Referenced by analyze(), beginJob(), and bookMEs().

bool SiPixelDigiSource::modOn [private]

Definition at line 69 of file SiPixelDigiSource.h.

Referenced by analyze(), beginJob(), and bookMEs().

bool SiPixelDigiSource::phiOn [private]

Definition at line 73 of file SiPixelDigiSource.h.

Referenced by analyze(), beginJob(), and bookMEs().

bool SiPixelDigiSource::ringOn [private]

Definition at line 75 of file SiPixelDigiSource.h.

Referenced by analyze(), beginJob(), and bookMEs().

bool SiPixelDigiSource::saveFile [private]

Definition at line 66 of file SiPixelDigiSource.h.

Referenced by endJob().

bool SiPixelDigiSource::slowDown [private]

Definition at line 68 of file SiPixelDigiSource.h.

Referenced by analyze().

edm::InputTag SiPixelDigiSource::src_ [private]

Definition at line 65 of file SiPixelDigiSource.h.

Referenced by analyze().

DQMStore* SiPixelDigiSource::theDMBE [private]

Definition at line 77 of file SiPixelDigiSource.h.

Referenced by bookMEs(), endJob(), and SiPixelDigiSource().

std::map<uint32_t,SiPixelDigiModule*> SiPixelDigiSource::thePixelStructure [private]

Definition at line 78 of file SiPixelDigiSource.h.

Referenced by analyze(), bookMEs(), and buildStructure().

bool SiPixelDigiSource::twoDimOn [private]

Definition at line 70 of file SiPixelDigiSource.h.

Referenced by analyze(), beginJob(), and bookMEs().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:54 2009 for CMSSW by  doxygen 1.5.4