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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 analyzer loop More...
 
 SiStripBaselineValidator (const edm::ParameterSet &)
 
virtual ~SiStripBaselineValidator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool createOutputFile_
 
DQMStoredbe
 
MonitorElementh1ADC_vs_strip_
 
MonitorElementh1NumbadAPVsRes_
 
std::string outputFile_
 
edm::InputTag srcProcessedRawDigi_
 

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 &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 36 of file SiStripBaselineValidator.h.

Constructor & Destructor Documentation

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

Definition at line 49 of file SiStripBaselineValidator.cc.

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

49  {
50 
51  srcProcessedRawDigi_ = conf.getParameter<edm::InputTag>( "srcProcessedRawDigi" );
52  // hiSelectedTracks = conf.getParameter<edm::InputTag>( "hiSelectedTracks" );
53  createOutputFile_ = conf.getUntrackedParameter<bool>("saveFile",false);
54  outputFile_ = conf.getParameter<std::string>("outputFile");
56 
57 
58 
59 
60 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
SiStripBaselineValidator::~SiStripBaselineValidator ( )
virtual

Definition at line 62 of file SiStripBaselineValidator.cc.

63 {
64 }

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::EDAnalyzer.

Definition at line 88 of file SiStripBaselineValidator.cc.

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

89 {
90  /* edm::Handle<reco::TrackCollection> tracks;
91  e.getByLabel("hiSelectedTracks", tracks);
92 
93  int ntracks =0;
94  for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); track++) {
95  ntracks++;
96 
97  }
98 */
99 
100 
102  e.getByLabel(srcProcessedRawDigi_,moduleRawDigi);
103  edm::DetSetVector<SiStripRawDigi>::const_iterator itRawDigis = moduleRawDigi->begin();
104 
105  // uint32_t Nmodule = moduleRawDigi->size();
106 
107  int NumResAPVs=0;
108  for (; itRawDigis != moduleRawDigi->end(); ++itRawDigis) {
109 
110 
111  edm::DetSet<SiStripRawDigi>::const_iterator itRaw = itRawDigis->begin();
112  int strip =0, totADC=0;
113 
114  for(;itRaw != itRawDigis->end(); ++itRaw, ++strip){
115 
116  float adc = itRaw->adc();
117  h1ADC_vs_strip_->Fill(strip,adc);
118 
119 
120 
121  totADC+= adc;
122 
123  if(strip%127 ==0){
124  if(totADC!= 0){
125  totADC =0;
126 
127  NumResAPVs++;
128 
129  }
130  }
131 
132  }
133 
134 
135  }
136 
138 
139  h1NumbadAPVsRes_->Fill(NumResAPVs);
140 
141 
142 
143 }
int adc(sample_type sample)
get the ADC sample (12 bits)
void Fill(long long x)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:341
collection_type::const_iterator const_iterator
Definition: DetSet.h:34
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106
void SiStripBaselineValidator::beginJob ( void  )
virtual

Setting the DQM top directories

Reimplemented from edm::EDAnalyzer.

Definition at line 67 of file SiStripBaselineValidator.cc.

68 {
69 
70  if(dbe){
72  dbe->setCurrentFolder("SiStrip/BaselineValidator");
73 
74 
75  h1NumbadAPVsRes_ = dbe->book1D("ResAPVs",";#ResAPVs", 100, 1.0, 10001);
77 
78  h1ADC_vs_strip_ = dbe->book2D("ADCvsAPVs",";ADCvsAPVs", 768,-0.5,767.5, 1023, -0.5, 1022.5);
80 
81 
82  }
83 
84  return;
85 
86 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1359
const std::string getFullname(void) const
get full name of ME including Pathname
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:850
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void SiStripBaselineValidator::endJob ( void  )
virtual

analyzer loop

Reimplemented from edm::EDAnalyzer.

Definition at line 149 of file SiStripBaselineValidator.cc.

149  {
150 
151  if (!outputFile_.empty() && createOutputFile_) {
152  dbe->save(outputFile_);
153  }
154 }
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:2118

Member Data Documentation

bool SiStripBaselineValidator::createOutputFile_
private

Definition at line 56 of file SiStripBaselineValidator.h.

DQMStore* SiStripBaselineValidator::dbe
private

Definition at line 48 of file SiStripBaselineValidator.h.

MonitorElement* SiStripBaselineValidator::h1ADC_vs_strip_
private

Definition at line 51 of file SiStripBaselineValidator.h.

MonitorElement* SiStripBaselineValidator::h1NumbadAPVsRes_
private

Definition at line 50 of file SiStripBaselineValidator.h.

std::string SiStripBaselineValidator::outputFile_
private

Definition at line 55 of file SiStripBaselineValidator.h.

edm::InputTag SiStripBaselineValidator::srcProcessedRawDigi_
private

Definition at line 53 of file SiStripBaselineValidator.h.