CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
L1TLTC Class Reference

#include <L1TLTC.h>

Inheritance diagram for L1TLTC:
edm::EDAnalyzer

Public Member Functions

 L1TLTC (const edm::ParameterSet &ps)
 
virtual ~L1TLTC ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob (void)
 
void endJob (void)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

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.

17  {
18 
19  // verbosity switch
20  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
21 
22  if(verbose_) cout << "L1TLTC: constructor...." << endl;
23 
24 
25  dbe = NULL;
26  if ( ps.getUntrackedParameter<bool>("DQMStore", false) )
27  {
29  dbe->setVerbose(0);
30  }
31 
32  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
33  if ( outputFile_.size() != 0 ) {
34  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
35  }
36 
37  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
38  if(disable){
39  outputFile_="";
40  }
41 
42 
43  if ( dbe !=NULL ) {
44  dbe->setCurrentFolder("L1T/L1TLTC");
45  }
46 
47 
48 }
T getUntrackedParameter(std::string const &, T const &) const
#define NULL
Definition: scimark2.h:8
bool verbose_
Definition: L1TLTC.h:78
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
std::string outputFile_
Definition: L1TLTC.h:77
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
DQMStore * dbe
Definition: L1TLTC.h:63
L1TLTC::~L1TLTC ( )
virtual

Definition at line 50 of file L1TLTC.cc.

51 {
52 }

Member Function Documentation

void L1TLTC::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 97 of file L1TLTC.cc.

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

98 {
99  nev_++;
100  if(verbose_) cout << "L1TLTC: analyze...." << endl;
102  e.getByType(digis);
103 
104  if (!digis.isValid()) {
105  edm::LogInfo("DataNotFound") << "can't find LTCDigiCollection ";
106  return;
107  }
108 
109  for( LTCDigiCollection::const_iterator digiItr = digis->begin() ;
110  digiItr != digis->end() ;
111  ++digiItr )
112  {
113  h1->Fill( digiItr->bunchNumber() ) ;
114  h2->Fill( digiItr->orbitNumber() ) ;
115 
116  for( int i = 0 ; i < 6 ; ++i ) {
117  h3->Fill( i, ( digiItr->HasTriggered( i ) ? 1 : 0 ) ) ;
118  }
119 
120  h3->Fill( 6, digiItr->ramTrigger() ) ;
121  h3->Fill( 7, digiItr->vmeTrigger() ) ;
122  // overlaps
123  unsigned int setbits = digiItr->externTriggerMask();
124  // mock up the VME and RAM triggers
125  if ( digiItr->ramTrigger() ) {
126  setbits |= (0x1UL<<7);
127  }
128  if ( digiItr->vmeTrigger() ) {
129  setbits |= (0x1UL<<8);
130  }
131  for ( int i = 0; i < 8; ++i ) {
132  if ( setbits & (0x1UL<<i) ) {
133  for ( int j = i; j < 8; ++j ) {
134  if ( setbits & (0x1UL<<j) ) {
135  overlaps->Fill(i,j); // do both....
136  overlaps->Fill(j,i);
137  }
138  }
139  }
140  }
141  // fill floats and ints
142  n_inhibit->Fill(digiItr->triggerInhibitNumber());
143  run ->Fill(digiItr->runNumber());
144  event ->Fill(digiItr->eventNumber());
145  gps_time ->Fill(digiItr->bstGpsTime());
146  }
147 
148 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * gps_time
Definition: L1TLTC.h:74
int nev_
Definition: L1TLTC.h:76
MonitorElement * h1
Definition: L1TLTC.h:66
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
MonitorElement * h3
Definition: L1TLTC.h:68
bool verbose_
Definition: L1TLTC.h:78
void Fill(long long x)
MonitorElement * h2
Definition: L1TLTC.h:67
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:76
MonitorElement * n_inhibit
Definition: L1TLTC.h:71
MonitorElement * overlaps
Definition: L1TLTC.h:70
tuple cout
Definition: gather_cfg.py:121
MonitorElement * run
Definition: L1TLTC.h:72
void L1TLTC::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 54 of file L1TLTC.cc.

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

55 {
56 
57  nev_ = 0;
58 
59  // get hold of back-end interface
60  DQMStore* dbe = 0;
61  dbe = Service<DQMStore>().operator->();
62 
63  if ( dbe ) {
64  dbe->setCurrentFolder("L1T/L1TLTC");
65  dbe->rmdir("L1T/L1TLTC");
66  }
67 
68 
69  if ( dbe )
70  {
71  dbe->setCurrentFolder("L1T/L1TLTC");
72  h1 = dbe->book1D("Bunch", "Bunch Number", 100, -0.5, 5000.) ;
73  h2 = dbe->book1D("Orbit", "Orbit Number", 100, -0.5, 100000. ) ;
74  h3 = dbe->book1D("Triggers", "Triggers", 8, -0.5, 7.5 ) ;
75 
76  overlaps = dbe->book2D("olaps", "Trigger Overlaps", 8, -0.5, 7.5 ,
77  8, -0.5, 7.5);
78 
79  n_inhibit = dbe->bookInt("n_inhibit");
80  run = dbe->bookInt("run");
81  event = dbe->bookInt("event");
82  gps_time = dbe->bookInt("gps_time");
83  }
84 }
MonitorElement * gps_time
Definition: L1TLTC.h:74
int nev_
Definition: L1TLTC.h:76
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2530
MonitorElement * h1
Definition: L1TLTC.h:66
MonitorElement * h3
Definition: L1TLTC.h:68
MonitorElement * h2
Definition: L1TLTC.h:67
MonitorElement * n_inhibit
Definition: L1TLTC.h:71
MonitorElement * overlaps
Definition: L1TLTC.h:70
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * run
Definition: L1TLTC.h:72
DQMStore * dbe
Definition: L1TLTC.h:63
void L1TLTC::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 87 of file L1TLTC.cc.

References gather_cfg::cout.

88 {
89  if(verbose_) cout << "L1TLTC: end job...." << endl;
90  LogInfo("EndJob") << "analyzed " << nev_ << " events";
91 
92  if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_);
93 
94  return;
95 }
int nev_
Definition: L1TLTC.h:76
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
bool verbose_
Definition: L1TLTC.h:78
std::string outputFile_
Definition: L1TLTC.h:77
tuple cout
Definition: gather_cfg.py:121
DQMStore * dbe
Definition: L1TLTC.h:63

Member Data Documentation

DQMStore* L1TLTC::dbe
private

Definition at line 63 of file L1TLTC.h.

MonitorElement* L1TLTC::event
private

Definition at line 73 of file L1TLTC.h.

Referenced by Types.EventID::cppID().

MonitorElement* L1TLTC::gps_time
private

Definition at line 74 of file L1TLTC.h.

MonitorElement* L1TLTC::h1
private
MonitorElement* L1TLTC::h2
private
MonitorElement* L1TLTC::h3
private

Definition at line 68 of file L1TLTC.h.

ofstream L1TLTC::logFile_
private

Definition at line 80 of file L1TLTC.h.

edm::InputTag L1TLTC::ltcSource_
private

Definition at line 81 of file L1TLTC.h.

bool L1TLTC::monitorDaemon_
private

Definition at line 79 of file L1TLTC.h.

MonitorElement* L1TLTC::n_inhibit
private

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.

MonitorElement* L1TLTC::overlaps
private

Definition at line 70 of file L1TLTC.h.

MonitorElement* L1TLTC::run
private
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.