CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCALCTDigiValidation Class Reference

#include <CSCALCTDigiValidation.h>

Inheritance diagram for CSCALCTDigiValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &)
 
 CSCALCTDigiValidation (const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
 
 ~CSCALCTDigiValidation () override
 
- Public Member Functions inherited from CSCBaseValidation
 CSCBaseValidation (const edm::ParameterSet &ps)
 
void setGeometry (const CSCGeometry *geom)
 
void setSimHitMap (const PSimHitMap *simHitMap)
 
virtual ~CSCBaseValidation ()
 

Private Attributes

std::vector< double > alctMaxBin_
 
std::vector< double > alctMinBin_
 
std::vector< unsigned > alctNBin_
 
edm::EDGetTokenT< CSCALCTDigiCollectionalcts_Token_
 
std::vector< std::string > alctVars_
 
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
 
std::vector< std::string > chambers_
 
edm::InputTag inputTag_
 
MonitorElementtheNDigisPerChamberPlots [10]
 
MonitorElementtheNDigisPerEventPlot
 

Additional Inherited Members

- Public Types inherited from CSCBaseValidation
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from CSCBaseValidation
const CSCLayerfindLayer (int detId) const
 
bool isSimTrackGood (const SimTrack &t) const
 
- Protected Attributes inherited from CSCBaseValidation
bool doSim_
 
double simTrackMaxEta_
 
double simTrackMinEta_
 
double simTrackMinPt_
 
const CSCGeometrytheCSCGeometry
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 10 of file CSCALCTDigiValidation.h.

Constructor & Destructor Documentation

◆ CSCALCTDigiValidation()

CSCALCTDigiValidation::CSCALCTDigiValidation ( const edm::ParameterSet ps,
edm::ConsumesCollector &&  iC 
)

Definition at line 9 of file CSCALCTDigiValidation.cc.

References alcts_Token_, edm::ParameterSet::getParameterSet(), inputTag_, and muonDTDigis_cfi::pset.

10  : CSCBaseValidation(ps),
12  chambers_(ps.getParameter<std::vector<std::string>>("chambers")),
13  // variables
14  alctVars_(ps.getParameter<std::vector<std::string>>("alctVars")),
15  // binning
16  alctNBin_(ps.getParameter<std::vector<unsigned>>("alctNBin")),
17  alctMinBin_(ps.getParameter<std::vector<double>>("alctMinBin")),
18  alctMaxBin_(ps.getParameter<std::vector<double>>("alctMaxBin")) {
19  const auto &pset = ps.getParameterSet("cscALCT");
20  inputTag_ = pset.getParameter<edm::InputTag>("inputTag");
22 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< std::string > chambers_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * theNDigisPerChamberPlots[10]
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< CSCALCTDigiCollection > alcts_Token_
std::vector< double > alctMinBin_
CSCBaseValidation(const edm::ParameterSet &ps)
std::vector< std::string > alctVars_
std::vector< double > alctMaxBin_
std::vector< unsigned > alctNBin_

◆ ~CSCALCTDigiValidation()

CSCALCTDigiValidation::~CSCALCTDigiValidation ( )
override

Definition at line 24 of file CSCALCTDigiValidation.cc.

24 {}

Member Function Documentation

◆ analyze()

void CSCALCTDigiValidation::analyze ( const edm::Event e,
const edm::EventSetup  
)
overridevirtual

Implements CSCBaseValidation.

Definition at line 56 of file CSCALCTDigiValidation.cc.

References alcts_Token_, chamberHistos, chambers_, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), CSCDetId::endcap(), dqm::impl::MonitorElement::Fill(), CSCDetId::iChamberType(), inputTag_, edm::HandleBase::isValid(), dqmiolumiharvest::j, FastTimerService_cff::range, theNDigisPerChamberPlots, and theNDigisPerEventPlot.

56  {
58  e.getByToken(alcts_Token_, alcts);
59  if (!alcts.isValid()) {
60  edm::LogError("CSCALCTDigiValidation") << "Cannot get ALCTs by label " << inputTag_.encode();
61  }
62  unsigned nDigisPerEvent = 0;
63 
64  for (auto j = alcts->begin(); j != alcts->end(); j++) {
65  auto beginDigi = (*j).second.first;
66  auto endDigi = (*j).second.second;
67  const CSCDetId &detId((*j).first);
68  int chamberType = detId.iChamberType();
69  int nDigis = endDigi - beginDigi;
70  nDigisPerEvent += nDigis;
71  theNDigisPerChamberPlots[chamberType - 1]->Fill(nDigis);
72 
73  auto range = alcts->get((*j).first);
74  // 1=forward (+Z); 2=backward (-Z)
75  const unsigned typeCorrected(detId.endcap() == 1 ? chamberType - 2 : chamberType - 2 + chambers_.size());
76  for (auto alct = range.first; alct != range.second; alct++) {
77  if (alct->isValid()) {
78  chamberHistos[typeCorrected]["alct_quality"]->Fill(alct->getQuality());
79  chamberHistos[typeCorrected]["alct_wiregroup"]->Fill(alct->getKeyWG());
80  chamberHistos[typeCorrected]["alct_bx"]->Fill(alct->getBX());
81  }
82  }
83  }
84  theNDigisPerEventPlot->Fill(nDigisPerEvent);
85 }
std::vector< std::string > chambers_
MonitorElement * theNDigisPerChamberPlots[10]
std::string encode() const
Definition: InputTag.cc:159
Log< level::Error, false > LogError
void Fill(long long x)
edm::EDGetTokenT< CSCALCTDigiCollection > alcts_Token_
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * theNDigisPerEventPlot
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos

◆ bookHistograms()

void CSCALCTDigiValidation::bookHistograms ( DQMStore::IBooker iBooker)

Definition at line 26 of file CSCALCTDigiValidation.cc.

References alctMaxBin_, alctMinBin_, alctNBin_, alctVars_, dqm::implementation::IBooker::book1D(), chamberHistos, CSCDetId::chamberName(), chambers_, B2GTnPMonitor_cfi::histTitle, mps_fire::i, crabWrapper::key, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, RandomServiceHelper::t2, theNDigisPerChamberPlots, and theNDigisPerEventPlot.

26  {
27  iBooker.setCurrentFolder("MuonCSCDigisV/CSCDigiTask/ALCT/Occupancy/");
28 
29  theNDigisPerEventPlot = iBooker.book1D(
30  "CSCALCTDigisPerEvent", "ALCT trigger primitives per event; Number of ALCTs; Entries", 100, 0, 100);
31  for (int i = 1; i <= 10; ++i) {
32  const std::string t2("CSCALCTDigisPerChamber_" + CSCDetId::chamberName(i));
33  theNDigisPerChamberPlots[i - 1] = iBooker.book1D(
34  t2, "Number of ALCTs per chamber " + CSCDetId::chamberName(i) + ";Number of ALCTs per chamber;Entries", 4, 0, 4);
35  }
36 
37  // chamber type
38  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
39  // consider CSC+ and CSC- separately
40  for (unsigned iEndcap = 0; iEndcap < 2; iEndcap++) {
41  const std::string eSign(iEndcap == 0 ? "+" : "-");
42  // alct variable
43  for (unsigned iVar = 0; iVar < alctVars_.size(); iVar++) {
44  const std::string key("alct_" + alctVars_[iVar]);
45  const std::string histName(key + "_" + chambers_[iType] + eSign);
46  const std::string histTitle(chambers_[iType] + eSign + " ALCT " + alctVars_[iVar]);
47  const unsigned iTypeCorrected(iEndcap == 0 ? iType : iType + chambers_.size());
48  chamberHistos[iTypeCorrected][key] =
49  iBooker.book1D(histName, histTitle, alctNBin_[iVar], alctMinBin_[iVar], alctMaxBin_[iVar]);
50  chamberHistos[iTypeCorrected][key]->getTH1()->SetMinimum(0);
51  }
52  }
53  }
54 }
std::vector< std::string > chambers_
MonitorElement * theNDigisPerChamberPlots[10]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::vector< double > alctMinBin_
std::string chamberName() const
Definition: CSCDetId.cc:92
std::vector< std::string > alctVars_
std::vector< double > alctMaxBin_
std::vector< unsigned > alctNBin_
MonitorElement * theNDigisPerEventPlot
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

