CMS 3D CMS Logo

EcalPreshowerDigisValidation Class Reference

#include <Validation/EcalDigis/interface/EcalPreshowerDigisValidation.h>

Inheritance diagram for EcalPreshowerDigisValidation:

edm::EDAnalyzer

List of all members.

Public Member Functions

 EcalPreshowerDigisValidation (const edm::ParameterSet &ps)
 Constructor.
 ~EcalPreshowerDigisValidation ()
 Destructor.

Protected Member Functions

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

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(), histo, i, meESDigiADC_, meESDigiMultiplicity_, and verbose_.

00017                                                                                 :
00018   ESdigiCollection_(ps.getParameter<edm::InputTag>("ESdigiCollection"))
00019 {
00020   
00021   // verbosity switch
00022   verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
00023                                                                                                                                            
00024   dbe_ = 0;
00025                                                                                                                                           
00026   // get hold of back-end interface
00027   dbe_ = Service<DQMStore>().operator->();
00028                                                                                                                                           
00029   if ( dbe_ ) {
00030     if ( verbose_ ) {
00031       dbe_->setVerbose(1);
00032     } else {
00033       dbe_->setVerbose(0);
00034     }
00035   }
00036                                                                                                                                           
00037   if ( dbe_ ) {
00038     if ( verbose_ ) dbe_->showDirStructure();
00039   }
00040 
00041   meESDigiMultiplicity_=0;
00042 
00043   for (int i = 0; i < 3 ; i++ ) {
00044     meESDigiADC_[i] = 0;
00045   }
00046 
00047   Char_t histo[200];
00048  
00049   if ( dbe_ ) {
00050     dbe_->setCurrentFolder("EcalDigisV/EcalDigiTask");
00051 
00052     sprintf (histo, "EcalDigiTask Preshower digis multiplicity" ) ;
00053     meESDigiMultiplicity_ = dbe_->book1D(histo, histo, 1000, 0., 137728);
00054   
00055     for ( int i = 0; i < 3 ; i++ ) {
00056       
00057       sprintf (histo, "EcalDigiTask Preshower ADC pulse %02d", i+1) ;
00058       meESDigiADC_[i] = dbe_->book1D(histo, histo, 4096, -0.5, 4095.5) ;
00059     }
00060 
00061   }
00062  
00063 }

EcalPreshowerDigisValidation::~EcalPreshowerDigisValidation (  ) 

Destructor.

Definition at line 65 of file EcalPreshowerDigisValidation.cc.

00065                                                            {
00066  
00067 }


Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 77 of file EcalPreshowerDigisValidation.cc.

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

00077                                                                              {
00078 
00079   //LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
00080 
00081   Handle<ESDigiCollection> EcalDigiES;
00082 
00083   e.getByLabel( ESdigiCollection_ , EcalDigiES );
00084 
00085   // Return if no preshower data
00086   if( !EcalDigiES.isValid() ) return;
00087 
00088   // PRESHOWER
00089   
00090   // loop over Digis
00091 
00092   const ESDigiCollection * preshowerDigi = EcalDigiES.product () ;
00093 
00094   std::vector<double> esADCCounts ;
00095   esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
00096 
00097   int nDigis = 0;
00098 
00099   for (unsigned int digis=0; digis<EcalDigiES->size(); ++digis) {
00100 
00101     ESDataFrame esdf=(*preshowerDigi)[digis];
00102     int nrSamples=esdf.size();
00103     
00104     ESDetId esid = esdf.id () ;
00105     
00106     nDigis++;
00107     
00108     for (int sample = 0 ; sample < nrSamples; ++sample) {
00109       esADCCounts[sample] = 0.;
00110     }
00111     
00112     for (int sample = 0 ; sample < nrSamples; ++sample) {
00113       ESSample mySample = esdf[sample];
00114       esADCCounts[sample] = (mySample.adc()) ;
00115     }
00116     if (verbose_) {
00117       LogDebug("DigiInfo") << "Preshower Digi for ESDetId: z side " << esid.zside() << "  plane " << esid.plane() << esid.six() << ',' << esid.siy() << ':' << esid.strip();
00118       for ( int i = 0; i < 3 ; i++ ) {
00119         LogDebug("DigiInfo") << "sample " << i << " ADC = " << esADCCounts[i];
00120       }
00121     }
00122     
00123     for ( int i = 0 ; i < 3 ; i++ ) {
00124       if (meESDigiADC_[i]) meESDigiADC_[i]->Fill( esADCCounts[i] ) ;
00125     }
00126     
00127   } 
00128   
00129   if ( meESDigiMultiplicity_ ) meESDigiMultiplicity_->Fill(nDigis);
00130   
00131 }

void EcalPreshowerDigisValidation::beginJob ( const edm::EventSetup c  )  [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file EcalPreshowerDigisValidation.cc.

00069                                                               {
00070 
00071 }

void EcalPreshowerDigisValidation::endJob ( void   )  [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 73 of file EcalPreshowerDigisValidation.cc.

00073                                          {
00074 
00075 }


Member Data Documentation

DQMStore* EcalPreshowerDigisValidation::dbe_ [private]

Definition at line 63 of file EcalPreshowerDigisValidation.h.

Referenced by EcalPreshowerDigisValidation().

edm::InputTag EcalPreshowerDigisValidation::ESdigiCollection_ [private]

Definition at line 67 of file EcalPreshowerDigisValidation.h.

Referenced by analyze().

MonitorElement* EcalPreshowerDigisValidation::meESDigiADC_[3] [private]

Definition at line 71 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().

MonitorElement* EcalPreshowerDigisValidation::meESDigiMultiplicity_ [private]

Definition at line 69 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().

std::string EcalPreshowerDigisValidation::outputFile_ [private]

Definition at line 65 of file EcalPreshowerDigisValidation.h.

bool EcalPreshowerDigisValidation::verbose_ [private]

Definition at line 61 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().


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