CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

DTLocalTriggerBaseTest Class Reference

#include <DTLocalTriggerBaseTest.h>

Inheritance diagram for DTLocalTriggerBaseTest:
edm::EDAnalyzer DTFineDelayCorr DTLocalTriggerEfficiencyTest DTLocalTriggerLutTest DTLocalTriggerSynchTest DTLocalTriggerTest DTLocalTriggerTPTest DTTriggerEfficiencyTest

List of all members.

Public Member Functions

 DTLocalTriggerBaseTest ()
 Constructor.
virtual ~DTLocalTriggerBaseTest ()
 Destructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze.
void beginJob ()
 BeginJob.
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 Perform begin lumiblock operations.
void beginRun (edm::Run const &run, edm::EventSetup const &context)
 BeginRun.
void bookCmsHistos (std::string hTag, std::string folder="")
 Book the new MEs (CMS summary)
void bookSectorHistos (int wheel, int sector, std::string hTag, std::string folder="")
 Book the new MEs (for each sector)
void bookWheelHistos (int wheel, std::string hTag, std::string folder="")
 Book the new MEs (for each wheel)
std::string category ()
 Get message logger name.
void endJob ()
 EndJob.
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 Perform client diagnostic in online.
void endRun (edm::Run const &run, edm::EventSetup const &context)
 Perform client diagnostic in offline.
std::string fullName (std::string htype)
 Create fullname from histo partial name.
template<class T >
T * getHisto (MonitorElement *me)
 Convert ME to Histogram fo type T.
std::string getMEName (std::string histoTag, std::string subfolder, const DTChamberId &chambid)
 Get the ME name (by chamber)
std::string getMEName (std::string histoTag, std::string subfolder, int wh)
 Get the ME name (by wheel)
std::pair< float, float > phiRange (const DTChamberId &id)
 Calculate phi range for histograms.
virtual void runClientDiagnostic ()=0
 Perform client analysis.
void setConfig (const edm::ParameterSet &ps, std::string name)
 Set configuration variables.
std::string & topFolder (bool isDCC)
 Get top folder name.

Protected Attributes

std::string baseFolderDCC
std::string baseFolderDDU
std::map< std::string,
MonitorElement * > 
cmsME
DQMStoredbe
std::string hwSource
std::vector< std::string > hwSources
edm::ESHandle< DTGeometrymuonGeom
int nevents
unsigned int nLumiSegs
edm::ParameterSet parameters
int prescaleFactor
int run
bool runOnline
std::map< int, std::map
< std::string, MonitorElement * > > 
secME
std::string sourceFolder
std::string testName
std::string trigSource
std::vector< std::string > trigSources
std::map< int, std::map
< std::string, MonitorElement * > > 
whME

Detailed Description

* DQM Base for TriggerTests

Date:
2010/01/26 17:46:03
Revision:
1.9
Author:
C. Battilana S. Marcellini - INFN Bologna

Definition at line 39 of file DTLocalTriggerBaseTest.h.


Constructor & Destructor Documentation

DTLocalTriggerBaseTest::DTLocalTriggerBaseTest ( ) [inline]

Constructor.

Definition at line 44 of file DTLocalTriggerBaseTest.h.

{};
DTLocalTriggerBaseTest::~DTLocalTriggerBaseTest ( ) [virtual]

Destructor.

Definition at line 36 of file DTLocalTriggerBaseTest.cc.

References category(), and nevents.

                                               {

  LogVerbatim(category()) << "[" << testName << "Test]: analyzed " << nevents << " events";

}

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 67 of file DTLocalTriggerBaseTest.cc.

References category(), LogTrace, and nevents.

                                                                                   {

  nevents++;
  LogTrace(category()) << "[" << testName << "Test]: "<<nevents<<" events";

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

BeginJob.

Reimplemented from edm::EDAnalyzer.

Reimplemented in DTFineDelayCorr, DTLocalTriggerLutTest, DTLocalTriggerSynchTest, DTLocalTriggerTest, DTLocalTriggerTPTest, and DTTriggerEfficiencyTest.

Definition at line 42 of file DTLocalTriggerBaseTest.cc.

References category(), and nevents.

                                     {

  LogVerbatim(category()) << "[" << testName << "Test]: BeginJob";
  nevents = 0;
  nLumiSegs = 0;
  
}
void DTLocalTriggerBaseTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
) [protected, virtual]

