CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

L1TECALTPG Class Reference

#include <L1TECALTPG.h>

Inheritance diagram for L1TECALTPG:
edm::EDAnalyzer

List of all members.

Public Member Functions

 L1TECALTPG (const edm::ParameterSet &ps)
virtual ~L1TECALTPG ()

Protected Member Functions

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

Private Attributes

DQMStoredbe
MonitorElementecalTpEtEtaPhiB_
MonitorElementecalTpEtEtaPhiE_
edm::InputTag ecaltpgSourceB_
edm::InputTag ecaltpgSourceE_
MonitorElementecalTpOccEtaPhiB_
MonitorElementecalTpOccEtaPhiE_
MonitorElementecalTpRankB_
MonitorElementecalTpRankE_
bool enableEE_
ofstream logFile_
bool monitorDaemon_
int nev_
std::string outputFile_
bool verbose_

Detailed Description

Definition at line 72 of file L1TECALTPG.h.


Constructor & Destructor Documentation

L1TECALTPG::L1TECALTPG ( const edm::ParameterSet ps)

Definition at line 97 of file L1TECALTPG.cc.

References gather_cfg::cout, dbe, enableEE_, edm::ParameterSet::getUntrackedParameter(), NULL, cmsCodeRules::cppFunctionSkipper::operator, outputFile_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), and verbose_.

                                             :
  ecaltpgSourceB_(ps.getParameter<edm::InputTag>("ecaltpgSourceB")),
  ecaltpgSourceE_(ps.getParameter<edm::InputTag>("ecaltpgSourceE"))
{

  // verbosity switch
  verbose_ = ps.getUntrackedParameter < bool > ("verbose", false);

  // ecal endcap switch
  enableEE_ = ps.getUntrackedParameter < bool > ("enableEE", false);

  if (verbose_)
    std::cout << "L1TECALTPG: constructor...." << std::endl;


  dbe = NULL;
  if (ps.getUntrackedParameter < bool > ("DQMStore", false)) {
    dbe = Service < DQMStore > ().operator->();
    dbe->setVerbose(0);
  }

  outputFile_ =
      ps.getUntrackedParameter < std::string > ("outputFile", "");
  if (outputFile_.size() != 0) {
    std::cout << "L1T Monitoring histograms will be saved to " 
              << outputFile_ << std::endl;
  }

  bool disable =
      ps.getUntrackedParameter < bool > ("disableROOToutput", false);
  if (disable) {
    outputFile_ = "";
  }


  if (dbe != NULL) {
    dbe->setCurrentFolder("L1T/L1TECALTPG");
  }


}
L1TECALTPG::~L1TECALTPG ( ) [virtual]

Definition at line 139 of file L1TECALTPG.cc.

{
}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 196 of file L1TECALTPG.cc.

References gather_cfg::cout, ecalTpEtEtaPhiB_, ecalTpEtEtaPhiE_, ecaltpgSourceB_, ecaltpgSourceE_, ecalTpOccEtaPhiB_, ecalTpOccEtaPhiE_, ecalTpRankB_, ecalTpRankE_, enableEE_, MonitorElement::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), edm::InputTag::label(), nev_, and verbose_.

{
  nev_++;
  if (verbose_) {
    std::cout << "L1TECALTPG: analyze...." << std::endl;
  }

  // Get the ECAL TPGs
  edm::Handle < EcalTrigPrimDigiCollection > eeTP;
  edm::Handle < EcalTrigPrimDigiCollection > ebTP;
  //  e.getByType(ebTP);
  e.getByLabel(ecaltpgSourceB_,ebTP);
  e.getByLabel(ecaltpgSourceE_,eeTP);
  
  if (!eeTP.isValid() && enableEE_) 
  {
    edm::LogInfo("DataNotFound") << "can't find EcalTrigPrimCollection with "
      " endcap label " << ecaltpgSourceE_.label() ;
    return;
  }  
  if (!ebTP.isValid()) 
  {
    edm::LogInfo("DataNotFound") << "can't find EcalTrigPrimCollection with "
      " barrel label " << ecaltpgSourceB_.label() ;
    return;
  }

  // Fill the ECAL TPG histograms
  if ( verbose_ ) {
    std::cout << "L1TECALTPG: barrel size is " << ebTP->size() << std::endl;
    std::cout << "L1TECALTPG: endcap size is " << eeTP->size() << std::endl;
  }
  
  for (EcalTrigPrimDigiCollection::const_iterator iebTP = ebTP->begin();
       iebTP != ebTP->end(); iebTP++) {
    if ( verbose_ ) {
      std::cout << "barrel: " << iebTP->id().iphi() << ", " 
                << iebTP->id().ieta()
                << std::endl;
    }
    ecalTpEtEtaPhiB_->Fill(iebTP->id().iphi(), iebTP->id().ieta(),
                          iebTP->compressedEt());
    ecalTpOccEtaPhiB_->Fill(iebTP->id().iphi(), iebTP->id().ieta());
    ecalTpRankB_->Fill(iebTP->compressedEt());

  }
  
  if (enableEE_){
  // endcap
  for (EcalTrigPrimDigiCollection::const_iterator ieeTP = eeTP->begin();
       ieeTP != eeTP->end(); ieeTP++) {
    if ( verbose_ ) {
      std::cout << "endcap: " << ieeTP->id().iphi() << ", " 
                << ieeTP->id().ieta()
                << std::endl;
    }
    ecalTpEtEtaPhiE_->Fill(ieeTP->id().iphi(), ieeTP->id().ieta(),
                          ieeTP->compressedEt());
    ecalTpOccEtaPhiE_->Fill(ieeTP->id().iphi(), ieeTP->id().ieta());
    ecalTpRankE_->Fill(ieeTP->compressedEt());

  }
  }

}
void L1TECALTPG::beginJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 143 of file L1TECALTPG.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe, ecalTpEtEtaPhiB_, ecalTpEtEtaPhiE_, ecalTpOccEtaPhiB_, ecalTpOccEtaPhiE_, ecalTpRankB_, ecalTpRankE_, nev_, cmsCodeRules::cppFunctionSkipper::operator, DQMStore::rmdir(), RTPBINS, RTPMAX, RTPMIN, DQMStore::setCurrentFolder(), TPETABINS, TPETAMAX, TPETAMIN, TPPHIBINS, TPPHIMAX, and TPPHIMIN.

