CMS 3D CMS Logo

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

#include <CSCCLCTPreTriggerDigiValidation.h>

Inheritance diagram for CSCCLCTPreTriggerDigiValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &)
 
 CSCCLCTPreTriggerDigiValidation (const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
 
 ~CSCCLCTPreTriggerDigiValidation () 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 > preclctMaxBin_
 
std::vector< double > preclctMinBin_
 
std::vector< unsigned > preclctNBin_
 
edm::EDGetTokenT< CSCCLCTPreTriggerDigiCollectionpreclcts_Token_
 
std::vector< std::string > preclctVars_
 

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 CSCCLCTPreTriggerDigiValidation.h.

Constructor & Destructor Documentation

◆ CSCCLCTPreTriggerDigiValidation()

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

Definition at line 9 of file CSCCLCTPreTriggerDigiValidation.cc.

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

11  : CSCBaseValidation(ps),
12  chambers_(ps.getParameter<std::vector<std::string>>("chambers")),
13  // variables
14  preclctVars_(ps.getParameter<std::vector<std::string>>("preclctVars")),
15  // binning
16  preclctNBin_(ps.getParameter<std::vector<unsigned>>("preclctNBin")),
17  preclctMinBin_(ps.getParameter<std::vector<double>>("preclctMinBin")),
18  preclctMaxBin_(ps.getParameter<std::vector<double>>("preclctMaxBin")) {
19  const auto &pset = ps.getParameterSet("cscCLCTPreTrigger");
20  inputTag_ = pset.getParameter<edm::InputTag>("inputTag");
22 }
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< CSCCLCTPreTriggerDigiCollection > preclcts_Token_
CSCBaseValidation(const edm::ParameterSet &ps)
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...

◆ ~CSCCLCTPreTriggerDigiValidation()

CSCCLCTPreTriggerDigiValidation::~CSCCLCTPreTriggerDigiValidation ( )
override

Definition at line 24 of file CSCCLCTPreTriggerDigiValidation.cc.

24 {}

Member Function Documentation

◆ analyze()

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

Implements CSCBaseValidation.

Definition at line 48 of file CSCCLCTPreTriggerDigiValidation.cc.

References MuonDigiCollection< IndexType, DigiType >::begin(), chamberHistos, chambers_, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), MuonDigiCollection< IndexType, DigiType >::end(), CSCDetId::endcap(), MuonDigiCollection< IndexType, DigiType >::get(), CSCDetId::iChamberType(), inputTag_, edm::HandleBase::isValid(), dqmiolumiharvest::j, preclcts_Token_, and FastTimerService_cff::range.

48  {
50  e.getByToken(preclcts_Token_, preclcts);
51  if (!preclcts.isValid()) {
52  edm::LogError("CSCCLCTPreTriggerDigiValidation") << "Cannot get CLCTPreTriggers by label " << inputTag_.encode();
53  }
54 
55  for (auto j = preclcts->begin(); j != preclcts->end(); j++) {
56  const CSCDetId &detId((*j).first);
57  int chamberType = detId.iChamberType();
58 
59  auto range = preclcts->get((*j).first);
60  // 1=forward (+Z); 2=backward (-Z)
61  const unsigned typeCorrected(detId.endcap() == 1 ? chamberType - 2 : chamberType - 2 + chambers_.size());
62  for (auto preclct = range.first; preclct != range.second; preclct++) {
63  if (preclct->isValid()) {
64  chamberHistos[typeCorrected]["preclct_cfeb"]->Fill(preclct->getCFEB());
65  chamberHistos[typeCorrected]["preclct_halfstrip"]->Fill(preclct->getKeyStrip());
66  chamberHistos[typeCorrected]["preclct_bx"]->Fill(preclct->getBX());
67  }
68  }
69  }
70 }
std::string encode() const
Definition: InputTag.cc:159
Log< level::Error, false > LogError
edm::EDGetTokenT< CSCCLCTPreTriggerDigiCollection > preclcts_Token_
Range get(const IndexType &index) const
return the digis for a given DetUnit
DigiRangeIterator begin() const
bool isValid() const
Definition: HandleBase.h:70
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
DigiRangeIterator end() const

