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
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
 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
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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

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

Definition at line 84 of file SiStripBaselineValidator.cc.

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

85 {
86  /* edm::Handle<reco::TrackCollection> tracks;
87  e.getByLabel("hiSelectedTracks", tracks);
88 
89  int ntracks =0;
90  for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); track++) {
91  ntracks++;
92 
93  }
94 */
95 
96 
98  // e.getByLabel(srcProcessedRawDigi_,moduleRawDigi);
99  e.getByToken( moduleRawDigiToken_, moduleRawDigi );
100  edm::DetSetVector<SiStripRawDigi>::const_iterator itRawDigis = moduleRawDigi->begin();
101 
102  // uint32_t Nmodule = moduleRawDigi->size();
103 
104  int NumResAPVs=0;
105  for (; itRawDigis != moduleRawDigi->end(); ++itRawDigis) {
106 
107 
108  edm::DetSet<SiStripRawDigi>::const_iterator itRaw = itRawDigis->begin();
109  int strip =0, totADC=0;
110 
111  for(;itRaw != itRawDigis->end(); ++itRaw, ++strip){
112 
113  float adc = itRaw->adc();
114  h1ADC_vs_strip_->Fill(strip,adc);
115 
116 
117 
118  totADC+= adc;
119 
120  if(strip%127 ==0){
121  if(totADC!= 0){
122  totADC =0;
123 
124  NumResAPVs++;
125 
126  }
127  }
128 
129  }
130 
131 
132  }
133 
135 
136  h1NumbadAPVsRes_->Fill(NumResAPVs);
137 
138 
139 
140 }
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:356
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:341
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

Setting the DQM top directories

Reimplemented from edm::EDAnalyzer.

Definition at line 63 of file SiStripBaselineValidator.cc.

64 {
65 
66  if(dbe){
68  dbe->setCurrentFolder("SiStrip/BaselineValidator");
69 
70 
71  h1NumbadAPVsRes_ = dbe->book1D("ResAPVs",";#ResAPVs", 100, 1.0, 10001);
73 
74  h1ADC_vs_strip_ = dbe->book2D("ADCvsAPVs",";ADCvsAPVs", 768,-0.5,767.5, 1023, -0.5, 1022.5);
76 
77 
78  }
79 
80  return;
81 
82 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1509
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:1000
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void SiStripBaselineValidator::endJob ( void  )
virtual

analyzer loop

Reimplemented from edm::EDAnalyzer.

Definition at line 146 of file SiStripBaselineValidator.cc.

146  {
147 
148  if (!outputFile_.empty() && createOutputFile_) {
149  dbe->save(outputFile_);
150  }
151 }
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:2296

Member Data Documentation

bool SiStripBaselineValidator::createOutputFile_
private

Definition at line 61 of file SiStripBaselineValidator.h.

DQMStore* SiStripBaselineValidator::dbe
private

Definition at line 52 of file SiStripBaselineValidator.h.

MonitorElement* SiStripBaselineValidator::h1ADC_vs_strip_
private

Definition at line 55 of file SiStripBaselineValidator.h.

MonitorElement* SiStripBaselineValidator::h1NumbadAPVsRes_
private

Definition at line 54 of file SiStripBaselineValidator.h.

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

Definition at line 58 of file SiStripBaselineValidator.h.

std::string SiStripBaselineValidator::outputFile_
private

Definition at line 60 of file SiStripBaselineValidator.h.

edm::InputTag SiStripBaselineValidator::srcProcessedRawDigi_
private

Definition at line 57 of file SiStripBaselineValidator.h.