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
int filterTriggerType_
 filter TriggerType
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_
MonitorElementtriggerType_
bool verbose_

Detailed Description

Definition at line 79 of file L1TRCT.h.


Constructor & Destructor Documentation

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

Definition at line 43 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") ),
   filterTriggerType_ (ps.getParameter< int >("filterTriggerType"))
{

  // 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 83 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 206 of file L1TRCT.cc.

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

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

  // filter according trigger type
  //  enum ExperimentType {
  //        Undefined          =  0,
  //        PhysicsTrigger     =  1,
  //        CalibrationTrigger =  2,
  //        RandomTrigger      =  3,
  //        Reserved           =  4,
  //        TracedEvent        =  5,
  //        TestTrigger        =  6,
  //        ErrorTrigger       = 15

  // fill a histogram with the trigger type, for normalization fill also last bin
  // ErrorTrigger + 1
  double triggerType = static_cast<double> (e.experimentType()) + 0.001;
  double triggerTypeLast = static_cast<double> (edm::EventAuxiliary::ExperimentType::ErrorTrigger)
                          + 0.001;
  triggerType_->Fill(triggerType);
  triggerType_->Fill(triggerTypeLast + 1);

  // filter only if trigger type is greater than 0, negative values disable filtering
  if (filterTriggerType_ >= 0) {

      // now filter, for real data only
      if (e.isRealData()) {
          if (!(e.experimentType() == filterTriggerType_)) {

              edm::LogInfo("L1TRCT") << "\n Event of TriggerType "
                      << e.experimentType() << " rejected" << std::endl;
              return;

          }
      }

  }

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

  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());
      if(ireg->et()>5){
        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());
      if(iem->rank()>10){
        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());
      if(iem->rank()>10){
        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 87 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(), DQMStore::setCurrentFolder(), and triggerType_.

{


  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");

    triggerType_ =
      dbe->book1D("TriggerType", "TriggerType", 17, -0.5, 16.5);

    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 194 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 101 of file L1TRCT.h.

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

filter TriggerType

Definition at line 151 of file L1TRCT.h.

Referenced by analyze().

ofstream L1TRCT::logFile_ [private]

Definition at line 146 of file L1TRCT.h.

bool L1TRCT::monitorDaemon_ [private]

Definition at line 145 of file L1TRCT.h.

int L1TRCT::nev_ [private]

Definition at line 142 of file L1TRCT.h.

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

std::string L1TRCT::outputFile_ [private]

Definition at line 143 of file L1TRCT.h.

Referenced by endJob(), and L1TRCT().

Definition at line 127 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 131 of file L1TRCT.h.

Definition at line 123 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 134 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 135 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 138 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 121 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 136 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 137 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 139 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 119 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 122 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 116 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 111 of file L1TRCT.h.

Definition at line 112 of file L1TRCT.h.

Definition at line 108 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 148 of file L1TRCT.h.

Referenced by analyze().

Definition at line 120 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

Definition at line 113 of file L1TRCT.h.

Definition at line 104 of file L1TRCT.h.

Referenced by analyze(), and beginJob().

bool L1TRCT::verbose_ [private]

Definition at line 144 of file L1TRCT.h.

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