Perform begin lumiblock operations.

Reimplemented from edm::EDAnalyzer.

Definition at line 57 of file DTLocalTriggerBaseTest.cc.

References category(), LogTrace, CrabTask::run, and edm::LuminosityBlockBase::run().

                                                                                                           {

  LogTrace(category()) <<"[" << testName << "Test]: Begin of LS transition";

  // Get the run number
  run = lumiSeg.run();

}
void DTLocalTriggerBaseTest::beginRun ( edm::Run const &  run,
edm::EventSetup const &  context 
) [protected, virtual]
void DTLocalTriggerBaseTest::bookCmsHistos ( std::string  hTag,
std::string  folder = "" 
) [protected]

Book the new MEs (CMS summary)

Definition at line 262 of file DTLocalTriggerBaseTest.cc.

References category(), newFWLiteAna::fullName, LogTrace, and MonitorElement::setAxisTitle().

                                                                    {

  bool isDCC = hwSource == "DCC"; 
  string basedir = topFolder(isDCC);
  if (folder != "") {
    basedir += folder +"/" ;
  }
  dbe->setCurrentFolder(basedir);

  string hname = fullName(hTag);
  LogTrace(category()) << "[" << testName << "Test]: booking " << basedir << hname;


  MonitorElement* me = dbe->book2D(hname.c_str(),hname.c_str(),12,1,13,5,-2,3);
  me->setAxisTitle("Sector",1);
  me->setAxisTitle("Wheel",2);
  cmsME[hname] = me;

}
void DTLocalTriggerBaseTest::bookSectorHistos ( int  wheel,
int  sector,
std::string  hTag,
std::string  folder = "" 
) [protected]

Book the new MEs (for each sector)

Definition at line 200 of file DTLocalTriggerBaseTest.cc.

References category(), newFWLiteAna::fullName, LogTrace, and MonitorElement::setBinLabel().

Referenced by DTLocalTriggerEfficiencyTest::beginRun(), and DTLocalTriggerEfficiencyTest::runClientDiagnostic().

                                                                                            {
  
  stringstream wh; wh << wheel;
  stringstream sc; sc << sector;
  int sectorid = (wheel+3) + (sector-1)*5;
  bool isDCC = hwSource=="DCC" ;
  string basedir = topFolder(isDCC)+"Wheel"+wh.str()+"/Sector"+sc.str()+"/";
  if (folder!="") {
    basedir += folder +"/";
  }
  dbe->setCurrentFolder(basedir);

  string fullTag = fullName(hTag);
  string hname    = fullTag + "_W" + wh.str()+"_Sec" +sc.str();
  LogTrace(category()) << "[" << testName << "Test]: booking " << basedir << hname;
  if (hTag.find("BXDistribPhi") != string::npos){    
    MonitorElement* me = dbe->book2D(hname.c_str(),hname.c_str(),25,-4.5,20.5,4,0.5,4.5);
    me->setBinLabel(1,"MB1",2);
    me->setBinLabel(2,"MB2",2);
    me->setBinLabel(3,"MB3",2);
    me->setBinLabel(4,"MB4",2);
    secME[sectorid][fullTag] = me;
    return;
  }
  else if (hTag.find("QualDistribPhi") != string::npos){    
    MonitorElement* me = dbe->book2D(hname.c_str(),hname.c_str(),7,-0.5,6.5,4,0.5,4.5);
    me->setBinLabel(1,"MB1",2);
    me->setBinLabel(2,"MB2",2);
    me->setBinLabel(3,"MB3",2);
    me->setBinLabel(4,"MB4",2);
    me->setBinLabel(1,"LI",1);
    me->setBinLabel(2,"LO",1);
    me->setBinLabel(3,"HI",1);
    me->setBinLabel(4,"HO",1);
    me->setBinLabel(5,"LL",1);
    me->setBinLabel(6,"HL",1);
    me->setBinLabel(7,"HH",1);
    secME[sectorid][fullTag] = me;
    return;
  }
  else if (hTag.find("Phi") != string::npos || 
      hTag.find("TkvsTrig") != string::npos ){    
    MonitorElement* me = dbe->book1D(hname.c_str(),hname.c_str(),4,0.5,4.5);
    me->setBinLabel(1,"MB1",1);
    me->setBinLabel(2,"MB2",1);
    me->setBinLabel(3,"MB3",1);
    me->setBinLabel(4,"MB4",1);
    secME[sectorid][fullTag] = me;
    return;
  }
  
  if (hTag.find("Theta") != string::npos){
    MonitorElement* me =dbe->book1D(hname.c_str(),hname.c_str(),3,0.5,3.5);
    me->setBinLabel(1,"MB1",1);
    me->setBinLabel(2,"MB2",1);
    me->setBinLabel(3,"MB3",1);
    secME[sectorid][fullTag] = me;
    return;
  }
  
}
void DTLocalTriggerBaseTest::bookWheelHistos ( int  wheel,
std::string  hTag,
std::string  folder = "" 
) [protected]
std::string DTLocalTriggerBaseTest::category ( ) [inline, protected]

