CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Attributes
CSCCorrelatedLCTDigiValidation Class Reference

#include <CSCCorrelatedLCTDigiValidation.h>

Inheritance diagram for CSCCorrelatedLCTDigiValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &)
 
 CSCCorrelatedLCTDigiValidation (const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
 
 ~CSCCorrelatedLCTDigiValidation () 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::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
 
std::vector< std::string > chambers_
 
std::vector< unsigned > chambersRun3_
 
edm::InputTag inputTag_
 
bool isRun3_
 
std::vector< double > lctMaxBin_
 
std::vector< double > lctMinBin_
 
std::vector< unsigned > lctNBin_
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionlcts_Token_
 
std::vector< std::string > lctVars_
 
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 CSCCorrelatedLCTDigiValidation.h.

Constructor & Destructor Documentation

◆ CSCCorrelatedLCTDigiValidation()

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

Definition at line 9 of file CSCCorrelatedLCTDigiValidation.cc.

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

10  : CSCBaseValidation(ps),
12  chambers_(ps.getParameter<std::vector<std::string>>("chambers")),
13  chambersRun3_(ps.getParameter<std::vector<unsigned>>("chambersRun3")),
14  // variables
15  lctVars_(ps.getParameter<std::vector<std::string>>("lctVars")),
16  // binning
17  lctNBin_(ps.getParameter<std::vector<unsigned>>("lctNBin")),
18  lctMinBin_(ps.getParameter<std::vector<double>>("lctMinBin")),
19  lctMaxBin_(ps.getParameter<std::vector<double>>("lctMaxBin")),
20  isRun3_(ps.getParameter<bool>("isRun3")) {
21  const auto &pset = ps.getParameterSet("cscMPLCT");
22  inputTag_ = pset.getParameter<edm::InputTag>("inputTag");
24 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_Token_
CSCBaseValidation(const edm::ParameterSet &ps)

◆ ~CSCCorrelatedLCTDigiValidation()

CSCCorrelatedLCTDigiValidation::~CSCCorrelatedLCTDigiValidation ( )
override

Definition at line 26 of file CSCCorrelatedLCTDigiValidation.cc.

26 {}

Member Function Documentation

◆ analyze()

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

Implements CSCBaseValidation.

Definition at line 88 of file CSCCorrelatedLCTDigiValidation.cc.

References chamberHistos, chambers_, chambersRun3_, nano_mu_digi_cff::chamberType, hcalRecHitTable_cff::detId, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), dqm::impl::MonitorElement::Fill(), spr::find(), inputTag_, isRun3_, edm::HandleBase::isValid(), dqmiolumiharvest::j, lcts_Token_, FastTimerService_cff::range, theNDigisPerChamberPlots, and theNDigisPerEventPlot.

88  {
90  e.getByToken(lcts_Token_, lcts);
91  if (!lcts.isValid()) {
92  edm::LogError("CSCDigiDump") << "Cannot get CorrelatedLCTs by label " << inputTag_.encode();
93  }
94 
95  unsigned nDigisPerEvent = 0;
96 
97  for (auto j = lcts->begin(); j != lcts->end(); j++) {
98  auto beginDigi = (*j).second.first;
99  auto endDigi = (*j).second.second;
100  const CSCDetId &detId((*j).first);
101  int chamberType = detId.iChamberType();
102  int nDigis = endDigi - beginDigi;
103  nDigisPerEvent += nDigis;
105 
106  auto range = lcts->get((*j).first);
107  // 1=forward (+Z); 2=backward (-Z)
108  const unsigned typeCorrected(detId.endcap() == 1 ? chamberType - 2 : chamberType - 2 + chambers_.size());
109  for (auto lct = range.first; lct != range.second; lct++) {
110  if (lct->isValid()) {
111  chamberHistos[typeCorrected]["lct_pattern"]->Fill(lct->getPattern());
112  chamberHistos[typeCorrected]["lct_quality"]->Fill(lct->getQuality());
113  chamberHistos[typeCorrected]["lct_wiregroup"]->Fill(lct->getKeyWG());
114  chamberHistos[typeCorrected]["lct_halfstrip"]->Fill(lct->getStrip());
115  chamberHistos[typeCorrected]["lct_bend"]->Fill(lct->getBend());
116  chamberHistos[typeCorrected]["lct_bx"]->Fill(lct->getBX());
117  chamberHistos[typeCorrected]["lct_type"]->Fill(lct->getType());
118  if (isRun3_) {
119  // ignore these fields for chambers that do not enable the Run-3 algorithm
120  if (std::find(chambersRun3_.begin(), chambersRun3_.end(), chamberType - 2) == chambersRun3_.end())
121  continue;
122  chamberHistos[typeCorrected]["lct_run3pattern"]->Fill(lct->getRun3Pattern());
123  chamberHistos[typeCorrected]["lct_slope"]->Fill(lct->getSlope());
124  chamberHistos[typeCorrected]["lct_quartstrip"]->Fill(lct->getStrip(4));
125  chamberHistos[typeCorrected]["lct_eighthstrip"]->Fill(lct->getStrip(8));
126  }
127  }
128  }
129  }
130  theNDigisPerEventPlot->Fill(nDigisPerEvent);
131 }
std::string encode() const
Definition: InputTag.cc:159
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_Token_
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
void Fill(long long x)
bool isValid() const
Definition: HandleBase.h:70
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos

◆ bookHistograms()

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

Definition at line 28 of file CSCCorrelatedLCTDigiValidation.cc.

References dqm::implementation::IBooker::book1D(), chamberHistos, CSCDetId::chamberName(), chambers_, chambersRun3_, spr::find(), B2GTnPMonitor_cfi::histTitle, mps_fire::i, isRun3_, crabWrapper::key, lctMaxBin_, lctMinBin_, lctNBin_, lctVars_, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, RandomServiceHelper::t2, theNDigisPerChamberPlots, and theNDigisPerEventPlot.

28  {
29  iBooker.setCurrentFolder("MuonCSCDigisV/CSCDigiTask/LCT/Occupancy/");
30 
32  iBooker.book1D("CSCCorrelatedLCTDigisPerEvent",
33  "CorrelatedLCT trigger primitives per event; Number of CorrelatedLCTs; Entries",
34  100,
35  0,
36  100);
37  for (int i = 1; i <= 10; ++i) {
38  const std::string t2("CSCCorrelatedLCTDigisPerChamber_" + CSCDetId::chamberName(i));
40  iBooker.book1D(t2,
41  "Number of CorrelatedLCTs per chamber " + CSCDetId::chamberName(i) +
42  ";Number of CorrelatedLCTs per chamber;Entries",
43  4,
44  0,
45  4);
46  }
47 
48  // do not analyze Run-3 properties in Run-1 and Run-2 eras
49  if (!isRun3_) {
50  lctVars_.resize(7);
51  }
52 
53  // chamber type
54  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
55  // consider CSC+ and CSC- separately
56  for (unsigned iEndcap = 0; iEndcap < 2; iEndcap++) {
57  const std::string eSign(iEndcap == 0 ? "+" : "-");
58  // lct variable
59  for (unsigned iVar = 0; iVar < lctVars_.size(); iVar++) {
60  if (std::find(chambersRun3_.begin(), chambersRun3_.end(), iType) == chambersRun3_.end()) {
61  if (iVar > 6)
62  continue;
63  }
64  const std::string key("lct_" + lctVars_[iVar]);
65  const std::string histName(key + "_" + chambers_[iType] + eSign);
66  const std::string histTitle(chambers_[iType] + eSign + " LCT " + lctVars_[iVar]);
67  const unsigned iTypeCorrected(iEndcap == 0 ? iType : iType + chambers_.size());
68  chamberHistos[iTypeCorrected][key] =
69  iBooker.book1D(histName, histTitle, lctNBin_[iVar], lctMinBin_[iVar], lctMaxBin_[iVar]);
70  chamberHistos[iTypeCorrected][key]->getTH1()->SetMinimum(0);
71  // set bin labels for the "type" plot. very useful in ME1/1 and ME2/1
72  // when the GEM-CSC ILTs will be running
73  if (lctVars_[iVar] == "type") {
74  chamberHistos[iTypeCorrected][key]->setBinLabel(1, "CLCTALCT", 1);
75  chamberHistos[iTypeCorrected][key]->setBinLabel(2, "ALCTCLCT", 1);
76  chamberHistos[iTypeCorrected][key]->setBinLabel(3, "ALCTCLCTGEM", 1);
77  chamberHistos[iTypeCorrected][key]->setBinLabel(4, "ALCTCLCT2GEM", 1);
78  chamberHistos[iTypeCorrected][key]->setBinLabel(5, "ALCT2GEM", 1);
79  chamberHistos[iTypeCorrected][key]->setBinLabel(6, "CLCT2GEM", 1);
80  chamberHistos[iTypeCorrected][key]->setBinLabel(7, "CLCTONLY", 1);
81  chamberHistos[iTypeCorrected][key]->setBinLabel(8, "ALCTONLY", 1);
82  }
83  }
84  }
85  }
86 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::string chamberName() const
Definition: CSCDetId.cc:92
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos

Member Data Documentation

◆ chamberHistos

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

Definition at line 36 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ chambers_

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

Definition at line 24 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ chambersRun3_

std::vector<unsigned> CSCCorrelatedLCTDigiValidation::chambersRun3_
private

Definition at line 25 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ inputTag_

edm::InputTag CSCCorrelatedLCTDigiValidation::inputTag_
private

Definition at line 19 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by analyze(), and CSCCorrelatedLCTDigiValidation().

◆ isRun3_

bool CSCCorrelatedLCTDigiValidation::isRun3_
private

Definition at line 32 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ lctMaxBin_

std::vector<double> CSCCorrelatedLCTDigiValidation::lctMaxBin_
private

Definition at line 30 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by bookHistograms().

◆ lctMinBin_

std::vector<double> CSCCorrelatedLCTDigiValidation::lctMinBin_
private

Definition at line 29 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by bookHistograms().

◆ lctNBin_

std::vector<unsigned> CSCCorrelatedLCTDigiValidation::lctNBin_
private

Definition at line 28 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by bookHistograms().

◆ lcts_Token_

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCCorrelatedLCTDigiValidation::lcts_Token_
private

Definition at line 18 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by analyze(), and CSCCorrelatedLCTDigiValidation().

◆ lctVars_

std::vector<std::string> CSCCorrelatedLCTDigiValidation::lctVars_
private

Definition at line 27 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by bookHistograms().

◆ theNDigisPerChamberPlots

MonitorElement* CSCCorrelatedLCTDigiValidation::theNDigisPerChamberPlots[10]
private

Definition at line 20 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerEventPlot

MonitorElement* CSCCorrelatedLCTDigiValidation::theNDigisPerEventPlot
private

Definition at line 21 of file CSCCorrelatedLCTDigiValidation.h.

Referenced by analyze(), and bookHistograms().