CMS 3D CMS Logo

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

EcalPreshowerDigisValidation Class Reference

#include <EcalPreshowerDigisValidation.h>

Inheritance diagram for EcalPreshowerDigisValidation:
edm::EDAnalyzer

List of all members.

Public Member Functions

 EcalPreshowerDigisValidation (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_
MonitorElementmeESDigiADC_ [3]
MonitorElementmeESDigiMultiplicity_
std::string outputFile_
bool verbose_

Detailed Description

Definition at line 36 of file EcalPreshowerDigisValidation.h.


Member Typedef Documentation

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

Definition at line 38 of file EcalPreshowerDigisValidation.h.


Constructor & Destructor Documentation

EcalPreshowerDigisValidation::EcalPreshowerDigisValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 17 of file EcalPreshowerDigisValidation.cc.

References dbe_, edm::ParameterSet::getUntrackedParameter(), timingPdfMaker::histo, i, meESDigiADC_, 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();
  }

  meESDigiMultiplicity_=0;

  for (int i = 0; i < 3 ; i++ ) {
    meESDigiADC_[i] = 0;
  }

  Char_t histo[200];
 
  if ( dbe_ ) {
    dbe_->setCurrentFolder("EcalDigisV/EcalDigiTask");

    sprintf (histo, "EcalDigiTask Preshower digis multiplicity" ) ;
    meESDigiMultiplicity_ = dbe_->book1D(histo, histo, 1000, 0., 137728);
  
    for ( int i = 0; i < 3 ; i++ ) {
      
      sprintf (histo, "EcalDigiTask Preshower ADC pulse %02d", i+1) ;
      meESDigiADC_[i] = dbe_->book1D(histo, histo, 4096, -0.5, 4095.5) ;
    }

  }
 
}

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 65 of file EcalPreshowerDigisValidation.cc.

References ESSample::adc(), ESdigiCollection_, MonitorElement::Fill(), edm::Event::getByLabel(), i, ESDataFrame::id(), edm::HandleBase::isValid(), LogDebug, ESDataFrame::MAXSAMPLES, meESDigiADC_, meESDigiMultiplicity_, ecalTB2006H4_GenSimDigiReco_cfg::mySample, ESDetId::plane(), edm::Handle< T >::product(), compare_using_db::sample, ESDetId::six(), ESDetId::siy(), ESDataFrame::size(), ESDetId::strip(), verbose_, and ESDetId::zside().

                                                                             {

  //LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();

  Handle<ESDigiCollection> EcalDigiES;

  e.getByLabel( ESdigiCollection_ , EcalDigiES );

  // Return if no preshower data
  if( !EcalDigiES.isValid() ) return;

  // PRESHOWER
  
  // 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) {

    ESDataFrame esdf=(*preshowerDigi)[digis];
    int nrSamples=esdf.size();
    
    ESDetId esid = esdf.id () ;
    
    nDigis++;
    
    for (int sample = 0 ; sample < nrSamples; ++sample) {
      esADCCounts[sample] = 0.;
    }
    
    for (int sample = 0 ; sample < nrSamples; ++sample) {
      ESSample mySample = esdf[sample];
      esADCCounts[sample] = (mySample.adc()) ;
    }
    if (verbose_) {
      LogDebug("DigiInfo") << "Preshower Digi for ESDetId: z side " << esid.zside() << "  plane " << esid.plane() << esid.six() << ',' << esid.siy() << ':' << esid.strip();
      for ( int i = 0; i < 3 ; i++ ) {
        LogDebug("DigiInfo") << "sample " << i << " ADC = " << esADCCounts[i];
      }
    }
    
    for ( int i = 0 ; i < 3 ; i++ ) {
      if (meESDigiADC_[i]) meESDigiADC_[i]->Fill( esADCCounts[i] ) ;
    }
    
  } 
  
  if ( meESDigiMultiplicity_ ) meESDigiMultiplicity_->Fill(nDigis);
  
}

Member Data Documentation

Definition at line 54 of file EcalPreshowerDigisValidation.h.

Referenced by EcalPreshowerDigisValidation().

Definition at line 58 of file EcalPreshowerDigisValidation.h.

Referenced by analyze().

Definition at line 62 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().

Definition at line 60 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().

Definition at line 56 of file EcalPreshowerDigisValidation.h.

Definition at line 52 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().