#include <EcalPreshowerDigisValidation.h>
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 | |
DQMStore * | dbe_ |
edm::InputTag | ESdigiCollection_ |
MonitorElement * | meESDigiADC_ [3] |
MonitorElement * | meESDigiMultiplicity_ |
std::string | outputFile_ |
bool | verbose_ |
Definition at line 36 of file EcalPreshowerDigisValidation.h.
typedef std::map<uint32_t,float,std::less<uint32_t> > EcalPreshowerDigisValidation::MapType [private] |
Definition at line 38 of file EcalPreshowerDigisValidation.h.
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) ; } } }
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); }
DQMStore* EcalPreshowerDigisValidation::dbe_ [private] |
Definition at line 54 of file EcalPreshowerDigisValidation.h.
Referenced by EcalPreshowerDigisValidation().
Definition at line 58 of file EcalPreshowerDigisValidation.h.
Referenced by analyze().
MonitorElement* EcalPreshowerDigisValidation::meESDigiADC_[3] [private] |
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().
std::string EcalPreshowerDigisValidation::outputFile_ [private] |
Definition at line 56 of file EcalPreshowerDigisValidation.h.
bool EcalPreshowerDigisValidation::verbose_ [private] |
Definition at line 52 of file EcalPreshowerDigisValidation.h.
Referenced by analyze(), and EcalPreshowerDigisValidation().