CMS 3D CMS Logo

L1THCALTPG Class Reference

#include <DQM/L1TMonitor/interface/L1THCALTPG.h>

Inheritance diagram for L1THCALTPG:

edm::EDAnalyzer

List of all members.

Public Member Functions

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

Protected Member Functions

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

Private Attributes

DQMStoredbe
MonitorElementhcalTpEtEtaPhi_
edm::InputTag hcaltpgSource_
MonitorElementhcalTpOccEtaPhi_
MonitorElementhcalTpRank_
ofstream logFile_
bool monitorDaemon_
int nev_
std::string outputFile_
bool verbose_


Detailed Description

Definition at line 41 of file L1THCALTPG.h.


Constructor & Destructor Documentation

L1THCALTPG::L1THCALTPG ( const edm::ParameterSet ps  ) 

Definition at line 83 of file L1THCALTPG.cc.

References GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), edm::ParameterSet::getUntrackedParameter(), NULL, outputFile_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), and verbose_.

00084   : hcaltpgSource_( ps.getParameter< InputTag >("hcaltpgSource") )
00085 {
00086 
00087   // verbosity switch
00088   verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
00089 
00090   if(verbose_) std::cout << "L1THCALTPG: constructor...." << std::endl;
00091 
00092 
00093   dbe = NULL;
00094   if ( ps.getUntrackedParameter<bool>("DQMStore", false) ) 
00095   {
00096     dbe = Service<DQMStore>().operator->();
00097     dbe->setVerbose(0);
00098   }
00099 
00100   outputFile_ = ps.getUntrackedParameter<std::string>("outputFile", "");
00101   if ( outputFile_.size() != 0 ) {
00102     std::cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << std::endl;
00103   }
00104 
00105   bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
00106   if(disable){
00107     outputFile_="";
00108   }
00109 
00110 
00111   if ( dbe !=NULL ) {
00112     dbe->setCurrentFolder("L1T/L1THCALTPG");
00113   }
00114 
00115 
00116 }

L1THCALTPG::~L1THCALTPG (  )  [virtual]

Definition at line 118 of file L1THCALTPG.cc.

00119 {
00120 }


Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 163 of file L1THCALTPG.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), MonitorElement::Fill(), edm::Event::getByLabel(), hcalTpEtEtaPhi_, hcaltpgSource_, hcalTpOccEtaPhi_, hcalTpRank_, i, edm::Handle< T >::isValid(), edm::InputTag::label(), nev_, and verbose_.

00164 {
00165   nev_++; 
00166   if(verbose_) std::cout << "L1THCALTPG: analyze...." << std::endl;
00167 
00168   edm::Handle<HcalTrigPrimDigiCollection> hcalTpgs;
00169   e.getByLabel(hcaltpgSource_, hcalTpgs);
00170   
00171   if (!hcalTpgs.isValid()) {
00172     edm::LogInfo("DataNotFound") << "can't find HCAL TPG's with label "
00173                                << hcaltpgSource_.label() ;
00174     return;
00175   }
00176 //
00177 //  std::cout << "--> event  " << hcalTpgs->size() << std::endl;
00178 //   int j = 0;
00179   for ( HcalTrigPrimDigiCollection::const_iterator i = hcalTpgs->begin();
00180         i != hcalTpgs->end(); ++i ) {
00181 
00182     if (verbose_)
00183       {
00184   std::cout << "size  " <<  i->size() << std::endl;
00185   std::cout << "iphi  " <<  i->id().iphi() << std::endl;
00186   std::cout << "ieta  " <<  i->id().ieta() << std::endl;
00187   std::cout << "compressed Et  " <<  i->SOI_compressedEt() << std::endl;
00188   std::cout << "FG bit  " <<  i->SOI_fineGrain() << std::endl;
00189   std::cout << "raw  " <<  i->t0().raw() << std::endl;
00190   std::cout << "raw Et " <<  i->t0().compressedEt() << std::endl;
00191   std::cout << "raw FG " <<  i->t0().fineGrain() << std::endl;
00192   //  std::cout << "raw fiber " <<  i->t0().fiber() << std::endl;
00193   //  std::cout << "raw fiberChan " <<  i->t0().fiberChan() << std::endl;
00194   //  std::cout << "raw fiberAndChan " <<  i->t0().fiberAndChan() << std::endl;
00195       }
00196 
00197    int e = i->SOI_compressedEt();
00198     if ( e != 0 ) {
00199       // occupancy maps (weighted and unweighted
00200       hcalTpOccEtaPhi_->Fill(i->id().iphi(), i->id().ieta());
00201       hcalTpEtEtaPhi_ ->Fill(i->id().iphi(), i->id().ieta(),
00202                              i->SOI_compressedEt());
00203       // et
00204       hcalTpRank_->Fill(i->SOI_compressedEt());
00205       //std::cout << j++ << " : " << i->SOI_compressedEt() << std::endl;
00206     }
00207   }
00208 
00209 }