Get message logger name.

Definition at line 112 of file DTLocalTriggerBaseTest.h.

Referenced by DTTriggerEfficiencyTest::bookChambHistos().

{ return "DTDQM|DTMonitorClient|" + testName + "Test"; } ;
void DTLocalTriggerBaseTest::endJob ( void  ) [protected, virtual]

EndJob.

Reimplemented from edm::EDAnalyzer.

Reimplemented in DTFineDelayCorr, and DTLocalTriggerSynchTest.

Definition at line 91 of file DTLocalTriggerBaseTest.cc.

References category(), and LogTrace.

Referenced by DTFineDelayCorr::endJob(), and DTLocalTriggerSynchTest::endJob().

                                   {
  
    LogTrace(category()) << "[" << testName << "Test] endJob called!";

}
void DTLocalTriggerBaseTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
) [protected, virtual]

Perform client diagnostic in online.

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file DTLocalTriggerBaseTest.cc.

References ExpressReco_HICollisions_FallBack::prescaleFactor.

                                                                                                               {
  
  if (!runOnline) return;

  LogVerbatim("DTDQM|DTMonitorClient|DTLocalTriggerTest") <<"[" << testName << "Test]: End of LS transition, performing the DQM client operation";

  // counts number of lumiSegs and prescale
  nLumiSegs++;
  if ( nLumiSegs%prescaleFactor != 0 ) return;

  LogVerbatim("DTDQM|DTMonitorClient|DTLocalTriggerTest") <<"[" << testName << "Test]: "<<nLumiSegs<<" updates";  
  runClientDiagnostic();

}
void DTLocalTriggerBaseTest::endRun ( edm::Run const &  run,
edm::EventSetup const &  context 
) [protected, virtual]

Perform client diagnostic in offline.

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file DTLocalTriggerBaseTest.cc.

References category(), and LogTrace.

                                                                             {
  
  LogTrace(category()) << "[" << testName << "Test] endRun called!";

  if (!runOnline) {
    LogVerbatim(category()) << "[" << testName << "Test] Client called in offline mode, performing client operations";
    runClientDiagnostic();
  }

}
std::string DTLocalTriggerBaseTest::fullName ( std::string  htype) [protected]

Create fullname from histo partial name.

Referenced by DTTriggerEfficiencyTest::bookChambHistos(), and DTLocalTriggerEfficiencyTest::runClientDiagnostic().

template<class T >
T * DTLocalTriggerBaseTest::getHisto ( MonitorElement me) [protected]

Convert ME to Histogram fo type T.

Definition at line 141 of file DTLocalTriggerBaseTest.h.

References MonitorElement::getRootObject().

                                                      {
  return me ? dynamic_cast<T*>(me->getRootObject()) : 0;
}
std::string DTLocalTriggerBaseTest::getMEName ( std::string  histoTag,
std::string  subfolder,
const DTChamberId chambid 
) [protected]

Get the ME name (by chamber)

Referenced by DTLocalTriggerEfficiencyTest::runClientDiagnostic().

std::string DTLocalTriggerBaseTest::getMEName ( std::string  histoTag,
std::string  subfolder,
int  wh 
) [protected]

Get the ME name (by wheel)

pair< float, float > DTLocalTriggerBaseTest::phiRange ( const DTChamberId id) [protected]

Calculate phi range for histograms.

Definition at line 333 of file DTLocalTriggerBaseTest.cc.

