CMS 3D CMS Logo

Public Member Functions | Private Attributes

DumpGctDigis Class Reference

#include <L1Trigger/GlobalCaloTrigger/test/DumpGctDigis.cc>

Inheritance diagram for DumpGctDigis:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
void doEM (const edm::Event &, const edm::InputTag &label)
void doEnergySums (const edm::Event &, const edm::InputTag &label)
void doFibres (const edm::Event &, const edm::InputTag &label)
void doInternEM (const edm::Event &, const edm::InputTag &label)
void doJets (const edm::Event &, const edm::InputTag &label)
void doRctEM (const edm::Event &, const edm::InputTag &label)
void doRegions (const edm::Event &, const edm::InputTag &label)
 DumpGctDigis (const edm::ParameterSet &)
 ~DumpGctDigis ()

Private Attributes

bool doEM_
bool doEmu_
bool doEnergySums_
bool doFibres_
bool doHW_
bool doInternEM_
bool doJets_
bool doRctEM_
bool doRegions_
edm::InputTag emuGctLabel_
edm::InputTag emuRctLabel_
std::ofstream outFile_
std::string outFilename_
edm::InputTag rawLabel_
unsigned rctEmMinRank_

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 36 of file DumpGctDigis.h.


Constructor & Destructor Documentation

DumpGctDigis::DumpGctDigis ( const edm::ParameterSet iConfig) [explicit]

Definition at line 29 of file DumpGctDigis.cc.

References dbtoconf::out, outFile_, and outFilename_.

                                                         :
  rawLabel_( iConfig.getUntrackedParameter<edm::InputTag>("rawInput", edm::InputTag("L1GctRawDigis") ) ),
  emuRctLabel_( iConfig.getUntrackedParameter<edm::InputTag>("emuRctInput", edm::InputTag("L1RctEmuDigis") ) ),
  emuGctLabel_( iConfig.getUntrackedParameter<edm::InputTag>("emuGctInput", edm::InputTag("L1GctEmuDigis") ) ),
  outFilename_( iConfig.getUntrackedParameter<string>("outFile", "gctAnalyzer.txt") ),
  doHW_( iConfig.getUntrackedParameter<bool>("doHardware", true) ),
  doEmu_( iConfig.getUntrackedParameter<bool>("doEmulated", true) ),
  doRctEM_( iConfig.getUntrackedParameter<bool>("doRctEm", true) ),
  doEM_( iConfig.getUntrackedParameter<bool>("doEm", true) ),
  doRegions_( iConfig.getUntrackedParameter<bool>("doRegions", false) ),
  doJets_( iConfig.getUntrackedParameter<bool>("doJets", false) ),
  doInternEM_( iConfig.getUntrackedParameter<bool>("doInternEm", true) ),
  doFibres_( iConfig.getUntrackedParameter<bool>("doFibres", false) ),
  doEnergySums_( iConfig.getUntrackedParameter<bool>("doEnergySums", false) ),
  rctEmMinRank_( iConfig.getUntrackedParameter<unsigned>("rctEmMinRank", 0) )
{
  //now do what ever initialization is needed

  outFile_.open(outFilename_.c_str(), ios::out);

}
DumpGctDigis::~DumpGctDigis ( )

Definition at line 52 of file DumpGctDigis.cc.

References outFile_.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

  outFile_.close();

}

Member Function Documentation

void DumpGctDigis::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 69 of file DumpGctDigis.cc.

References doEM(), doEM_, doEmu_, doEnergySums(), doEnergySums_, doFibres(), doFibres_, doHW_, doInternEM(), doInternEM_, doJets(), doJets_, doRctEM(), doRctEM_, doRegions(), doRegions_, emuGctLabel_, emuRctLabel_, edm::EventID::event(), edm::EventBase::id(), outFile_, rawLabel_, and edm::EventID::run().

{
  using namespace edm;
  
  outFile_ << "Run :" << iEvent.id().run() << "  Event :" << iEvent.id().event() << endl;
  
  // EM
  if (doRctEM_ && doHW_) { doRctEM(iEvent, rawLabel_); }
  if (doRctEM_ && doEmu_) { doRctEM(iEvent, emuRctLabel_); }
  if (doEM_ && doHW_) { doEM(iEvent, rawLabel_); }
  if (doEM_ && doEmu_){ doEM(iEvent, emuGctLabel_); }

  // Jets
  if (doRegions_ && doHW_) { doRegions(iEvent, rawLabel_); }
  if (doRegions_ && doEmu_) { doRegions(iEvent, emuRctLabel_); }
  if (doJets_ && doHW_) { doJets(iEvent, rawLabel_); }
  if (doJets_ && doEmu_) { doJets(iEvent, emuGctLabel_); }

  // Energy Sums
  if (doEnergySums_ && doHW_) { doEnergySums(iEvent, rawLabel_); }
  if (doEnergySums_ && doEmu_) { doEnergySums(iEvent, emuGctLabel_); }

  // debugging
  if (doInternEM_ && doHW_) { doInternEM(iEvent, rawLabel_); }
  if (doFibres_ && doHW_) { doFibres(iEvent, rawLabel_); }

}
void DumpGctDigis::doEM ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 97 of file DumpGctDigis.cc.

