SimCalorimetry/EcalTrigPrimProducers/plugins/EcalTPInputAnalyzer.cc
// ------------ method called to analyze the data  ------------
method called to analyze the data
method called to analyze the data
void EcalTPInputAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
  bool barrel = true;
  const edm::Handle<EBDigiCollection> &ebDigis = iEvent.getHandle(ebToken_);
  if (!ebDigis.isValid()) {
    barrel = false;
    edm::LogWarning("EcalTPG") << " Couldnt find Barrel dataframes with Producer:" << producer_
                               << " and label: " << ebLabel_;
  }
  bool endcap = true;
  const edm::Handle<EEDigiCollection> &eeDigis = iEvent.getHandle(eeToken_);
  if (!eeDigis.isValid()) {
    endcap = false;
    edm::LogWarning("EcalTPG") << " Couldnt find Endcap dataframes with Producer:" << producer_
                               << " and label: " << eeLabel_;
  }
  if (barrel) {
    const EBDigiCollection *ebdb = ebDigis.product();
    for (unsigned int i = 0; i < ebDigis->size(); ++i) {
      EBDataFrame ebdf = (*ebdb)[i];
      int nrSamples = ebdf.size();
      for (int is = 0; is < nrSamples; ++is) {
        EcalMGPASample sam = ebdf[is];
        histBar->Fill(sam.adc());
      }
    }
  }
  if (endcap) {
    const EEDigiCollection *eedb = eeDigis.product();
    for (unsigned int i = 0; i < eeDigis->size(); ++i) {
      EEDataFrame eedf = (*eedb)[i];
      int nrSamples = eedf.size();
      for (int is = 0; is < nrSamples; ++is) {
        EcalMGPASample sam = eedf[is];
        histEndc->Fill(sam.adc());
      }
    }
  }
}
void EcalTPInputAnalyzer :: analyze ( const edm :: Event & iEvent , const edm :: EventSetup & iSetup ) { bool barrel = true ; const edm :: Handle < EBDigiCollection > & ebDigis = iEvent . getHandle ( ebToken_ ) ; if ( ! ebDigis . isValid ( ) ) { barrel = false ; edm :: LogWarning ( " " ) << " " << producer_ << " " << ebLabel_ ; } bool endcap = true ; const edm :: Handle < EEDigiCollection > & eeDigis = iEvent . getHandle ( eeToken_ ) ; if ( ! eeDigis . isValid ( ) ) { endcap = false ; edm :: LogWarning ( " " ) << " " << producer_ << " " << eeLabel_ ; } if ( barrel ) { const EBDigiCollection * ebdb = ebDigis . product ( ) ; for ( unsigned int i = 0 ; i < ebDigis -> size ( ) ; ++ i ) { EBDataFrame ebdf = ( * ebdb ) [ i ] ; int nrSamples = ebdf . size ( ) ; for ( int is = 0 ; is < nrSamples ; ++ is ) { EcalMGPASample sam = ebdf [ is ] ; histBar -> Fill ( sam . adc ( ) ) ; } } } if ( endcap ) { const EEDigiCollection * eedb = eeDigis . product ( ) ; for ( unsigned int i = 0 ; i < eeDigis -> size ( ) ; ++ i ) { EEDataFrame eedf = ( * eedb ) [ i ] ; int nrSamples = eedf . size ( ) ; for ( int is = 0 ; is < nrSamples ; ++ is ) { EcalMGPASample sam = eedf [ is ] ; histEndc -> Fill ( sam . adc ( ) ) ; } } } }
method called to analyze the data
method called to analyze the data
// barrel // unsigned int nrSamples=(ebDigis.product())[i].size(); //	EcalMGPASample sam=((ebDigis.product())[i])[is]; // endcap //   // Get input //   const edm::Handle<EcalTrigPrimDigiCollection>& tp = iEvent.getHandle(tpToken_); //   for (unsigned int i=0;i<tp.product()->size();i++) { //     EcalTriggerPrimitiveDigi d=(*(tp.product()))[i]; //     int subdet=d.id().subDet()-1; //       ecal_et_[subdet]->Fill(d.compressedEt()); //       ecal_tt_[subdet]->Fill(d.ttFlag()); //       ecal_fgvb_[subdet]->Fill(d.fineGrain()); //   }