CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

L1TRCT Class Reference

#include <L1TRCT.h>

Inheritance diagram for L1TRCT:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Protected Member Functions

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

Private Attributes

DQMStoredbe
ofstream logFile_
bool monitorDaemon_
int nev_
std::string outputFile_
MonitorElementrctEmBx_
MonitorElementrctEmCardRegion_
MonitorElementrctHfPlusTauEtaPhi_
MonitorElementrctIsoEmEtEtaPhi_
MonitorElementrctIsoEmOccEtaPhi_
MonitorElementrctIsoEmRank_
MonitorElementrctMipEtaPhi_
MonitorElementrctNonIsoEmEtEtaPhi_
MonitorElementrctNonIsoEmOccEtaPhi_
MonitorElementrctNonIsoEmRank_
MonitorElementrctOverFlowEtaPhi_
MonitorElementrctQuietEtaPhi_
MonitorElementrctRegionBx_
MonitorElementrctRegionRank_
MonitorElementrctRegionsEtEtaPhi_
MonitorElementrctRegionsLocalEtEtaPhi_
MonitorElementrctRegionsLocalOccEtaPhi_
MonitorElementrctRegionsOccEtaPhi_
edm::InputTag rctSource_
MonitorElementrctTauVetoEtaPhi_
MonitorElementrctTauVetoLocalEtaPhi_
bool verbose_

Detailed Description

Definition at line 73 of file L1TRCT.h.


Constructor & Destructor Documentation

L1TRCT::L1TRCT ( const edm::ParameterSet ps)

Definition at line 42 of file L1TRCT.cc.

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

                                      :
   rctSource_( ps.getParameter< InputTag >("rctSource") )

{

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

  if (verbose_)
    std::cout << "L1TRCT: 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_.c_str() << std::endl;
  }

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


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


}
L1TRCT::~L1TRCT ( ) [virtual]

Definition at line 82 of file L1TRCT.cc.

{
}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 202 of file L1TRCT.cc.