References edm::Event::getByLabel(), edm::InputTag::label(), Vispa::Plugins::EdmBrowser::EdmDataAccessor::ne(), and outFile_.

Referenced by analyze().

                                                                        {

  using namespace edm;

  Handle<L1GctEmCandCollection> isoEm;
  Handle<L1GctEmCandCollection> nonIsoEm;

  L1GctEmCandCollection::const_iterator ie;
  L1GctEmCandCollection::const_iterator ne;
  
  iEvent.getByLabel(label.label(),"isoEm",isoEm);
  iEvent.getByLabel(label.label(),"nonIsoEm",nonIsoEm);

  outFile_ << "Iso EM from : " << label.label() << endl;
  for (ie=isoEm->begin(); ie!=isoEm->end(); ie++) {
    outFile_ << (*ie) 
             << " ieta(detID)=" << ie->regionId().ieta()
             << " iphi(detID)=" << ie->regionId().iphi()
             << endl;
  } 
  outFile_ << endl;
  
  outFile_ << "Non-iso EM from : " << label.label() << endl;
  for (ne=nonIsoEm->begin(); ne!=nonIsoEm->end(); ne++) {
    outFile_ << (*ne) 
             << " ieta(detID)=" << ne->regionId().ieta()
             << " iphi(detID)=" << ne->regionId().iphi()
             << endl;
  } 
  outFile_ << endl;

}
void DumpGctDigis::doEnergySums ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 250 of file DumpGctDigis.cc.

References edm::Event::getByLabel(), edm::InputTag::label(), CaloMET_cfi::met, and outFile_.

Referenced by analyze().

{
  using namespace edm;
  
  Handle<L1GctEtTotalCollection> etTotal;
  Handle<L1GctEtHadCollection> etHad;
  Handle<L1GctEtMissCollection> etMiss;
  Handle<L1GctHtMissCollection> htMiss;
  
  iEvent.getByLabel(label, etTotal);
  iEvent.getByLabel(label, etHad);
  iEvent.getByLabel(label, etMiss);
  iEvent.getByLabel(label, htMiss);
  
  outFile_ << "Energy sums from: " << label.label() << endl;
  
  L1GctEtTotalCollection::const_iterator et;
  for (et=etTotal->begin(); et!=etTotal->end(); et++){
    outFile_ << *(et) << endl;
  }

  L1GctEtHadCollection::const_iterator ht;
  for (ht=etHad->begin(); ht!=etHad->end(); ht++){
    outFile_ << *(ht) << endl;
  }

  L1GctEtMissCollection::const_iterator met;
  for (met=etMiss->begin(); met!=etMiss->end(); met++){
    outFile_ << *(met) << endl;
  }

  L1GctHtMissCollection::const_iterator mht;
  for (mht=htMiss->begin(); mht!=htMiss->end(); mht++){
    outFile_ << *(mht) << endl;
  }

}
void DumpGctDigis::doFibres ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 232 of file DumpGctDigis.cc.

References f, edm::Event::getByLabel(), edm::InputTag::label(), and outFile_.

Referenced by analyze().

                                                                            {

  using namespace edm;

  Handle<L1GctFibreCollection> fibres;

  L1GctFibreCollection::const_iterator f;
  
  iEvent.getByLabel(label, fibres);

  outFile_ << "Fibres from : " << label.label() << endl;
  for (f=fibres->begin(); f!=fibres->end(); f++) {
    outFile_ << (*f) << endl;
  } 
  outFile_ << endl;
  
}
void DumpGctDigis::doInternEM ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 210 of file DumpGctDigis.cc.

References alignCSCRings::e, edm::Event::getByLabel(), edm::InputTag::label(), and outFile_.