References DTLayerId, DTTopology::firstChannel(), DTTopology::lastChannel(), edm::max(), edm::min(), GeomDet::position(), DTLayer::specificTopology(), GeomDet::toLocal(), DTTopology::wirePosition(), and ExpressReco_HICollisions_FallBack::x.

                                                                       {

  float min,max;
  int station = id.station();
  int sector  = id.sector(); 
  int wheel   = id.wheel();
  
  const DTLayer  *layer = muonGeom->layer(DTLayerId(id,1,1));
  DTTopology topo = layer->specificTopology();
  min = topo.wirePosition(topo.firstChannel());
  max = topo.wirePosition(topo.lastChannel());

  if (station == 4){
    
    const DTLayer *layer2;
    float lposx;
    
    if (sector == 4){
      layer2  = muonGeom->layer(DTLayerId(wheel,station,13,1,1));
      lposx = layer->toLocal(layer2->position()).x();
    }
    else if (sector == 10){
      layer2 = muonGeom->layer(DTLayerId(wheel,station,14,1,1));
      lposx = layer->toLocal(layer2->position()).x();
    }
    else
      return make_pair(min,max);
    
    DTTopology topo2 = layer2->specificTopology();

    if (lposx>0){
      max = lposx*.5+topo2.wirePosition(topo2.lastChannel());
      min -= lposx*.5;
    }
    else{
      min = lposx*.5+topo2.wirePosition(topo2.firstChannel());
      max -= lposx*.5;
    }
      
  }
  
  return make_pair(min,max);

}
virtual void DTLocalTriggerBaseTest::runClientDiagnostic ( ) [protected, pure virtual]
void DTLocalTriggerBaseTest::setConfig ( const edm::ParameterSet ps,
std::string  name 
) [protected]

Set configuration variables.

Referenced by DTLocalTriggerEfficiencyTest::DTLocalTriggerEfficiencyTest().

std::string& DTLocalTriggerBaseTest::topFolder ( bool  isDCC) [inline, protected]

Get top folder name.

Definition at line 109 of file DTLocalTriggerBaseTest.h.

References baseFolderDCC, and baseFolderDDU.

Referenced by DTTriggerEfficiencyTest::bookChambHistos().

{ return isDCC ? baseFolderDCC : baseFolderDDU; } ;

Member Data Documentation

std::string DTLocalTriggerBaseTest::baseFolderDCC [protected]
std::string DTLocalTriggerBaseTest::baseFolderDDU [protected]
std::map<std::string,MonitorElement*> DTLocalTriggerBaseTest::cmsME [protected]

Definition at line 135 of file DTLocalTriggerBaseTest.h.

std::string DTLocalTriggerBaseTest::hwSource [protected]
std::vector<std::string> DTLocalTriggerBaseTest::hwSources [protected]

Definition at line 132 of file DTLocalTriggerBaseTest.h.

Referenced by DTLocalTriggerEfficiencyTest::beginRun().

Definition at line 112 of file DTLocalTriggerBaseTest.h.

unsigned int DTLocalTriggerBaseTest::nLumiSegs [protected]

Definition at line 117 of file DTLocalTriggerBaseTest.h.

Definition at line 126 of file DTLocalTriggerBaseTest.h.

Referenced by DTLocalTriggerEfficiencyTest::beginRun().

Definition at line 118 of file DTLocalTriggerBaseTest.h.

int DTLocalTriggerBaseTest::run [protected]

Definition at line 119 of file DTLocalTriggerBaseTest.h.

Definition at line 127 of file DTLocalTriggerBaseTest.h.

std::map<int,std::map<std::string,MonitorElement*> > DTLocalTriggerBaseTest::secME [protected]
std::string DTLocalTriggerBaseTest::sourceFolder [protected]

Definition at line 125 of file DTLocalTriggerBaseTest.h.

std::string DTLocalTriggerBaseTest::testName [protected]

Definition at line 120 of file DTLocalTriggerBaseTest.h.

Referenced by DTTriggerEfficiencyTest::bookChambHistos().

std::string DTLocalTriggerBaseTest::trigSource [protected]
std::vector<std::string> DTLocalTriggerBaseTest::trigSources [protected]
std::map<int,std::map<std::string,MonitorElement*> > DTLocalTriggerBaseTest::whME [protected]