References gather_cfg::cout, MonitorElement::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), edm::InputTag::label(), nev_, rctEmBx_, rctHfPlusTauEtaPhi_, rctIsoEmEtEtaPhi_, rctIsoEmOccEtaPhi_, rctIsoEmRank_, rctMipEtaPhi_, rctNonIsoEmEtEtaPhi_, rctNonIsoEmOccEtaPhi_, rctNonIsoEmRank_, rctOverFlowEtaPhi_, rctQuietEtaPhi_, rctRegionBx_, rctRegionRank_, rctRegionsEtEtaPhi_, rctRegionsOccEtaPhi_, rctSource_, rctTauVetoEtaPhi_, and verbose_.

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

  // Get the RCT digis
  edm::Handle < L1CaloEmCollection > em;
  edm::Handle < L1CaloRegionCollection > rgn;

  // need to change to getByLabel
  bool doEm = true; 
  bool doHd = true;

  
  e.getByLabel(rctSource_,rgn);
 
  if (!rgn.isValid()) {
    edm::LogInfo("DataNotFound") << "can't find L1CaloRegionCollection with label "
                               << rctSource_.label() ;
    doHd = false;
  }

  if ( doHd ) {
    // Fill the RCT histograms

    // Regions
    for (L1CaloRegionCollection::const_iterator ireg = rgn->begin();
         ireg != rgn->end(); ireg++) {
      if(ireg->et()>0)
      {
      rctRegionRank_->Fill(ireg->et());
      rctRegionsOccEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
      rctRegionsEtEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi(), ireg->et());
//      rctTauVetoEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi(),
//                            ireg->tauVeto());

      // now do local coordinate eta and phi
//      rctRegionsLocalOccEtaPhi_->Fill(ireg->rctEta(), ireg->rctPhi());
//      rctRegionsLocalEtEtaPhi_->Fill(ireg->rctEta(), ireg->rctPhi(), 
//                                   ireg->et());
//      rctTauVetoLocalEtaPhi_->Fill(ireg->rctEta(), ireg->rctPhi(),
//                                 ireg->tauVeto());
      rctRegionBx_->Fill(ireg->bx());
      }

    if(ireg->overFlow())  rctOverFlowEtaPhi_ ->Fill(ireg->gctEta(), ireg->gctPhi());
    if(ireg->tauVeto())   rctTauVetoEtaPhi_  ->Fill(ireg->gctEta(), ireg->gctPhi());
    if(ireg->mip())       rctMipEtaPhi_      ->Fill(ireg->gctEta(), ireg->gctPhi());
    if(ireg->quiet())     rctQuietEtaPhi_    ->Fill(ireg->gctEta(), ireg->gctPhi());
    if(ireg->fineGrain()) rctHfPlusTauEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi()); 
    
    }
  }

  
  e.getByLabel(rctSource_,em);
  
  if (!em.isValid()) {
    edm::LogInfo("DataNotFound") << "can't find L1CaloEmCollection with label "
                               << rctSource_.label() ;
    doEm = false;
  }
  if ( ! doEm ) return;
  // Isolated and non-isolated EM
  for (L1CaloEmCollection::const_iterator iem = em->begin();
       iem != em->end(); iem++) {
    
 //   rctEmCardRegion_->Fill((iem->rctRegion()==0?1:-1)*(iem->rctCard()));

    if (iem->isolated()) {
      if(iem->rank()>0)
      {
      rctIsoEmRank_->Fill(iem->rank());
      rctIsoEmEtEtaPhi_->Fill(iem->regionId().ieta(),
                              iem->regionId().iphi(), iem->rank());
      rctIsoEmOccEtaPhi_->Fill(iem->regionId().ieta(),
                               iem->regionId().iphi());
      rctEmBx_->Fill(iem->bx());
      }
    }
    else {
      if(iem->rank()>0)
      { 
      rctNonIsoEmRank_->Fill(iem->rank());
      rctNonIsoEmEtEtaPhi_->Fill(iem->regionId().ieta(),
                                 iem->regionId().iphi(), iem->rank());
      rctNonIsoEmOccEtaPhi_->Fill(iem->regionId().ieta(),
                                  iem->regionId().iphi());
      rctEmBx_->Fill(iem->bx());
      }
    }

  }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 86 of file L1TRCT.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe, ETABINS, ETAMAX, ETAMIN, nev_, cmsCodeRules::cppFunctionSkipper::operator, PHIBINS, PHIMAX, PHIMIN, R10BINS, R10MAX, R10MIN, R6BINS, R6MAX, R6MIN, rctEmBx_, rctHfPlusTauEtaPhi_, rctIsoEmEtEtaPhi_, rctIsoEmOccEtaPhi_, rctIsoEmRank_, rctMipEtaPhi_, rctNonIsoEmEtEtaPhi_, rctNonIsoEmOccEtaPhi_, rctNonIsoEmRank_, rctOverFlowEtaPhi_, rctQuietEtaPhi_, rctRegionBx_, rctRegionRank_, rctRegionsEtEtaPhi_, rctRegionsOccEtaPhi_, rctTauVetoEtaPhi_, DQMStore::rmdir(), and DQMStore::setCurrentFolder().

