CMS 3D CMS Logo

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 () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 46 of file EcalBxOrbitNumberGrapher.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file EcalBxOrbitNumberGrapher.cc.

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

Definition at line 43 of file EcalBxOrbitNumberGrapher.cc.

43 {}

Member Function Documentation

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

Definition at line 50 of file EcalBxOrbitNumberGrapher.cc.

References edm::SortedCollection< T, SORT >::begin(), bxnumberPlot_, gather_cfg::cout, digiProducer_, edm::SortedCollection< T, SORT >::end(), edm::Event::getByLabel(), edm::EventBase::id(), edm::HandleBase::isValid(), numberofOrbitDiffPlot_, orbitErrorBxDiffPlot_, orbitErrorPlot_, edm::EventID::run(), and runNum_.

50  {
51  using namespace edm;
52  using namespace cms;
53  //int ievt = iEvent.id().event();
54  int orbit = -100;
55  int bx = -100;
56  int numorbiterrors = 0;
57  bool orbiterror = false;
58 
60  iEvent.getByLabel(digiProducer_, DCCHeaders);
61  if (!DCCHeaders.isValid()) {
62  edm::LogError("BxOrbitNumber") << "can't get the product for EcalRawDataCollection";
63  }
64 
65  //-----------------BX STuff here
66  for (EcalRawDataCollection::const_iterator headerItr = DCCHeaders->begin(); headerItr != DCCHeaders->end();
67  ++headerItr) {
68  headerItr->getEventSettings();
69  int myorbit = headerItr->getOrbit();
70  int mybx = headerItr->getBX();
71 
72  if (orbit == -100) {
73  orbit = myorbit;
74  } else if (orbit != myorbit) {
75  std::cout << " NOOOO This header has a conflicting orbit OTHER " << orbit << " new " << myorbit << std::endl;
76  orbiterror = true;
77  numorbiterrors++;
78  orbitErrorBxDiffPlot_->Fill(myorbit - orbit);
79  }
80 
81  if (bx == -100) {
82  bx = mybx;
83  } else if (bx != mybx) {
84  std::cout << " NOOOO This header has a conflicting bx OTHER " << bx << " new " << mybx << std::endl;
85  }
86  //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.
87  }
88 
89  if ((bx != -100) & (orbit != -100)) {
90  std::cout << " Interesting event Orbit " << orbit << " BX " << bx << std::endl;
91  bxnumberPlot_->Fill(bx);
92  if (orbiterror) {
93  orbitErrorPlot_->Fill(bx);
94  }
95  }
96  numberofOrbitDiffPlot_->Fill(numorbiterrors);
97 
98  if (runNum_ == -1) {
99  runNum_ = iEvent.id().run();
100  }
101 }
RunNumber_t run() const
Definition: EventID.h:39
std::vector< T >::const_iterator const_iterator
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
Namespace of DDCMS conversion namespace.
const_iterator end() const
edm::EventID id() const
Definition: EventBase.h:59
HLT enums.
const_iterator begin() const
void EcalBxOrbitNumberGrapher::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 107 of file EcalBxOrbitNumberGrapher.cc.

References bxnumberPlot_, numberofOrbitDiffPlot_, orbitErrorBxDiffPlot_, and orbitErrorPlot_.

107  {
108  bxnumberPlot_ = new TH1F("bxnumber", "BX number of interexting events", 3600, 0., 3600.);
109  orbitErrorPlot_ = new TH1F("bxOfOrbitDiffs", "BX number of interexting events with orbit changes", 3600, 0., 3600.);
111  new TH1F("orbitErrorDiffPlot", "Orbit Difference of those HEADERS that have a difference", 20, -10., 10.);
112  numberofOrbitDiffPlot_ = new TH1F("numberOfOrbitDiffsPlot", "Number of Orbit Differences", 54, 0., 54.);
113 }
void EcalBxOrbitNumberGrapher::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 116 of file EcalBxOrbitNumberGrapher.cc.

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

Referenced by o2olib.O2ORunMgr::executeJob().

116  {
117  using namespace std;
118  fileName_ += ".bx.root";
119 
120  TFile root_file_(fileName_.c_str(), "RECREATE");
121 
122  bxnumberPlot_->Write();
123  orbitErrorPlot_->Write();
124  numberofOrbitDiffPlot_->Write();
125  orbitErrorBxDiffPlot_->Write();
126  root_file_.Close();
127 }
void EcalBxOrbitNumberGrapher::initHists ( int  FED)
private

Definition at line 104 of file EcalBxOrbitNumberGrapher.cc.

104 {}

Member Data Documentation

TH1F* EcalBxOrbitNumberGrapher::bxnumberPlot_
private

Definition at line 63 of file EcalBxOrbitNumberGrapher.h.

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

std::string EcalBxOrbitNumberGrapher::digiProducer_
private

Definition at line 59 of file EcalBxOrbitNumberGrapher.h.

Referenced by analyze().

TFile* EcalBxOrbitNumberGrapher::file
private

Definition at line 68 of file EcalBxOrbitNumberGrapher.h.

Referenced by ztee.GZipLog::finish().

std::string EcalBxOrbitNumberGrapher::fileName_
private

Definition at line 61 of file EcalBxOrbitNumberGrapher.h.

Referenced by endJob().

TH1F* EcalBxOrbitNumberGrapher::numberofOrbitDiffPlot_
private

Definition at line 66 of file EcalBxOrbitNumberGrapher.h.

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

TH1F* EcalBxOrbitNumberGrapher::orbitErrorBxDiffPlot_
private

Definition at line 65 of file EcalBxOrbitNumberGrapher.h.

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

TH1F* EcalBxOrbitNumberGrapher::orbitErrorPlot_
private

Definition at line 64 of file EcalBxOrbitNumberGrapher.h.

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

int EcalBxOrbitNumberGrapher::runNum_
private

Definition at line 60 of file EcalBxOrbitNumberGrapher.h.

Referenced by analyze().