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 Attributes
SiStripBaselineValidator Class Reference

#include <SiStripBaselineValidator.h>

Inheritance diagram for SiStripBaselineValidator:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual void endJob ()
 analyzer loop More...
 
 SiStripBaselineValidator (const edm::ParameterSet &)
 
virtual ~SiStripBaselineValidator ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool createOutputFile_
 
DQMStoredbe
 
MonitorElementh1ADC_vs_strip_
 
MonitorElementh1NumbadAPVsRes_
 
edm::EDGetTokenT
< edm::DetSetVector
< SiStripRawDigi > > 
moduleRawDigiToken_
 
std::string outputFile_
 
edm::InputTag srcProcessedRawDigi_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Definition at line 40 of file SiStripBaselineValidator.h.

Constructor & Destructor Documentation

SiStripBaselineValidator::SiStripBaselineValidator ( const edm::ParameterSet conf)
explicit

Definition at line 45 of file SiStripBaselineValidator.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

45  {
46 
47  srcProcessedRawDigi_ = conf.getParameter<edm::InputTag>( "srcProcessedRawDigi" );
48  // hiSelectedTracks = conf.getParameter<edm::InputTag>( "hiSelectedTracks" );
49  createOutputFile_ = conf.getUntrackedParameter<bool>("saveFile",false);
50  outputFile_ = conf.getParameter<std::string>("outputFile");
52  moduleRawDigiToken_ = consumes<edm::DetSetVector<SiStripRawDigi> >(conf.getParameter<edm::InputTag>( "srcProcessedRawDigi" ) );
53 
54 
55 
56 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > moduleRawDigiToken_
SiStripBaselineValidator::~SiStripBaselineValidator ( )
virtual

Definition at line 58 of file SiStripBaselineValidator.cc.

59 {
60 }

Member Function Documentation

void SiStripBaselineValidator::analyze ( const edm::Event e,
const edm::EventSetup es 
)
virtual

loop over modules

loop over strips

adc vs strip

strip loop ends

module loop

std::cout<< " napvs : " << NumResAPVs << std::endl;

for all modules

Implements edm::stream::EDAnalyzerBase.

Definition at line 83 of file SiStripBaselineValidator.cc.

References ecalMGPA::adc(), edm::DetSetVector< T >::begin(), edm::DetSetVector< T >::end(), and edm::Event::getByToken().

84 {
86  e.getByToken( moduleRawDigiToken_, moduleRawDigi );
87  edm::DetSetVector<SiStripRawDigi>::const_iterator itRawDigis = moduleRawDigi->begin();
88 
89  int NumResAPVs=0;
90  for (; itRawDigis != moduleRawDigi->end(); ++itRawDigis) {
91 
92 
94  int strip =0, totADC=0;
95 
96  for(;itRaw != itRawDigis->end(); ++itRaw, ++strip){
97 
98  float adc = itRaw->adc();
99  h1ADC_vs_strip_->Fill(strip,adc);
100 
101 
102 
103  totADC+= adc;
104 
105  if(strip%127 ==0){
106  if(totADC!= 0){
107  totADC =0;
108 
109  NumResAPVs++;
110 
111  }
112  }
113 
114  }
115 
116 
117  }
118 
120 
121  h1NumbadAPVsRes_->Fill(NumResAPVs);
122 
123 
124 
125 }
int adc(sample_type sample)
get the ADC sample (12 bits)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
void Fill(long long x)
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:363
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:348
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > moduleRawDigiToken_
void SiStripBaselineValidator::beginJob ( void  )
virtual

Definition at line 78 of file SiStripBaselineValidator.cc.

79 {
80 
81 }
void SiStripBaselineValidator::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overridevirtual

Setting the DQM top directories

Implements DQMEDAnalyzer.

Definition at line 62 of file SiStripBaselineValidator.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::setCurrentFolder(), and DQMStore::IBooker::tag().

63 {
65  ibooker.setCurrentFolder("SiStrip/BaselineValidator");
66 
67  h1NumbadAPVsRes_ = ibooker.book1D("ResAPVs",";#ResAPVs", 100, 1.0, 10001);
68  //dbe->tag(h1NumbadAPVsRes_->getFullname(),1);
69  ibooker.tag(h1NumbadAPVsRes_,1);
70 
71  h1ADC_vs_strip_ = ibooker.book2D("ADCvsAPVs",";ADCvsAPVs", 768,-0.5,767.5, 1023, -0.5, 1022.5);
72  ibooker.tag(h1ADC_vs_strip_,2);
73 
74  return;
75 }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:112
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:286
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:130
void SiStripBaselineValidator::endJob ( void  )
virtual

analyzer loop

Definition at line 131 of file SiStripBaselineValidator.cc.

131  {
132 
133  if (!outputFile_.empty() && createOutputFile_) {
134  dbe->save(outputFile_);
135  }
136 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2424

Member Data Documentation

bool SiStripBaselineValidator::createOutputFile_
private

Definition at line 62 of file SiStripBaselineValidator.h.

DQMStore* SiStripBaselineValidator::dbe
private

Definition at line 53 of file SiStripBaselineValidator.h.

MonitorElement* SiStripBaselineValidator::h1ADC_vs_strip_
private

Definition at line 56 of file SiStripBaselineValidator.h.

MonitorElement* SiStripBaselineValidator::h1NumbadAPVsRes_
private

Definition at line 55 of file SiStripBaselineValidator.h.

edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi> > SiStripBaselineValidator::moduleRawDigiToken_
private

Definition at line 59 of file SiStripBaselineValidator.h.

std::string SiStripBaselineValidator::outputFile_
private

Definition at line 61 of file SiStripBaselineValidator.h.

edm::InputTag SiStripBaselineValidator::srcProcessedRawDigi_
private

Definition at line 58 of file SiStripBaselineValidator.h.