test
CMS 3D CMS Logo

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

#include <EcalBxOrbitNumberGrapher.h>

Inheritance diagram for EcalBxOrbitNumberGrapher:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalBxOrbitNumberGrapher (const edm::ParameterSet &)
 
 ~EcalBxOrbitNumberGrapher ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

TH1F * bxnumberPlot_
 
std::string digiProducer_
 
TFile * file
 
std::string fileName_
 
TH1F * numberofOrbitDiffPlot_
 
TH1F * orbitErrorBxDiffPlot_
 
TH1F * orbitErrorPlot_
 
int runNum_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

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

Definition at line 50 of file EcalBxOrbitNumberGrapher.h.

Constructor & Destructor Documentation

EcalBxOrbitNumberGrapher::EcalBxOrbitNumberGrapher ( const edm::ParameterSet iConfig)
explicit

Definition at line 38 of file EcalBxOrbitNumberGrapher.cc.

38  :
39  digiProducer_(iConfig.getParameter<std::string>("RawDigis")),
40  runNum_(-1),
41  fileName_ (iConfig.getUntrackedParameter<std::string>("fileName", std::string("ecalURechHitHists")))
42 {
43 
44 
45 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EcalBxOrbitNumberGrapher::~EcalBxOrbitNumberGrapher ( )

Definition at line 48 of file EcalBxOrbitNumberGrapher.cc.

49 {
50 }

Member Function Documentation

void EcalBxOrbitNumberGrapher::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 59 of file EcalBxOrbitNumberGrapher.cc.

References bxnumberPlot_, gather_cfg::cout, digiProducer_, edm::Event::getByLabel(), edm::EventBase::id(), numberofOrbitDiffPlot_, orbitErrorBxDiffPlot_, orbitErrorPlot_, edm::EventID::run(), and runNum_.

60 {
61  using namespace edm;
62  using namespace cms;
63  //int ievt = iEvent.id().event();
64  int orbit = -100;
65  int bx = -100;
66  int numorbiterrors = 0;
67  bool orbiterror = false;
68 
69 
71  iEvent.getByLabel(digiProducer_, DCCHeaders);
72  if (!DCCHeaders.isValid()) {
73  edm::LogError("BxOrbitNumber") << "can't get the product for EcalRawDataCollection";
74  }
75 
76  //-----------------BX STuff here
77  for ( EcalRawDataCollection::const_iterator headerItr= DCCHeaders->begin();headerItr != DCCHeaders->end();
78  ++headerItr ) {
79  headerItr->getEventSettings();
80  int myorbit = headerItr->getOrbit();
81  int mybx = headerItr->getBX();
82 
83  if ( orbit == -100 )
84  {
85  orbit = myorbit;
86  }
87  else if (orbit != myorbit)
88  {
89  std::cout << " NOOOO This header has a conflicting orbit OTHER " << orbit << " new " << myorbit << std::endl;
90  orbiterror = true;
91  numorbiterrors++;
92  orbitErrorBxDiffPlot_->Fill(myorbit - orbit);
93  }
94 
95  if ( bx == -100 )
96  {
97  bx = mybx;
98  }
99  else if (bx != mybx)
100  {
101  std::cout << " NOOOO This header has a conflicting bx OTHER " << bx << " new " << mybx << std::endl;
102  }
103  //LogDebug("EcalTimingCosmic") << " Lambda " << lambda; //hmm... this isn't good, I should keep a record of the wavelength in the headers as an inactive SM might have a different wavelength for this field and make this not go through.
104  }
105 
106  if ( (bx != -100) & ( orbit != -100) )
107  {
108  std::cout << " Interesting event Orbit " << orbit << " BX " << bx << std::endl;
109  bxnumberPlot_->Fill(bx);
110  if (orbiterror)
111  {
112  orbitErrorPlot_->Fill(bx);
113  }
114  }
115  numberofOrbitDiffPlot_->Fill(numorbiterrors);
116 
117 
118  if(runNum_==-1)
119  {
120  runNum_ = iEvent.id().run();
121  }
122 }
RunNumber_t run() const
Definition: EventID.h:39
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
edm::EventID id() const
Definition: EventBase.h:59
tuple cout
Definition: gather_cfg.py:145
void EcalBxOrbitNumberGrapher::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 134 of file EcalBxOrbitNumberGrapher.cc.

References bxnumberPlot_, numberofOrbitDiffPlot_, orbitErrorBxDiffPlot_, and orbitErrorPlot_.

135 {
136  bxnumberPlot_ = new TH1F("bxnumber", "BX number of interexting events",3600, 0., 3600.);
137  orbitErrorPlot_ = new TH1F("bxOfOrbitDiffs", "BX number of interexting events with orbit changes",3600, 0., 3600.);
138  orbitErrorBxDiffPlot_ = new TH1F("orbitErrorDiffPlot","Orbit Difference of those HEADERS that have a difference",20,-10.,10.);
139  numberofOrbitDiffPlot_ = new TH1F("numberOfOrbitDiffsPlot","Number of Orbit Differences",54,0., 54.);
140 }
void EcalBxOrbitNumberGrapher::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 144 of file EcalBxOrbitNumberGrapher.cc.

References bxnumberPlot_, fileName_, numberofOrbitDiffPlot_, orbitErrorBxDiffPlot_, and orbitErrorPlot_.

Referenced by o2o.O2ORunMgr::executeJob().

145 {
146  using namespace std;
147  fileName_ += ".bx.root";
148 
149  TFile root_file_(fileName_.c_str() , "RECREATE");
150 
151  bxnumberPlot_->Write();
152  orbitErrorPlot_->Write();
153  numberofOrbitDiffPlot_->Write();
154  orbitErrorBxDiffPlot_->Write();
155  root_file_.Close();
156 
157 }
void EcalBxOrbitNumberGrapher::initHists ( int  FED)
private

Definition at line 126 of file EcalBxOrbitNumberGrapher.cc.

127 {
128 
129 
130 }

Member Data Documentation

TH1F* EcalBxOrbitNumberGrapher::bxnumberPlot_
private

Definition at line 69 of file EcalBxOrbitNumberGrapher.h.

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

std::string EcalBxOrbitNumberGrapher::digiProducer_
private

Definition at line 65 of file EcalBxOrbitNumberGrapher.h.

Referenced by analyze().

TFile* EcalBxOrbitNumberGrapher::file
private

Definition at line 74 of file EcalBxOrbitNumberGrapher.h.

Referenced by ztee.GZipLog::finish().

std::string EcalBxOrbitNumberGrapher::fileName_
private

Definition at line 67 of file EcalBxOrbitNumberGrapher.h.

Referenced by endJob().

TH1F* EcalBxOrbitNumberGrapher::numberofOrbitDiffPlot_
private

Definition at line 72 of file EcalBxOrbitNumberGrapher.h.

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

TH1F* EcalBxOrbitNumberGrapher::orbitErrorBxDiffPlot_
private

Definition at line 71 of file EcalBxOrbitNumberGrapher.h.

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

TH1F* EcalBxOrbitNumberGrapher::orbitErrorPlot_
private

Definition at line 70 of file EcalBxOrbitNumberGrapher.h.

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

int EcalBxOrbitNumberGrapher::runNum_
private

Definition at line 66 of file EcalBxOrbitNumberGrapher.h.

Referenced by analyze().