◆ bookHistograms()

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

Definition at line 26 of file CSCCLCTPreTriggerDigiValidation.cc.

References dqm::implementation::IBooker::book1D(), chamberHistos, chambers_, B2GTnPMonitor_cfi::histTitle, crabWrapper::key, preclctMaxBin_, preclctMinBin_, preclctNBin_, preclctVars_, dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

26  {
27  iBooker.setCurrentFolder("MuonCSCDigisV/CSCDigiTask/PreCLCT/Occupancy/");
28 
29  // chamber type
30  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
31  // consider CSC+ and CSC- separately
32  for (unsigned iEndcap = 0; iEndcap < 2; iEndcap++) {
33  const std::string eSign(iEndcap == 0 ? "+" : "-");
34  // preclct variable
35  for (unsigned iVar = 0; iVar < preclctVars_.size(); iVar++) {
36  const std::string key("preclct_" + preclctVars_[iVar]);
37  const std::string histName(key + "_" + chambers_[iType] + eSign);
38  const std::string histTitle(chambers_[iType] + eSign + " CLCTPreTrigger " + preclctVars_[iVar]);
39  const unsigned iTypeCorrected(iEndcap == 0 ? iType : iType + chambers_.size());
40  chamberHistos[iTypeCorrected][key] =
41  iBooker.book1D(histName, histTitle, preclctNBin_[iVar], preclctMinBin_[iVar], preclctMaxBin_[iVar]);
42  chamberHistos[iTypeCorrected][key]->getTH1()->SetMinimum(0);
43  }
44  }
45  }
46 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
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 *> > CSCCLCTPreTriggerDigiValidation::chamberHistos
private

Definition at line 34 of file CSCCLCTPreTriggerDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ chambers_

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

Definition at line 22 of file CSCCLCTPreTriggerDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ chambersRun3_

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

Definition at line 23 of file CSCCLCTPreTriggerDigiValidation.h.

◆ inputTag_

edm::InputTag CSCCLCTPreTriggerDigiValidation::inputTag_
private

Definition at line 19 of file CSCCLCTPreTriggerDigiValidation.h.

Referenced by analyze(), and CSCCLCTPreTriggerDigiValidation().

◆ isRun3_

bool CSCCLCTPreTriggerDigiValidation::isRun3_
private

Definition at line 30 of file CSCCLCTPreTriggerDigiValidation.h.

◆ preclctMaxBin_

std::vector<double> CSCCLCTPreTriggerDigiValidation::preclctMaxBin_
private

Definition at line 28 of file CSCCLCTPreTriggerDigiValidation.h.

Referenced by bookHistograms().

◆ preclctMinBin_

std::vector<double> CSCCLCTPreTriggerDigiValidation::preclctMinBin_
private

Definition at line 27 of file CSCCLCTPreTriggerDigiValidation.h.

Referenced by bookHistograms().

◆ preclctNBin_

std::vector<unsigned> CSCCLCTPreTriggerDigiValidation::preclctNBin_
private

Definition at line 26 of file CSCCLCTPreTriggerDigiValidation.h.

Referenced by bookHistograms().

◆ preclcts_Token_

edm::EDGetTokenT<CSCCLCTPreTriggerDigiCollection> CSCCLCTPreTriggerDigiValidation::preclcts_Token_
private

Definition at line 18 of file CSCCLCTPreTriggerDigiValidation.h.

Referenced by analyze(), and CSCCLCTPreTriggerDigiValidation().

◆ preclctVars_

std::vector<std::string> CSCCLCTPreTriggerDigiValidation::preclctVars_
private

Definition at line 25 of file CSCCLCTPreTriggerDigiValidation.h.

Referenced by bookHistograms().