Referenced by analyze().

                                                                              {

  using namespace edm;

  Handle<L1GctInternEmCandCollection> em;

  L1GctInternEmCandCollection::const_iterator e;
  
  iEvent.getByLabel(label, em);

  outFile_ << "Internal EM from : " << label.label() << endl;
  for (e=em->begin(); e!=em->end(); e++) {
    outFile_ << (*e) 
             << " ieta(detID)=" << e->regionId().ieta()
             << " iphi(detID)=" << e->regionId().iphi()
             << endl;
  } 
  outFile_ << endl;
  
}
void DumpGctDigis::doJets ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 173 of file DumpGctDigis.cc.

References edm::Event::getByLabel(), edm::InputTag::label(), and outFile_.

Referenced by analyze().

                                                                          {

  using namespace edm;

  Handle<L1GctJetCandCollection> cenJets;
  Handle<L1GctJetCandCollection> forJets;
  Handle<L1GctJetCandCollection> tauJets;
  
  L1GctJetCandCollection::const_iterator cj;
  L1GctJetCandCollection::const_iterator fj;
  L1GctJetCandCollection::const_iterator tj;
  
  const std::string labelStr = label.label();
  
  iEvent.getByLabel(labelStr,"cenJets",cenJets);
  iEvent.getByLabel(labelStr,"forJets",forJets);
  iEvent.getByLabel(labelStr,"tauJets",tauJets);
  
  outFile_ << "Central jets from : " << labelStr << endl;
  for (cj=cenJets->begin(); cj!=cenJets->end(); cj++) {
    outFile_ << (*cj) << endl;
  } 
  outFile_ << endl;
  
  outFile_ << "Forward jets from : " << labelStr << endl;
  for (fj=forJets->begin(); fj!=forJets->end(); fj++) {
    outFile_ << (*fj) << endl;
  } 
  outFile_ << endl;
  
  outFile_ << "Tau jets from : " << labelStr << endl;
  for (tj=tauJets->begin(); tj!=tauJets->end(); tj++) {
    outFile_ << (*tj) << endl;
  }
}
void DumpGctDigis::doRctEM ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 130 of file DumpGctDigis.cc.

References alignCSCRings::e, edm::Event::getByLabel(), edm::InputTag::label(), outFile_, and rctEmMinRank_.

Referenced by analyze().

                                                                           {

  using namespace edm;

  Handle<L1CaloEmCollection> em;

  L1CaloEmCollection::const_iterator e;
 
  iEvent.getByLabel(label, em);

  outFile_ << "RCT EM from : " << label.label() << endl;
  for (e=em->begin(); e!=em->end(); e++) {
    if (e->rank() >= rctEmMinRank_) {
      outFile_ << (*e) 
               << " ieta(detID)=" << e->regionId().ieta()
               << " iphi(detID)=" << e->regionId().iphi()
               << endl;
    }
  } 
  outFile_ << endl;
  
}
void DumpGctDigis::doRegions ( const edm::Event iEvent,
const edm::InputTag label 
)

Definition at line 154 of file DumpGctDigis.cc.

References edm::Event::getByLabel(), edm::InputTag::label(), outFile_, and alignCSCRings::r.

Referenced by analyze().

                                                                             {

  using namespace edm;

  Handle<L1CaloRegionCollection> rgns;

  L1CaloRegionCollection::const_iterator r;
  
  iEvent.getByLabel(label, rgns);

  outFile_ << "Regions from : " << label.label() << endl;
  for (r=rgns->begin(); r!=rgns->end(); r++) {
    outFile_ << (*r) << endl;
  } 
  outFile_ << endl;

}

Member Data Documentation

bool DumpGctDigis::doEM_ [private]

Definition at line 62 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doEmu_ [private]

Definition at line 60 of file DumpGctDigis.h.

Referenced by analyze().

Definition at line 67 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doFibres_ [private]

Definition at line 66 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doHW_ [private]

Definition at line 59 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doInternEM_ [private]

Definition at line 65 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doJets_ [private]

Definition at line 64 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doRctEM_ [private]

Definition at line 61 of file DumpGctDigis.h.

Referenced by analyze().

bool DumpGctDigis::doRegions_ [private]

Definition at line 63 of file DumpGctDigis.h.

Referenced by analyze().

Definition at line 56 of file DumpGctDigis.h.

Referenced by analyze().

Definition at line 55 of file DumpGctDigis.h.

Referenced by analyze().

std::ofstream DumpGctDigis::outFile_ [private]
std::string DumpGctDigis::outFilename_ [private]

Definition at line 57 of file DumpGctDigis.h.

Referenced by DumpGctDigis().

Definition at line 54 of file DumpGctDigis.h.

Referenced by analyze().

unsigned DumpGctDigis::rctEmMinRank_ [private]

Definition at line 69 of file DumpGctDigis.h.

Referenced by doRctEM().