CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Types | Private Attributes

EcalPreshowerNoiseDistrib Class Reference

#include <EcalPreshowerNoiseDistrib.h>

Inheritance diagram for EcalPreshowerNoiseDistrib:
edm::EDAnalyzer

List of all members.

Public Member Functions

 EcalPreshowerNoiseDistrib (const edm::ParameterSet &ps)
 Constructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze.

Private Types

typedef std::map< uint32_t,
float, std::less< uint32_t > > 
MapType

Private Attributes

DQMStoredbe_
edm::InputTag ESdigiCollection_
MonitorElementmeESDigi3D_
MonitorElementmeESDigiADC_ [3]
MonitorElementmeESDigiCorr_ [3]
MonitorElementmeESDigiMultiplicity_
std::string outputFile_
bool verbose_

Detailed Description

Definition at line 27 of file EcalPreshowerNoiseDistrib.h.


Member Typedef Documentation

typedef std::map<uint32_t,float,std::less<uint32_t> > EcalPreshowerNoiseDistrib::MapType [private]

Definition at line 29 of file EcalPreshowerNoiseDistrib.h.


Constructor & Destructor Documentation

EcalPreshowerNoiseDistrib::EcalPreshowerNoiseDistrib ( const edm::ParameterSet ps)

Constructor.

Definition at line 12 of file EcalPreshowerNoiseDistrib.cc.

References dbe_, edm::ParameterSet::getUntrackedParameter(), interpolateCardsSimple::histo, meESDigi3D_, meESDigiADC_, meESDigiCorr_, meESDigiMultiplicity_, cppFunctionSkipper::operator, and verbose_.

                                                                          :
  ESdigiCollection_(ps.getParameter<edm::InputTag>("ESdigiCollection"))
{
  
  // verbosity switch
  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
    
  dbe_ = 0;
  
  // get hold of back-end interface
  dbe_ = Service<DQMStore>().operator->();
  
  if ( dbe_ ) {
    if ( verbose_ ) {
      dbe_->setVerbose(1);
    } else {
      dbe_->setVerbose(0);
    }
  }
  
  if ( dbe_ ) {
    if ( verbose_ ) dbe_->showDirStructure();
  }
  
  // histos
  meESDigiMultiplicity_=0;
  for (int ii=0; ii<3; ii++ ) { meESDigiADC_[ii] = 0; }

  Char_t histo[200];
  if ( dbe_ ) {
    sprintf (histo, "multiplicity" ) ;
    meESDigiMultiplicity_ = dbe_->book1D(histo, histo, 1000, 0., 137728);
    
    for ( int ii = 0; ii < 3 ; ii++ ) {
      sprintf (histo, "esRefHistos%02d", ii) ;
      meESDigiADC_[ii] = dbe_->book1D(histo, histo, 35, 983.5, 1018.5) ;
    }
    
    for ( int ii = 0; ii < 3 ; ii++ ) {
      sprintf (histo, "esRefHistosCorr%02d", ii) ;
      meESDigiCorr_[ii] = dbe_->book2D(histo, histo, 35, 983.5, 1018.5, 35, 983.5, 1018.5) ;
    }
        
    meESDigi3D_ = dbe_->book3D("meESDigi3D_", "meESDigi3D_", 35, 983.5, 1018.5, 35, 983.5, 1018.5, 35, 983.5, 1018.5) ;
  }
}

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 60 of file EcalPreshowerNoiseDistrib.cc.

References ecalMGPA::adc(), ESSample::adc(), ESdigiCollection_, MonitorElement::Fill(), HcalObjRepresent::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), ESDataFrame::MAXSAMPLES, meESDigi3D_, meESDigiADC_, meESDigiCorr_, meESDigiMultiplicity_, ecalTB2006H4_GenSimDigiReco_cfg::mySample, edm::Handle< T >::product(), compare_using_db::sample, and ESDataFrame::size().

                                                                          {

  Handle<ESDigiCollection> EcalDigiES;
  
  e.getByLabel( ESdigiCollection_ , EcalDigiES );

  // retrun if no data
  if( !EcalDigiES.isValid() ) return;
  
  // loop over Digis
  const ESDigiCollection * preshowerDigi = EcalDigiES.product () ;
  
  std::vector<double> esADCCounts ;
  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
  
  int nDigis = 0;

  for (unsigned int digis=0; digis<EcalDigiES->size(); ++digis) {
    nDigis++;
    ESDataFrame esdf=(*preshowerDigi)[digis];
    int nrSamples=esdf.size();
    for (int sample = 0 ; sample < nrSamples; ++sample) {
      ESSample mySample = esdf[sample];
      if (meESDigiADC_[sample]) { meESDigiADC_[sample] ->Fill(mySample.adc()); }
    }

    // to study correlations
    if(meESDigiCorr_[0]){ meESDigiCorr_[0]->Fill(esdf[0].adc(),esdf[1].adc()); } 
    if(meESDigiCorr_[1]){ meESDigiCorr_[1]->Fill(esdf[0].adc(),esdf[2].adc()); } 
    if(meESDigiCorr_[2]){ meESDigiCorr_[2]->Fill(esdf[1].adc(),esdf[2].adc()); } 

    // reference histo: sample0, sample1, sample2
    if ( meESDigi3D_ ) meESDigi3D_ -> Fill(esdf[0].adc(),esdf[1].adc(),esdf[2].adc());
  }
  
  if ( meESDigiMultiplicity_ ) meESDigiMultiplicity_->Fill(nDigis);
  
}

Member Data Documentation

Definition at line 45 of file EcalPreshowerNoiseDistrib.h.

Referenced by EcalPreshowerNoiseDistrib().

Definition at line 49 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze().

Definition at line 54 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze(), and EcalPreshowerNoiseDistrib().

Definition at line 52 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze(), and EcalPreshowerNoiseDistrib().

Definition at line 53 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze(), and EcalPreshowerNoiseDistrib().

Definition at line 55 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze(), and EcalPreshowerNoiseDistrib().

Definition at line 47 of file EcalPreshowerNoiseDistrib.h.

Definition at line 43 of file EcalPreshowerNoiseDistrib.h.

Referenced by EcalPreshowerNoiseDistrib().