CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

L1TCSCTPG Class Reference

#include <L1TCSCTPG.h>

Inheritance diagram for L1TCSCTPG:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Protected Member Functions

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

Private Attributes

MonitorElementcsctpgbend
MonitorElementcsctpgbx
MonitorElementcsctpgpattern
MonitorElementcsctpgquality
edm::InputTag csctpgSource_
MonitorElementcsctpgstrip
MonitorElementcsctpgstriptype
MonitorElementcsctpgwg
DQMStoredbe
ofstream logFile_
bool monitorDaemon_
int nev_
std::string outputFile_
bool verbose_

Detailed Description

Definition at line 42 of file L1TCSCTPG.h.


Constructor & Destructor Documentation

L1TCSCTPG::L1TCSCTPG ( const edm::ParameterSet ps)

Definition at line 16 of file L1TCSCTPG.cc.

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

  : csctpgSource_( ps.getParameter< InputTag >("csctpgSource") )
{

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

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


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

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

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


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


}
L1TCSCTPG::~L1TCSCTPG ( ) [virtual]

Definition at line 51 of file L1TCSCTPG.cc.

{
}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 104 of file L1TCSCTPG.cc.

References gather_cfg::cout, csctpgbend, csctpgbx, csctpgpattern, csctpgquality, csctpgSource_, csctpgstrip, csctpgstriptype, csctpgwg, MonitorElement::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), edm::InputTag::label(), nev_, and verbose_.

{
  nev_++; 
  if(verbose_) cout << "L1TCSCTPG: analyze...." << endl;


  Handle<CSCCorrelatedLCTDigiCollection> pCSCTPGcorrlcts;
  e.getByLabel(csctpgSource_,pCSCTPGcorrlcts);
    
  if (!pCSCTPGcorrlcts.isValid()) {
    edm::LogInfo("DataNotFound") << "can't find CSCCorrelatedLCTDigiCollection with label "
                               << csctpgSource_.label() ;
    return;
  }
  

  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator cscItr1 = pCSCTPGcorrlcts->begin();
       cscItr1 != pCSCTPGcorrlcts->end();
       cscItr1++)
    {
     CSCCorrelatedLCTDigiCollection::Range range1 = pCSCTPGcorrlcts->get((*cscItr1).first);
     for (CSCCorrelatedLCTDigiCollection::const_iterator lctItr1 = range1.first;
           lctItr1 != range1.second;
           lctItr1++) 
        {


     csctpgpattern->Fill(lctItr1->getCLCTPattern());
    if (verbose_)
       {     
     std::cout << "CSC TPG CLCT pattern " << lctItr1->getCLCTPattern()  
            << std::endl;
       }

     csctpgquality->Fill(lctItr1->getQuality());     
     if (verbose_)
       {
     std::cout << "CSC LCT quality " << lctItr1->getQuality()  
            << std::endl;
       }

     csctpgwg->Fill(lctItr1->getKeyWG());     
     if (verbose_)
        {
     std::cout << "CSC LCT wire group " << lctItr1->getKeyWG()  
            << std::endl;
        }

     csctpgstrip->Fill(lctItr1->getStrip());     
     if (verbose_)
        {     
     std::cout << "CSC LCT strip " << lctItr1->getStrip()  
            << std::endl;
        }

     csctpgstriptype->Fill(lctItr1->getStripType());    
     if (verbose_)
       { 
     std::cout << "CSC LCT strip type" << lctItr1->getStripType()  
            << std::endl;
       }

     csctpgbend->Fill(lctItr1->getBend());     
     if (verbose_)
       {
     std::cout << "CSC LCT bend " << lctItr1->getBend()  
            << std::endl;
       }

     csctpgbx->Fill(lctItr1->getBX());
     if (verbose_)
        {     
     std::cout << "CSC LCT bx " << lctItr1->getBX()  
            << std::endl;
        }

     }
    }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 55 of file L1TCSCTPG.cc.

References DQMStore::book1D(), csctpgbend, csctpgbx, csctpgpattern, csctpgquality, csctpgstrip, csctpgstriptype, csctpgwg, dbe, nev_, cppFunctionSkipper::operator, 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/L1TCSCTPG");
    dbe->rmdir("L1T/L1TCSCTPG");
  }


  if ( dbe ) 
  {
    dbe->setCurrentFolder("L1T/L1TCSCTPG");
    
    csctpgpattern = dbe->book1D("CSC TPG hit pattern", 
       "CSC TPG hit pattern", 8, -0.5, 7.5 ) ;
    csctpgquality = dbe->book1D("CSC TPG quality", 
       "CSC TPG quality", 16, 0.5, 16.5 ) ;
    csctpgwg = dbe->book1D("CSC TPG wire group", 
       "CSC TPG wire group", 116, -0.5, 115.5 ) ;
    csctpgstrip = dbe->book1D("CSC TPG strip", 
       "CSC TPG strip", 160, -0.5, 159.5 ) ;
    csctpgstriptype = dbe->book1D("CSC TPG strip type", 
       "CSC TPG strip type", 2, 0.5, 1.5 ) ;
    csctpgbend = dbe->book1D("CSC TPG bend", 
       "CSC TPG bend", 3, 0.5, 2.5 ) ;
    csctpgbx = dbe->book1D("CSC TPG bx", 
       "CSC TPG bx", 20, -0.5, 19.5 ) ;


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

Reimplemented from edm::EDAnalyzer.

Definition at line 94 of file L1TCSCTPG.cc.

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

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

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

 return;
}

Member Data Documentation

Definition at line 71 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 72 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 66 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 67 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 79 of file L1TCSCTPG.h.

Referenced by analyze().

Definition at line 69 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 70 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 68 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

Definition at line 64 of file L1TCSCTPG.h.

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

ofstream L1TCSCTPG::logFile_ [private]

Definition at line 78 of file L1TCSCTPG.h.

bool L1TCSCTPG::monitorDaemon_ [private]

Definition at line 77 of file L1TCSCTPG.h.

int L1TCSCTPG::nev_ [private]

Definition at line 74 of file L1TCSCTPG.h.

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

std::string L1TCSCTPG::outputFile_ [private]

Definition at line 75 of file L1TCSCTPG.h.

Referenced by endJob(), and L1TCSCTPG().

bool L1TCSCTPG::verbose_ [private]

Definition at line 76 of file L1TCSCTPG.h.

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