CMS 3D CMS Logo

Classes | Public Member Functions | Private Member Functions | Private Attributes

DTNoiseCalibration Class Reference

#include <DTNoiseCalibration.h>

Inheritance diagram for DTNoiseCalibration:
edm::EDAnalyzer

List of all members.

Classes

class  DTNoiseCalibration

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
void beginJob ()
void beginRun (const edm::Run &run, const edm::EventSetup &setup)
 DTNoiseCalibration (const edm::ParameterSet &ps)
 Constructor.
void endJob ()
virtual ~DTNoiseCalibration ()
 Destructor.

Private Member Functions

std::string getChamberName (const DTChamberId &) const
std::string getChannelName (const DTWireId &) const
std::string getLayerName (const DTLayerId &) const
std::string getSuperLayerName (const DTSuperLayerId &) const

Private Attributes

std::map< DTChamberId, TH1F * > chamberOccupancyVsLumiMap_
std::map< DTChamberId, TH1F * > chamberOccupancyVsTimeMap_
std::string dbLabel_
int defaultTtrig_
edm::InputTag digiLabel_
edm::ESHandle< DTGeometrydtGeom_
TH1F * hTDCTriggerWidth_
unsigned int lumiMax_
double maximumNoiseRate_
int nevents_
bool readDB_
TFile * rootFile_
time_t runBeginTime_
time_t runEndTime_
std::map< DTLayerId, TH1F * > theHistoOccupancyMap_
std::map< DTWireId, TH1F * > theHistoOccupancyVsLumiMap_
int timeWindowOffset_
double triggerWidth_
edm::ESHandle< DTTtrigtTrigMap_
bool useAbsoluteRate_
bool useTimeWindow_
std::vector< DTWireIdwireIdWithHisto_

Detailed Description

Definition at line 33 of file DTNoiseCalibration.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 44 of file DTNoiseCalibration.cc.

References defaultTtrig_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), readDB_, rootFile_, dtTPAnalyzer_cfg::rootFileName, relativeConstraints::station, and wireIdWithHisto_.

                                                                 :
  digiLabel_( pset.getParameter<InputTag>("digiLabel") ),
  useTimeWindow_( pset.getParameter<bool>("useTimeWindow") ),
  triggerWidth_( pset.getParameter<double>("triggerWidth") ),
  timeWindowOffset_( pset.getParameter<int>("timeWindowOffset") ),
  maximumNoiseRate_( pset.getParameter<double>("maximumNoiseRate") ),
  useAbsoluteRate_( pset.getParameter<bool>("useAbsoluteRate") ), 
  readDB_(true), defaultTtrig_(0), 
  dbLabel_( pset.getUntrackedParameter<string>("dbLabel", "") ),
  //fastAnalysis_( pset.getParameter<bool>("fastAnalysis", true) ),
  wireIdWithHisto_( std::vector<DTWireId>() ),
  lumiMax_(3000)
  {

  // Get the debug parameter for verbose output
  //debug = ps.getUntrackedParameter<bool>("debug");
  /*// The analysis type
  // The wheel & sector interested for the time-dependent analysis
  wh = ps.getUntrackedParameter<int>("wheel", 0);
  sect = ps.getUntrackedParameter<int>("sector", 6);*/

  if( pset.exists("defaultTtrig") ){
     readDB_ = false;
     defaultTtrig_ = pset.getParameter<int>("defaultTtrig");
  }

  if( pset.exists("cellsWithHisto") ){
     vector<string> cellsWithHisto = pset.getParameter<vector<string> >("cellsWithHisto");
     for(vector<string>::const_iterator cell = cellsWithHisto.begin(); cell != cellsWithHisto.end(); ++cell){
        //FIXME: Use regex to check whether format is right
        if( (*cell) != "" && (*cell) != "None"){
           stringstream linestr;
           int wheel,station,sector,sl,layer,wire;
           linestr << (*cell);
           linestr >> wheel >> station >> sector >> sl >> layer >> wire;
           wireIdWithHisto_.push_back(DTWireId(wheel,station,sector,sl,layer,wire));
        }
     }
  }

  // The root file which will contain the histos
  string rootFileName = pset.getUntrackedParameter<string>("rootFileName","noise.root");
  rootFile_ = new TFile(rootFileName.c_str(), "RECREATE");
  rootFile_->cd();
}
DTNoiseCalibration::~DTNoiseCalibration ( ) [virtual]

Destructor.

Definition at line 418 of file DTNoiseCalibration.cc.

                                       {
  rootFile_->Close();
}

Member Function Documentation

void DTNoiseCalibration::analyze ( const edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDAnalyzer.

void DTNoiseCalibration::beginJob ( ) [virtual]

Reimplemented from edm::EDAnalyzer.

void DTNoiseCalibration::beginRun ( const edm::Run run,
const edm::EventSetup setup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

void DTNoiseCalibration::endJob ( ) [virtual]

Reimplemented from edm::EDAnalyzer.

std::string DTNoiseCalibration::getChamberName ( const DTChamberId ) const [private]
string DTNoiseCalibration::getChannelName ( const DTWireId wId) const [private]

Definition at line 422 of file DTNoiseCalibration.cc.

References DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superlayer(), DTChamberId::wheel(), and DTWireId::wire().

                                                                  {
  stringstream channelName;
  channelName << "Wh" << wId.wheel() << "_St" << wId.station() << "_Sec" << wId.sector()
              << "_SL" << wId.superlayer() << "_L" << wId.layer() << "_W"<< wId.wire();

  return channelName.str();
}
std::string DTNoiseCalibration::getLayerName ( const DTLayerId ) const [private]
std::string DTNoiseCalibration::getSuperLayerName ( const DTSuperLayerId ) const [private]

Member Data Documentation

Definition at line 91 of file DTNoiseCalibration.h.

Definition at line 93 of file DTNoiseCalibration.h.

std::string DTNoiseCalibration::dbLabel_ [private]

Definition at line 68 of file DTNoiseCalibration.h.

Definition at line 67 of file DTNoiseCalibration.h.

Referenced by DTNoiseCalibration().

Definition at line 55 of file DTNoiseCalibration.h.

Definition at line 79 of file DTNoiseCalibration.h.

Definition at line 85 of file DTNoiseCalibration.h.

unsigned int DTNoiseCalibration::lumiMax_ [private]

Definition at line 71 of file DTNoiseCalibration.h.

Definition at line 59 of file DTNoiseCalibration.h.

Definition at line 73 of file DTNoiseCalibration.h.

Definition at line 66 of file DTNoiseCalibration.h.

Referenced by DTNoiseCalibration().

Definition at line 83 of file DTNoiseCalibration.h.

Referenced by DTNoiseCalibration().

Definition at line 75 of file DTNoiseCalibration.h.

Definition at line 76 of file DTNoiseCalibration.h.

Definition at line 87 of file DTNoiseCalibration.h.

Definition at line 89 of file DTNoiseCalibration.h.

Definition at line 58 of file DTNoiseCalibration.h.

Definition at line 57 of file DTNoiseCalibration.h.

Definition at line 81 of file DTNoiseCalibration.h.

Definition at line 60 of file DTNoiseCalibration.h.

Definition at line 56 of file DTNoiseCalibration.h.

Definition at line 70 of file DTNoiseCalibration.h.

Referenced by DTNoiseCalibration().