{

  nev_ = 0;

  // get hold of back-end interface
  DQMStore *dbe = 0;
  dbe = Service < DQMStore > ().operator->();

  if (dbe) {
    dbe->setCurrentFolder("L1T/L1TECALTPG");
    dbe->rmdir("L1T/L1TECALTPG");
  }


  if (dbe) {
    dbe->setCurrentFolder("L1T/L1TECALTPG");
    ecalTpEtEtaPhiB_ = 
      dbe->book2D("EcalTpEtEtaPhiB", "ECAL TP E_{T} Barrel", TPPHIBINS, 
                  TPPHIMIN, TPPHIMAX, TPETABINS, TPETAMIN, TPETAMAX);
    ecalTpOccEtaPhiB_ =
        dbe->book2D("EcalTpOccEtaPhiB", "ECAL TP OCCUPANCY Barrel", TPPHIBINS,
                    TPPHIMIN, TPPHIMAX, TPETABINS, TPETAMIN, TPETAMAX);
    ecalTpRankB_ =
      dbe->book1D("EcalTpRankB", "ECAL TP RANK Barrel", RTPBINS, RTPMIN,
                  RTPMAX);

    ecalTpEtEtaPhiE_ = 
      dbe->book2D("EcalTpEtEtaPhiE", "ECAL TP E_{T} Endcap", TPPHIBINS, 
                  TPPHIMIN, TPPHIMAX, TPETABINS, TPETAMIN, TPETAMAX);
    ecalTpOccEtaPhiE_ =
        dbe->book2D("EcalTpOccEtaPhiE", "ECAL TP OCCUPANCY Endcap", TPPHIBINS,
                    TPPHIMIN, TPPHIMAX, TPETABINS, TPETAMIN, TPETAMAX);
    ecalTpRankE_ =
      dbe->book1D("EcalTpRankE", "ECAL TP RANK Endcap", RTPBINS, RTPMIN,
                  RTPMAX);

  }
}
void L1TECALTPG::endJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 184 of file L1TECALTPG.cc.

References gather_cfg::cout, dbe, nev_, outputFile_, DQMStore::save(), and verbose_.

{
  if (verbose_)
    std::cout << "L1TECALTPG: end job...." << std::endl;
  LogInfo("EndJob") << "analyzed " << nev_ << " events";

  if (outputFile_.size() != 0 && dbe)
    dbe->save(outputFile_);

  return;
}

Member Data Documentation

Definition at line 94 of file L1TECALTPG.h.

Referenced by beginJob(), endJob(), and L1TECALTPG().

Definition at line 97 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 101 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 112 of file L1TECALTPG.h.

Referenced by analyze().

Definition at line 113 of file L1TECALTPG.h.

Referenced by analyze().

Definition at line 98 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 102 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 99 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 103 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

bool L1TECALTPG::enableEE_ [private]

Definition at line 108 of file L1TECALTPG.h.

Referenced by analyze(), and L1TECALTPG().

ofstream L1TECALTPG::logFile_ [private]

Definition at line 110 of file L1TECALTPG.h.

Definition at line 109 of file L1TECALTPG.h.

int L1TECALTPG::nev_ [private]

Definition at line 105 of file L1TECALTPG.h.

Referenced by analyze(), beginJob(), and endJob().

std::string L1TECALTPG::outputFile_ [private]

Definition at line 106 of file L1TECALTPG.h.

Referenced by endJob(), and L1TECALTPG().

bool L1TECALTPG::verbose_ [private]

Definition at line 107 of file L1TECALTPG.h.

Referenced by analyze(), endJob(), and L1TECALTPG().