Member Data Documentation

◆ alctMaxBin_

std::vector<double> CSCALCTDigiValidation::alctMaxBin_
private

Definition at line 29 of file CSCALCTDigiValidation.h.

Referenced by bookHistograms().

◆ alctMinBin_

std::vector<double> CSCALCTDigiValidation::alctMinBin_
private

Definition at line 28 of file CSCALCTDigiValidation.h.

Referenced by bookHistograms().

◆ alctNBin_

std::vector<unsigned> CSCALCTDigiValidation::alctNBin_
private

Definition at line 27 of file CSCALCTDigiValidation.h.

Referenced by bookHistograms().

◆ alcts_Token_

edm::EDGetTokenT<CSCALCTDigiCollection> CSCALCTDigiValidation::alcts_Token_
private

Definition at line 18 of file CSCALCTDigiValidation.h.

Referenced by analyze(), and CSCALCTDigiValidation().

◆ alctVars_

std::vector<std::string> CSCALCTDigiValidation::alctVars_
private

Definition at line 26 of file CSCALCTDigiValidation.h.

Referenced by bookHistograms().

◆ chamberHistos

std::map<uint32_t, std::map<std::string, MonitorElement *> > CSCALCTDigiValidation::chamberHistos
private

Definition at line 33 of file CSCALCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ chambers_

std::vector<std::string> CSCALCTDigiValidation::chambers_
private

Definition at line 24 of file CSCALCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ inputTag_

edm::InputTag CSCALCTDigiValidation::inputTag_
private

Definition at line 19 of file CSCALCTDigiValidation.h.

Referenced by analyze(), and CSCALCTDigiValidation().

◆ theNDigisPerChamberPlots

MonitorElement* CSCALCTDigiValidation::theNDigisPerChamberPlots[10]
private

Definition at line 20 of file CSCALCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerEventPlot

MonitorElement* CSCALCTDigiValidation::theNDigisPerEventPlot
private

Definition at line 21 of file CSCALCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().