void L1THCALTPG::beginJob ( const edm::EventSetup c  )  [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 122 of file L1THCALTPG.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe, hcalTpEtEtaPhi_, hcalTpOccEtaPhi_, hcalTpRank_, nev_, DQMStore::rmdir(), RTPBINS, RTPMAX, RTPMIN, DQMStore::setCurrentFolder(), TPETABINS, TPETAMAX, TPETAMIN, TPPHIBINS, TPPHIMAX, and TPPHIMIN.

00123 {
00124 
00125   nev_ = 0;
00126 
00127   // get hold of back-end interface
00128   DQMStore* dbe = 0;
00129   dbe = Service<DQMStore>().operator->();
00130 
00131   if ( dbe ) {
00132     dbe->setCurrentFolder("L1T/L1THCALTPG");
00133     dbe->rmdir("L1T/L1THCALTPG");
00134   }
00135 
00136 
00137   if ( dbe ) 
00138   {
00139     dbe->setCurrentFolder("L1T/L1THCALTPG");
00140     hcalTpEtEtaPhi_ = 
00141       dbe->book2D("HcalTpEtEtaPhi", "HCAL TP E_{T}", TPPHIBINS, TPPHIMIN,
00142                   TPPHIMAX, TPETABINS, TPETAMIN, TPETAMAX);
00143     hcalTpOccEtaPhi_ =
00144         dbe->book2D("HcalTpOccEtaPhi", "HCAL TP OCCUPANCY", TPPHIBINS,
00145                     TPPHIMIN, TPPHIMAX, TPETABINS, TPETAMIN, TPETAMAX);
00146     hcalTpRank_ =
00147       dbe->book1D("HcalTpRank", "HCAL TP RANK", RTPBINS, RTPMIN, RTPMAX);
00148     
00149   }  
00150 }

void L1THCALTPG::endJob ( void   )  [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 153 of file L1THCALTPG.cc.

References GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), nev_, outputFile_, DQMStore::save(), and verbose_.

00154 {
00155   if(verbose_) std::cout << "L1THCALTPG: end job...." << std::endl;
00156   LogInfo("EndJob") << "analyzed " << nev_ << " events"; 
00157 
00158  if ( outputFile_.size() != 0  && dbe ) dbe->save(outputFile_);
00159 
00160  return;
00161 }


Member Data Documentation

DQMStore* L1THCALTPG::dbe [private]

Definition at line 63 of file L1THCALTPG.h.

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

MonitorElement* L1THCALTPG::hcalTpEtEtaPhi_ [private]

Definition at line 66 of file L1THCALTPG.h.

Referenced by analyze(), and beginJob().

edm::InputTag L1THCALTPG::hcaltpgSource_ [private]

Definition at line 75 of file L1THCALTPG.h.

Referenced by analyze().

MonitorElement* L1THCALTPG::hcalTpOccEtaPhi_ [private]

Definition at line 67 of file L1THCALTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1THCALTPG::hcalTpRank_ [private]

Definition at line 68 of file L1THCALTPG.h.

Referenced by analyze(), and beginJob().

ofstream L1THCALTPG::logFile_ [private]

Definition at line 74 of file L1THCALTPG.h.

bool L1THCALTPG::monitorDaemon_ [private]

Definition at line 73 of file L1THCALTPG.h.

int L1THCALTPG::nev_ [private]

Definition at line 70 of file L1THCALTPG.h.

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

std::string L1THCALTPG::outputFile_ [private]

Definition at line 71 of file L1THCALTPG.h.

Referenced by endJob(), and L1THCALTPG().

bool L1THCALTPG::verbose_ [private]

Definition at line 72 of file L1THCALTPG.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:04 2009 for CMSSW by  doxygen 1.5.4