CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

BigEventsDebugger Class Reference

#include <myTKAnalyses/BigEventsDebugger/src/BigEventsDebugger.cc>

Inheritance diagram for BigEventsDebugger:
edm::EDAnalyzer

List of all members.

Public Member Functions

 BigEventsDebugger (const edm::ParameterSet &)
 ~BigEventsDebugger ()

Private Member Functions

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

Private Attributes

std::vector< unsigned int > m_maskedmod
bool m_singleevents
TH2F * m_tecm2d
TProfile * m_tecmprof
TH2F * m_tecp2d
TProfile * m_tecpprof
TH2F * m_tib2d
TProfile * m_tibprof
TH2F * m_tob2d
TProfile * m_tobprof

Detailed Description

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

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

Definition at line 53 of file BigEventsDebugger.cc.


Constructor & Destructor Documentation

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

Definition at line 92 of file BigEventsDebugger.cc.

References m_maskedmod, m_singleevents, m_tecm2d, m_tecmprof, m_tecp2d, m_tecpprof, m_tib2d, m_tibprof, m_tob2d, m_tobprof, TFileDirectory::make(), TFileDirectory::mkdir(), and python::multivaluedict::sort().

                                                                  :
  m_singleevents(iConfig.getParameter<bool>("singleEvents")),
  m_maskedmod(iConfig.getUntrackedParameter<std::vector<unsigned int> >("maskedModules"))

{
   //now do what ever initialization is needed

  sort(m_maskedmod.begin(),m_maskedmod.end());

  edm::Service<TFileService> tfserv;

  if(!m_singleevents) {
   char dirname[500];
   sprintf(dirname,"Summary");
   TFileDirectory subd = tfserv->mkdir(dirname);
   
   //book histos

   m_tibprof = subd.make<TProfile>("tibprof","TIB Digi charge profile",256,-0.5,255.5);
   m_tobprof = subd.make<TProfile>("tobprof","TOB Digi charge profile",256,-0.5,255.5);
   m_tecpprof = subd.make<TProfile>("tecpprof","TECp Digi charge profile",256,-0.5,255.5);
   m_tecmprof = subd.make<TProfile>("tecmprof","TECm Digi charge profile",256,-0.5,255.5);

   m_tib2d = subd.make<TH2F>("tib2d","TIB Digi charge distribution",256,-0.5,255.5,257,-0.5,256.5);
   m_tob2d = subd.make<TH2F>("tob2d","TOB Digi charge distribution",256,-0.5,255.5,257,-0.5,256.5);
   m_tecp2d = subd.make<TH2F>("tecp2d","TECp Digi charge distribution",256,-0.5,255.5,257,-0.5,256.5);
   m_tecm2d = subd.make<TH2F>("tecm2d","TECm Digi charge distribution",256,-0.5,255.5,257,-0.5,256.5);

  }

}
BigEventsDebugger::~BigEventsDebugger ( )

Definition at line 125 of file BigEventsDebugger.cc.

{

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

}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 141 of file BigEventsDebugger.cc.

References DigiCollectionProfiler::analyze(), edm::EventID::event(), edm::Event::getByLabel(), edm::EventBase::id(), m_maskedmod, m_singleevents, m_tecm2d, m_tecmprof, m_tecp2d, m_tecpprof, m_tib2d, m_tibprof, m_tob2d, m_tobprof, TFileDirectory::mkdir(), edm::Event::run(), and DigiCollectionProfiler::setMaskedModules().

{
   using namespace edm;

   edm::Service<TFileService> tfserv;

   // create a folder for each event

   if(m_singleevents) {

     char dirname[500];
     sprintf(dirname,"event_%u_%u",iEvent.run(),iEvent.id().event());
     TFileDirectory subd = tfserv->mkdir(dirname);
     
     //book histos
     
     m_tibprof = subd.make<TProfile>("tibprof","TIB Digi charge profile",256,-0.5,255.5);
     m_tobprof = subd.make<TProfile>("tobprof","TOB Digi charge profile",256,-0.5,255.5);
     m_tecpprof = subd.make<TProfile>("tecpprof","TECp Digi charge profile",256,-0.5,255.5);
     m_tecmprof = subd.make<TProfile>("tecmprof","TECm Digi charge profile",256,-0.5,255.5);
     
     m_tib2d = subd.make<TH2F>("tib2d","TIB Digi charge distribution",256,-0.5,255.5,257,-0.5,256.5);
     m_tob2d = subd.make<TH2F>("tob2d","TOB Digi charge distribution",256,-0.5,255.5,257,-0.5,256.5);
     m_tecp2d = subd.make<TH2F>("tecp2d","TECp Digi charge distribution",256,-0.5,255.5,257,-0.5,256.5);
     m_tecm2d = subd.make<TH2F>("tecm2d","TECm Digi charge distribution",256,-0.5,255.5,257,-0.5,256.5);

   }

   //analyze event

   DigiCollectionProfiler profiler(m_tibprof,
                                   m_tobprof,
                                   m_tecpprof,
                                   m_tecmprof,
                                   m_tib2d,
                                   m_tob2d,
                                   m_tecp2d,
                                   m_tecm2d);

   Handle<edm::DetSetVector<SiStripDigi> > digis;
   iEvent.getByLabel("siStripDigis","ZeroSuppressed",digis);
   profiler.setMaskedModules(m_maskedmod);
   profiler.analyze(digis);

}
void BigEventsDebugger::beginJob ( const edm::EventSetup ) [private, virtual]

Definition at line 190 of file BigEventsDebugger.cc.

References m_maskedmod.

{
  edm::LogInfo("MaskedModules") << m_maskedmod.size() << " masked modules ";
  for(std::vector<unsigned int>::const_iterator it=m_maskedmod.begin();it!=m_maskedmod.end();it++) {
    edm::LogVerbatim("MaskedModules") << (*it);
  }
}
void BigEventsDebugger::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 200 of file BigEventsDebugger.cc.

                          {
}

Member Data Documentation

std::vector<unsigned int> BigEventsDebugger::m_maskedmod [private]

Definition at line 78 of file BigEventsDebugger.cc.

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

Definition at line 66 of file BigEventsDebugger.cc.

Referenced by analyze(), and BigEventsDebugger().

TH2F* BigEventsDebugger::m_tecm2d [private]

Definition at line 76 of file BigEventsDebugger.cc.

Referenced by analyze(), and BigEventsDebugger().

TProfile* BigEventsDebugger::m_tecmprof [private]

Definition at line 71 of file BigEventsDebugger.cc.

Referenced by analyze(), and BigEventsDebugger().

TH2F* BigEventsDebugger::m_tecp2d [private]

Definition at line 75 of file BigEventsDebugger.cc.

Referenced by analyze(), and BigEventsDebugger().

TProfile* BigEventsDebugger::m_tecpprof [private]

Definition at line 70 of file BigEventsDebugger.cc.

Referenced by analyze(), and BigEventsDebugger().

TH2F* BigEventsDebugger::m_tib2d [private]

Definition at line 73 of file BigEventsDebugger.cc.

Referenced by analyze(), and BigEventsDebugger().

TProfile* BigEventsDebugger::m_tibprof [private]

Definition at line 68 of file BigEventsDebugger.cc.

Referenced by analyze(), and BigEventsDebugger().

TH2F* BigEventsDebugger::m_tob2d [private]

Definition at line 74 of file BigEventsDebugger.cc.

Referenced by analyze(), and BigEventsDebugger().

TProfile* BigEventsDebugger::m_tobprof [private]

Definition at line 69 of file BigEventsDebugger.cc.

Referenced by analyze(), and BigEventsDebugger().