CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

L1TLTC Class Reference

#include <L1TLTC.h>

Inheritance diagram for L1TLTC:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Protected Member Functions

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

Private Attributes

DQMStoredbe
MonitorElementevent
MonitorElementgps_time
MonitorElementh1
MonitorElementh2
MonitorElementh3
ofstream logFile_
edm::InputTag ltcSource_
bool monitorDaemon_
MonitorElementn_inhibit
int nev_
std::string outputFile_
MonitorElementoverlaps
MonitorElementrun
bool verbose_
float XMAX
float XMIN

Detailed Description

Definition at line 41 of file L1TLTC.h.


Constructor & Destructor Documentation

L1TLTC::L1TLTC ( const edm::ParameterSet ps)

Definition at line 16 of file L1TLTC.cc.

References gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), NULL, and cppFunctionSkipper::operator.

 {

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

  if(verbose_) cout << "L1TLTC: 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/L1TLTC");
  }


}
L1TLTC::~L1TLTC ( ) [virtual]

Definition at line 50 of file L1TLTC.cc.

{
}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 97 of file L1TLTC.cc.

References gather_cfg::cout, edm::Event::getByType(), i, edm::HandleBase::isValid(), j, analyzePatCleaning_cfg::overlaps, and DTTTrigCorrFirst::run.

{
  nev_++; 
  if(verbose_) cout << "L1TLTC: analyze...." << endl;
  Handle< LTCDigiCollection > digis ;
  e.getByType(digis);
  
  if (!digis.isValid()) {
    edm::LogInfo("DataNotFound") << "can't find LTCDigiCollection ";
    return;
  }

  for( LTCDigiCollection::const_iterator digiItr = digis->begin() ;
       digiItr != digis->end() ;
       ++digiItr )
    {
      h1->Fill( digiItr->bunchNumber() ) ;
      h2->Fill( digiItr->orbitNumber() ) ;

      for( int i = 0 ; i < 6 ; ++i )    {
        h3->Fill( i, ( digiItr->HasTriggered( i ) ? 1 : 0 ) ) ;
      }

      h3->Fill( 6, digiItr->ramTrigger() ) ;
      h3->Fill( 7, digiItr->vmeTrigger() ) ;
      // overlaps
      unsigned int setbits = digiItr->externTriggerMask();
      // mock up the VME and RAM triggers
      if ( digiItr->ramTrigger() ) {
        setbits |= (0x1UL<<7);
      }
      if ( digiItr->vmeTrigger() ) {
        setbits |= (0x1UL<<8);
      }
      for ( int i = 0; i < 8; ++i ) {
        if ( setbits & (0x1UL<<i) ) {
          for ( int j = i; j < 8; ++j ) {
            if ( setbits & (0x1UL<<j) ) {
              overlaps->Fill(i,j); // do both....
              overlaps->Fill(j,i);
            }
          }
        }
      }
      // fill floats and ints
      n_inhibit->Fill(digiItr->triggerInhibitNumber());
      run      ->Fill(digiItr->runNumber());
      event    ->Fill(digiItr->eventNumber());
      gps_time ->Fill(digiItr->bstGpsTime());
    }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 54 of file L1TLTC.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookInt(), cppFunctionSkipper::operator, analyzePatCleaning_cfg::overlaps, DQMStore::rmdir(), DTTTrigCorrFirst::run, and DQMStore::setCurrentFolder().

{

  nev_ = 0;

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

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


  if ( dbe ) 
  {
    dbe->setCurrentFolder("L1T/L1TLTC");
    h1 = dbe->book1D("Bunch", "Bunch Number", 100, -0.5, 5000.) ;
    h2 = dbe->book1D("Orbit", "Orbit Number", 100, -0.5, 100000. ) ;
    h3 = dbe->book1D("Triggers", "Triggers", 8, -0.5, 7.5 ) ;

    overlaps = dbe->book2D("olaps", "Trigger Overlaps", 8, -0.5, 7.5 ,
                         8, -0.5, 7.5);
                         
    n_inhibit    = dbe->bookInt("n_inhibit");
    run          = dbe->bookInt("run");
    event        = dbe->bookInt("event");
    gps_time     = dbe->bookInt("gps_time");
  }  
}
void L1TLTC::endJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 87 of file L1TLTC.cc.

References gather_cfg::cout.

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

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

 return;
}

Member Data Documentation

DQMStore* L1TLTC::dbe [private]

Definition at line 63 of file L1TLTC.h.

Definition at line 73 of file L1TLTC.h.

Definition at line 74 of file L1TLTC.h.

Definition at line 66 of file L1TLTC.h.

Definition at line 67 of file L1TLTC.h.

Definition at line 68 of file L1TLTC.h.

ofstream L1TLTC::logFile_ [private]

Definition at line 80 of file L1TLTC.h.

Definition at line 81 of file L1TLTC.h.

bool L1TLTC::monitorDaemon_ [private]

Definition at line 79 of file L1TLTC.h.

Definition at line 71 of file L1TLTC.h.

int L1TLTC::nev_ [private]

Definition at line 76 of file L1TLTC.h.

std::string L1TLTC::outputFile_ [private]

Definition at line 77 of file L1TLTC.h.

Definition at line 70 of file L1TLTC.h.

Definition at line 72 of file L1TLTC.h.

bool L1TLTC::verbose_ [private]

Definition at line 78 of file L1TLTC.h.

float L1TLTC::XMAX [private]

Definition at line 75 of file L1TLTC.h.

float L1TLTC::XMIN [private]

Definition at line 75 of file L1TLTC.h.