{


  nev_ = 0;

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

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


  if (dbe) {
    dbe->setCurrentFolder("L1T/L1TRCT");

    rctIsoEmEtEtaPhi_ =
        dbe->book2D("RctEmIsoEmEtEtaPhi", "ISO EM E_{T}", ETABINS, ETAMIN,
                    ETAMAX, PHIBINS, PHIMIN, PHIMAX);
    rctIsoEmOccEtaPhi_ =
        dbe->book2D("RctEmIsoEmOccEtaPhi", "ISO EM OCCUPANCY", ETABINS,
                    ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
    rctNonIsoEmEtEtaPhi_ =
        dbe->book2D("RctEmNonIsoEmEtEtaPhi", "NON-ISO EM E_{T}", ETABINS,
                    ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
    rctNonIsoEmOccEtaPhi_ =
        dbe->book2D("RctEmNonIsoEmOccEtaPhi", "NON-ISO EM OCCUPANCY",
                    ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);

    // global regions
    rctRegionsEtEtaPhi_ =
        dbe->book2D("RctRegionsEtEtaPhi", "REGION E_{T}", ETABINS, ETAMIN,
                    ETAMAX, PHIBINS, PHIMIN, PHIMAX);
    rctRegionsOccEtaPhi_ =
        dbe->book2D("RctRegionsOccEtaPhi", "REGION OCCUPANCY", ETABINS,
                    ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);

    rctOverFlowEtaPhi_ =
        dbe->book2D("RctBitOverFlowEtaPhi", "OVER FLOW OCCUPANCY", ETABINS,
                    ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);

    rctTauVetoEtaPhi_ =
        dbe->book2D("RctBitTauVetoEtaPhi", "TAU VETO OCCUPANCY", ETABINS,
                    ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);

    rctMipEtaPhi_ =
        dbe->book2D("RctBitMipEtaPhi", "MIP OCCUPANCY", ETABINS,
                    ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);

    rctQuietEtaPhi_ =
        dbe->book2D("RctBitQuietEtaPhi", "QUIET OCCUPANCY", ETABINS,
                    ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);

    rctHfPlusTauEtaPhi_ =
        dbe->book2D("RctBitHfPlusTauEtaPhi", "HF plus Tau OCCUPANCY", ETABINS,
                    ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);

    // local regions
/*
    const int nlocphibins = 2; 
    const float locphimin = -0.5;
    const float locphimax = 1.5;
    const int nlocetabins = 11;
    const float locetamin = -0.5;
    const float locetamax = 10.5;
    rctRegionsLocalEtEtaPhi_ =
        dbe->book2D("RctRegionsLocalEtEtaPhi", "REGION E_{T} (Local)", 
                    nlocetabins, locetamin, locetamax,
                    nlocphibins, locphimin, locphimax);
    rctRegionsLocalOccEtaPhi_ =
        dbe->book2D("RctRegionsLocalOccEtaPhi", "REGION OCCUPANCY (Local)", 
                    nlocetabins, locetamin, locetamax,
                    nlocphibins, locphimin, locphimax);
    rctTauVetoLocalEtaPhi_ =
        dbe->book2D("RctTauLocalVetoEtaPhi", "TAU VETO OCCUPANCY (Local)",
                    nlocetabins, locetamin, locetamax,
                    nlocphibins, locphimin, locphimax);
*/
    // rank histos
    rctRegionRank_ =
        dbe->book1D("RctRegionRank", "REGION RANK", R10BINS, R10MIN,
                    R10MAX);
    rctIsoEmRank_ =
        dbe->book1D("RctEmIsoEmRank", "ISO EM RANK", R6BINS, R6MIN, R6MAX);
    rctNonIsoEmRank_ =
        dbe->book1D("RctEmNonIsoEmRank", "NON-ISO EM RANK", R6BINS, R6MIN,
                    R6MAX);
    // hw coordinates
//    rctEmCardRegion_ = dbe->book1D("rctEmCardRegion", "Em Card * Region",
//                                 256, -127.5, 127.5);

    // bx histos
    rctRegionBx_ = dbe->book1D("RctRegionBx", "Region BX", 256, -0.5, 4095.5);
    rctEmBx_ = dbe->book1D("RctEmBx", "EM BX", 256, -0.5, 4095.5);

    

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

Reimplemented from edm::EDAnalyzer.

Definition at line 190 of file L1TRCT.cc.

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

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

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

  return;
}

Member Data Documentation

DQMStore* L1TRCT::dbe [private]

Definition at line 95 of file L1TRCT.h.

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

ofstream L1TRCT::logFile_ [private]

Definition at line 137 of file L1TRCT.h.

bool L1TRCT::monitorDaemon_ [private]

Definition at line 136 of file L1TRCT.h.

int L1TRCT::nev_ [private]

Definition at line 133 of file L1TRCT.h.

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

std::string L1TRCT::outputFile_ [private]

Definition at line 134 of file L1TRCT.h.

Referenced by endJob(), and L1TRCT().

Definition at line 118 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 122 of file L1TRCT.h.

Definition at line 114 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 125 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 126 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 129 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 112 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 127 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 128 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 130 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 110 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 113 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 117 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 107 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 98 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 102 of file L1TRCT.h.

Definition at line 103 of file L1TRCT.h.

Definition at line 99 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 139 of file L1TRCT.h.

Referenced by analyze().

Definition at line 111 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 104 of file L1TRCT.h.

bool L1TRCT::verbose_ [private]

Definition at line 135 of file L1TRCT.h.

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